ADC configuration tool

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: ADC configuration tool

Postby Giovanni » Mon Aug 24, 2020 3:16 pm

Could you specify exactly what you need?

Giovanni

ceremcem
Posts: 67
Joined: Mon Aug 10, 2015 6:57 am
Has thanked: 7 times
Been thanked: 6 times

Re: ADC configuration tool

Postby ceremcem » Mon Aug 24, 2020 4:17 pm

There are 1162 MCU definitions in STM database and around 144 MCU family definitions (or less?) in ChibiOS. In order to generate board.h dynamically, I need to map the exact MCU type (eg. "STM32F030F4Px") to the corresponding ChibiOS family definition (eg. "STM32F030x4"), or display an error if that MCU is not supported by ChibiOS.

To achieve this, I need to have the ChibiOS "MCU type" list. Every line should contain exactly what we should write one of them into the board.h, like:

Code: Select all

STM32F030x4
Last edited by ceremcem on Mon Aug 24, 2020 5:19 pm, edited 1 time in total.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: ADC configuration tool

Postby Giovanni » Mon Aug 24, 2020 5:18 pm

Hi,

Then the best thing is to parse the stm32_registry.h files, search for "defined(STM32xxxxx)" and you get exactly the list of devices who are supported in HAL as to be written in board.h.

Giovanni

ceremcem
Posts: 67
Joined: Mon Aug 10, 2015 6:57 am
Has thanked: 7 times
Been thanked: 6 times

Re: ADC configuration tool

Postby ceremcem » Mon Aug 24, 2020 9:54 pm

For those who might be interested in, here is the code I use to extract the supported types (Linux, Bash):

Code: Select all

find -name stm32_registry.h -exec cat {} \; \
    | tr ' ' '\n' \
    | grep -oP '(?<=defined\()STM32.+(?=\))' \
    | sort \
    | uniq


Currently 135 entries generated.

mobyfab
Posts: 483
Joined: Sat Nov 19, 2011 6:47 pm
Location: Le Mans, France
Has thanked: 21 times
Been thanked: 30 times

Re: ADC configuration tool

Postby mobyfab » Sat Nov 21, 2020 12:18 pm

Seems like your tool does the same thing as the one I made except I use the STM32CubeMX file instead of specifying everything by hand

https://github.com/ChibiOS/ChibiOS-Cont ... x2board.py

ceremcem
Posts: 67
Joined: Mon Aug 10, 2015 6:57 am
Has thanked: 7 times
Been thanked: 6 times

Re: ADC configuration tool

Postby ceremcem » Sat Nov 21, 2020 12:34 pm

Wow, you have defined a bunch of other peripherals too. I can port your logic to Chibi Configurator and that will be a huge convenience. Thank you.


Return to “General Support”

Who is online

Users browsing this forum: Bing [Bot] and 21 guests