Jump to content

Useful tools for getting going with STM32 boards and linux

Recommended Posts

I got one of those free STM32 F0 Discovery boards and I've been using the texane/stlink project to program and debug my discovery boards. Check it out here: https://github.com/texane/stlink


I saw that Mike S from hackaday.com added support to enable the F0 board but right now it only allows you to upload and debug code loaded to ram. He is working on getting flash programming to work with the new F0 board watch hack-a-day for updates. Until that is ready, you can use openocd to be able to program the flash.


Are there other debug tools that work with the stlink v2 that we should know about?



Edited by bluehash
Added Hackaday link.
Link to post
Share on other sites
  • 2 weeks later...

Thanks! That is the setup I ended up using. Openocd, CodeBench Lite Edition, the stm32f0 code template from github and Eclipse for editing and building. There are great instructions and links on how to get going here:




Once I got all those projects built and running, I created a new Makefile project in eclipse and imported the code and makefile from the template. I edit and build in eclipse. However, I haven't spent the time trying to get gdb working from within Eclipse. I use the makefile to flash the STM32-F0 board then start gdb by hand. This approach seems to be working well.


I have been trying out code using both CMSIS and low level SFR register setting. I thought that using CMSIS would allow me to use code I find on the net as examples even if they were for other STM32 Cortex-M chips. That according to the video about CMSIS is what you are supposed to be able to do. However, what I'm finding is that most of the code still has to be tweaked to work with the M0 chips. For example, the code that I posted that shows how to set the MCO as output was a snippet I found for an M3 STM32 chip. However, all the defines had to be verified and the structures that are used were actually different and had different variables. I had to guess what the M3 code was doing and had to modify the structure field values and do the same thing for the M0. I'm not convinced that using CMSIS is going to provide a transparent path to using different STM32 Cortex-M chips regardless of what the video says. Given the overhead of the CMSIS code, which is fairly significant, I'm not sure I'm going to bother using it. I'll look at it for inspiration though.



Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...