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/11158882
I just tested it tonight and it seems to work fine.
It's a very basic script, so you'll probably have to hack it
STM32 CubeMX to ChibiOS board file generator
Re: STM32 CubeMX to ChibiOS board file generator
Sound very interesting!
I've sent off a tweet, let's see how many people will find this useful
~ Tectu
I've sent off a tweet, let's see how many people will find this useful
~ Tectu
- 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: STM32 CubeMX to ChibiOS board file generator
It would be interesting convert it in a .chcfg file, this way the code could be generated using the existing tool.
Giovanni
Giovanni
-
- 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 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)
What are the tools to convert .chcfg to usable code? (something in chibistudio I assume)
- 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: STM32 CubeMX to ChibiOS board file generator
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
It is a plugin, so you can add it to any Eclipse environment, not just ChibiStudio.
Giovanni
-
- Posts: 5
- Joined: Thu Oct 09, 2014 3:34 pm
Re: STM32 CubeMX to ChibiOS board file generator
mobyfab wrote:https://gist.github.com/mobyfab/11158882
Is this project dead, or merely moved? This link is dead, but I'm interested to see just how this project worked.
-
- 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
https://gist.github.com/fpoussin/11158882
Here's the updated link.
I have not worked on it for some time...
Here's the updated link.
I have not worked on it for some time...
-
- 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
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
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
- Chudik
- Posts: 152
- Joined: Fri Jan 16, 2015 7:51 am
- Location: California
- Has thanked: 7 times
- Been thanked: 1 time
Re: STM32 CubeMX to ChibiOS board file generator
mobyfab
Would 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
Would 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
- Chudik
- Posts: 152
- Joined: Fri Jan 16, 2015 7:51 am
- Location: California
- Has thanked: 7 times
- Been thanked: 1 time
Re: STM32 CubeMX to ChibiOS board file generator
Today https://www.python.org/downloads/ has two versions: 2.7 and 3.5
Which one better to use with this script?
Which one better to use with this script?
Who is online
Users browsing this forum: No registered users and 5 guests