STM32 development on Linux


#1

I helped a friend over the weekend who is new to Linux with an embedded project. He had been using Mbed and Windows for development on his STM32 Nucleo board, but his client wanted a Linux solution for both development as well as serial communications.

He had issues getting the STM Eclipse environment working, so I figured I would put together a quick tutorial on how to use gcc and other command line tools to interface with the Nucleo.

It seems like there aren’t many of these on the Internet, so hopefully this helps out a bunch of folks.

Shoot me a message if you would like more info on a particular topic or if you see a typo that needs fixed.

Happy Hacking!


#2

I read the title and thought you were running linux on a STM32… This isn’t as intense but still helpful. I ran through the process before and was frustrated with the lack of documentation out there. I think this will help me if I work on that project some more. I was using QStlink2 but I’d rather use the packages you mentioned.


#3

I read it this way as well. Perhaps a better way to label this John? Perhaps, “STM32 development on Linux”


#4

Good call @ChrisGammell and @Dillon1337 - name changed!


#5

Recently got back into embedded dev this year and have been working on a CMake template for the ST parts, they have a very consistent directory structure from the various families and based this around the Drivers folder included in it.

You could call it from the compile.sh, but lets make handle the actual build. The template is setup for the MCU on the Nucleo L053R8 board but have used it to target one of their F3 parts etc. It’s setup to use the LL API not the HAL, but could be easily augmented for that.

Just sharing in case its useful. I haven’t found very many command line oriented solutions for arm development. I started out hand writing a make file when I was taking the context electronics course last year, but CMake seems to be much nicer alternative.


#6

FWIW, I did a similar thing to solve the same problem. Influenced by my Java software development background I went with a Gradle solution


#7

You could also check out this build tool built around Python.

SCons: A software construction tool