Page 1 of 3
STM32 CubeMX to ChibiOS board file generator
Posted: Mon Apr 21, 2014 11:40 pm
by mobyfab
Hi,
I've made a small python script that generates the pin macros in the board.h file.
You need the STM32 CubeMX (previously microxplorer) application to create an ioc file, which will be converted to macros.
https://gist.github.com/mobyfab/11158882I just tested it tonight and it seems to work fine.
It's a very basic script, so you'll probably have to hack it

Re: STM32 CubeMX to ChibiOS board file generator
Posted: Tue Apr 22, 2014 12:12 am
by Tectu
Sound very interesting!
I've sent off a tweet, let's see how many people will find this useful

~ Tectu
Re: STM32 CubeMX to ChibiOS board file generator
Posted: Tue Apr 22, 2014 9:40 am
by Giovanni
It would be interesting convert it in a .chcfg file, this way the code could be generated using the existing tool.
Giovanni
Re: STM32 CubeMX to ChibiOS board file generator
Posted: Tue Apr 22, 2014 1:59 pm
by mobyfab
It's possible to change the script to output a .chcfg file as well.
What are the tools to convert .chcfg to usable code? (something in chibistudio I assume)
Re: STM32 CubeMX to ChibiOS board file generator
Posted: Tue Apr 22, 2014 3:58 pm
by Giovanni
Correct, select the .chcfg file in the project explorer and a button appears in the toolbar that regenerates formatted board.c/.h/.mk files.
It is a plugin, so you can add it to any Eclipse environment, not just ChibiStudio.
Giovanni
Re: STM32 CubeMX to ChibiOS board file generator
Posted: Tue Oct 14, 2014 4:54 pm
by jbrandmeyer
Is this project dead, or merely moved? This link is dead, but I'm interested to see just how this project worked.
Re: STM32 CubeMX to ChibiOS board file generator
Posted: Sat Oct 18, 2014 7:40 pm
by mobyfab
https://gist.github.com/fpoussin/11158882Here's the updated link.
I have not worked on it for some time...
Re: STM32 CubeMX to ChibiOS board file generator
Posted: Tue Jan 19, 2016 6:37 pm
by mobyfab
Hey,
I updated the script.
I now takes into account things such as:
- Different config for each port (fall back to a default if not found, some alternate functions are different depending on the port)
- GPIO speed, pullup/down and output mode (pushpull, opendrain)
- Create defines for each pin that you label
You can configure all the GPIOs in STM32Cube and it will generate the configs.
Source:
https://gist.github.com/fpoussin/3317dc197ef0857294f0
Re: STM32 CubeMX to ChibiOS board file generator
Posted: Tue Nov 01, 2016 4:11 am
by Chudik
mobyfabWould it be possible to make exe file?
I used python a couple of times, not my favorite tool

Will try it again, though if making .exe is difficult
Re: STM32 CubeMX to ChibiOS board file generator
Posted: Tue Nov 01, 2016 4:51 am
by Chudik
Today
https://www.python.org/downloads/ has two versions: 2.7 and 3.5
Which one better to use with this script?