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: 483
Joined: Sat Nov 19, 2011 6:47 pm
Location: Le Mans, France
Has thanked: 21 times
Been thanked: 30 times

STM32 CubeMX to ChibiOS board file generator

Postby mobyfab » Mon Apr 21, 2014 11:40 pm

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: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: STM32 CubeMX to ChibiOS board file generator

Postby Tectu » Tue Apr 22, 2014 12:12 am

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: 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

Postby Giovanni » Tue Apr 22, 2014 9:40 am

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

Giovanni

mobyfab
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

Postby mobyfab » Tue Apr 22, 2014 1:59 pm

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: 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

Postby Giovanni » Tue Apr 22, 2014 3:58 pm

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

Postby jbrandmeyer » Tue Oct 14, 2014 4:54 pm



Is this project dead, or merely moved? This link is dead, but I'm interested to see just how this project worked.

mobyfab
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

Postby mobyfab » Sat Oct 18, 2014 7:40 pm

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

Here's the updated link.

I have not worked on it for some time...

mobyfab
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

Postby mobyfab » Tue Jan 19, 2016 6:37 pm

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
Location: California
Has thanked: 7 times
Been thanked: 1 time

Re: STM32 CubeMX to ChibiOS board file generator

Postby Chudik » Tue Nov 01, 2016 4:11 am

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
Location: California
Has thanked: 7 times
Been thanked: 1 time

Re: STM32 CubeMX to ChibiOS board file generator

Postby Chudik » Tue Nov 01, 2016 4:51 am

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


Return to “User Projects”

Who is online

Users browsing this forum: No registered users and 6 guests