STM32 CubeMX to ChibiOS board file generator

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

STM32 CubeMX to ChibiOS board file generator

Post 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/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 ;)
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: STM32 CubeMX to ChibiOS board file generator

Post by Tectu »

Sound very interesting!
I've sent off a tweet, let's see how many people will find this useful ;-)


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

Re: STM32 CubeMX to ChibiOS board file generator

Post by Giovanni »

It would be interesting convert it in a .chcfg file, this way the code could be generated using the existing tool.

Giovanni
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: STM32 CubeMX to ChibiOS board file generator

Post 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)
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32 CubeMX to ChibiOS board file generator

Post 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
jbrandmeyer
Posts: 5
Joined: Thu Oct 09, 2014 3:34 pm

Re: STM32 CubeMX to ChibiOS board file generator

Post by jbrandmeyer »



Is this project dead, or merely moved? This link is dead, but I'm interested to see just how this project worked.
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: STM32 CubeMX to ChibiOS board file generator

Post by mobyfab »

https://gist.github.com/fpoussin/11158882

Here's the updated link.

I have not worked on it for some time...
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: STM32 CubeMX to ChibiOS board file generator

Post 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
User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Has thanked: 7 times
Been thanked: 1 time

Re: STM32 CubeMX to ChibiOS board file generator

Post by Chudik »

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
User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Has thanked: 7 times
Been thanked: 1 time

Re: STM32 CubeMX to ChibiOS board file generator

Post by Chudik »

Today https://www.python.org/downloads/ has two versions: 2.7 and 3.5
Which one better to use with this script?
Post Reply