-
Notifications
You must be signed in to change notification settings - Fork 3k
STM32 : script to generate PeripheralPins.c for new target addition #6929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
$ python genpinmap_mbed.py -h usage: genpinmap_mbed.py [-h] [-l | -b | -m xml | -t HW] Script will generate PeripheralPins.c thanks to the xml files description available in STM32CubeMX directory defined in 'cube_path.json': C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeMX\db optional arguments: -h, --help show this help message and exit -l, --list list available mcu xml files description in STM32CubeMX -b, --boards list available boards description in STM32CubeMX -m xml, --mcu xml specify the mcu xml file description in STM32CubeMX to use (use double quotes). Parameter can be a filter like L496 if you want to parse all L496 chips (-m STM32 to parse all). -t HW, --target HW specify the board file description in STM32CubeMX to use (use double quotes). Parameter can be a filter like L496 (only the first file found will be parsed). Once generated, you have to check and comment pins that can not be used (specific HW, internal ADC channels, remove PWM using us ticker timer, ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would probable be better placed in ./tools/targets
.
Other wise the generated output LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The style of this file is different from the tools.
Let's merge ? :-) |
@@ -0,0 +1,1214 @@ | |||
import argparse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a license to this new file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license missing, otherwise looks good
done |
/morph build |
Build : SUCCESSBuild number : 2293 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 1917 |
Test : SUCCESSBuild number : 2071 |
CI passed, reviewers please recheck. |
@@ -0,0 +1,1244 @@ | |||
""" | |||
******************************************************************************* | |||
* Copyright (c) 2018, STMicroelectronics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As these are mbed implementation files (also what it generates), why not Apache license?
/morph build |
Build : SUCCESSBuild number : 2376 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2009 |
Test : SUCCESSBuild number : 2165 |
Description
Goal is to help users to add a new STM32 MCU in MBED.
One tricky point is to build PeripheralPins.c and PinNames.h files.
If you have installed STM32CubeMX tool from:
http://www.st.com/en/development-tools/stm32cubemx.html
we have implemented a script to build the 2 MBED files from the ST description files.
Uncyclo page will be updated after PR merge:
https://os.mbed.com/teams/ST/wiki/steps-to-create-a-new-STM32-platform
$ python STM32_gen_PeripheralPins.py -h
usage: STM32_gen_PeripheralPins.py [-h] [-l | -b | -m xml | -t HW]
Script will generate PeripheralPins.c thanks to the xml files description available in
STM32CubeMX directory defined in 'cube_path.json':
C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeMX\db
optional arguments:
-h, --help show this help message and exit
-l, --list list available mcu xml files description in STM32CubeMX
-b, --boards list available boards description in STM32CubeMX
-m xml, --mcu xml specify the mcu xml file description in STM32CubeMX to use (use double quotes).
Parameter can be a filter like L496 if you want to parse all L496 chips (-m STM32 to parse all).
-t HW, --target HW specify the board file description in STM32CubeMX to use (use double quotes).
Parameter can be a filter like L496 (only the first file found will be parsed).
Once generated, you have to check and comment pins that can not be used (specific HW, internal ADC channels, remove PWM using us ticker timer, ...)
Pull request type