Asked my friend to run through Python on his computer,
Here what I noted:
- All pins shown as 'otype':None
Is it correct? I have outputs and inputs in my configuration.
Got "Missing Peripheral" messages
Missing Peripheral: ADC_IN1 at PA1
Missing Peripheral: GPXTI2 at PD2
while pins set
PA1 - {'otype': None, 'label': None, 'speed': None, 'signal': 'ADC_IN1', 'pupd': None}
PD2 - {'otype': None, 'label': 'INT [EXTI2]', 'speed': None, 'signal': 'GPXTI2', 'pupd': None}
respectively.
STM32 CubeMX to ChibiOS board file generator
-
- Posts: 483
- Joined: Sat Nov 19, 2011 6:47 pm
- Location: Le Mans, France
- Has thanked: 21 times
- Been thanked: 30 times
Re: STM32 CubeMX to ChibiOS board file generator
Hi,
The current version of the script is here: https://gist.github.com/fpoussin/3317dc197ef0857294f0
I had to make some fixes because the CubeMX software changed its format.
Missing peripherals means that: it cannot find the peripheral definition, hence it does not know the correct pin mode/mux for it.
You'll have to look in the MCU datasheet for that.
otype should never be none.
The current version of the script is here: https://gist.github.com/fpoussin/3317dc197ef0857294f0
I had to make some fixes because the CubeMX software changed its format.
Missing peripherals means that: it cannot find the peripheral definition, hence it does not know the correct pin mode/mux for it.
You'll have to look in the MCU datasheet for that.
otype should never be none.
Re: STM32 CubeMX to ChibiOS board file generator
I got error, what does it mean ?
Code: Select all
Missing Peripheral: S_TIM2_CH2 at PA1
Missing Peripheral: S_TIM2_CH2 at PA1
Missing Peripheral: S_TIM2_CH2 at PA1
Missing Peripheral: S_TIM2_CH2 at PA1
Missing Peripheral: S_TIM2_CH2 at PA1
Missing Peripheral: S_TIM2_CH2 at PA1
-
- Posts: 483
- Joined: Sat Nov 19, 2011 6:47 pm
- Location: Le Mans, France
- Has thanked: 21 times
- Been thanked: 30 times
Re: STM32 CubeMX to ChibiOS board file generator
omcdr wrote:I got error, what does it mean ?Code: Select all
Missing Peripheral: S_TIM2_CH2 at PA1
Missing Peripheral: S_TIM2_CH2 at PA1
Missing Peripheral: S_TIM2_CH2 at PA1
Missing Peripheral: S_TIM2_CH2 at PA1
Missing Peripheral: S_TIM2_CH2 at PA1
Missing Peripheral: S_TIM2_CH2 at PA1
It means it cannot find the peripheral in PIN_FUNC_MAPPING_DEFAULT nor PIN_FUNC_MAPPING
You have to add it with the correct properties such as AF number which you'll find in the datasheet.
I am working on a version that does that automatically by reading the GPIO XML files from CubeMX.
-
- Posts: 483
- Joined: Sat Nov 19, 2011 6:47 pm
- Location: Le Mans, France
- Has thanked: 21 times
- Been thanked: 30 times
Re: STM32 CubeMX to ChibiOS board file generator
It's done!
https://gist.github.com/fpoussin/3317dc197ef0857294f0
You will need the GPIO definition file from STM32CubeMX and the jinja2 python module. (use pip to install it)
I'll try to make an executable for windows users using py2exe.
GPIO XML files are located in the STM32CubeMX folder under /db/mcu/IP/
https://gist.github.com/fpoussin/3317dc197ef0857294f0
You will need the GPIO definition file from STM32CubeMX and the jinja2 python module. (use pip to install it)
I'll try to make an executable for windows users using py2exe.
Code: Select all
usage: mx2board.py [-h] [-g GPIO] [-b PROJECT] [-o OUTPUT]
Generate GPIO header file from STM32CubeMX file.
optional arguments:
-h, --help show this help message and exit
-g GPIO, --gpio GPIO
-b PROJECT, --project PROJECT
-o OUTPUT, --output OUTPUT
GPIO XML files are located in the STM32CubeMX folder under /db/mcu/IP/
-
- Posts: 483
- Joined: Sat Nov 19, 2011 6:47 pm
- Location: Le Mans, France
- Has thanked: 21 times
- Been thanked: 30 times
Re: STM32 CubeMX to ChibiOS board file generator
Generated an .exe for windows users that don't want to install python:
https://www.dropbox.com/s/6jlsojdmclz61 ... d.exe?dl=0
https://www.dropbox.com/s/6jlsojdmclz61 ... d.exe?dl=0
-
- Posts: 483
- Joined: Sat Nov 19, 2011 6:47 pm
- Location: Le Mans, France
- Has thanked: 21 times
- Been thanked: 30 times
Re: STM32 CubeMX to ChibiOS board file generator
See post above
You will get a .h file with all the gpio configuration and some defines to help use the I/Os.
Just include this file in your board.h after deleting the gpio config.
I use it here: https://github.com/fpoussin/MotoLink/tr ... ode/common
I added the script here: https://github.com/ChibiOS/ChibiOS-Cont ... ster/tools
You will get a .h file with all the gpio configuration and some defines to help use the I/Os.
Just include this file in your board.h after deleting the gpio config.
I use it here: https://github.com/fpoussin/MotoLink/tr ... ode/common
I added the script here: https://github.com/ChibiOS/ChibiOS-Cont ... ster/tools
Re: STM32 CubeMX to ChibiOS board file generator
Sorry to disturb you, but I cant use your exe correct. Please, help me
I have made the *.bat file in the my CUBE project folder
mx2board -g GPIO
pause
But I have an error messages with the all options. What options and how should I use?
UPD
AAAAA!!! I have no permissions to the GPIO folder!
My problem has not solved I have no any idea
I have made the *.bat file in the my CUBE project folder
mx2board -g GPIO
pause
But I have an error messages with the all options. What options and how should I use?
UPD
AAAAA!!! I have no permissions to the GPIO folder!
My problem has not solved I have no any idea
Last edited by access777 on Thu May 11, 2017 3:07 pm, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 16 guests