ADC configuration tool

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

Moderators: RoccoMarco, lbednarz, tfAteba

User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: ADC configuration tool

Post by Giovanni »

Could you specify exactly what you need?

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

Re: ADC configuration tool

Post by ceremcem »

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: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: ADC configuration tool

Post by Giovanni »

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: 66
Joined: Mon Aug 10, 2015 6:57 am
Has thanked: 7 times
Been thanked: 6 times

Re: ADC configuration tool

Post by ceremcem »

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: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: ADC configuration tool

Post by mobyfab »

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: 66
Joined: Mon Aug 10, 2015 6:57 am
Has thanked: 7 times
Been thanked: 6 times

Re: ADC configuration tool

Post by ceremcem »

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.
Post Reply