Uploading .bin files to STM32 Nucleo in Linux.

30 Oct 2014

Hi all, Found it a bit tricky getting info on how to upload .bin files to the STM32 Nucleo in Linux.

Anyway I found that this for Linux version of ST-Link https://github.com/texane/stlink works well.

(N.B I didnt find any need to upgrade the st-link firmware in the Nucleo addon board. It works ok as is, so you can do this exclusively within Linux)

To install texane/st-link,download the zip from github, follow the instructions to build it , then use sudo make install to install it in default location. ( for Ubuntu anyway)

If it doesnt work, you may also need to copy (with sudo) the .rules files in the top level dir of the distro to ( usuaully) /etc/udev/rules.d/, else it wont be able to access the usb link. (For STM32 nucleo only 49-stlinkv2-1.rules is needed). Then, once installed, to upload a file named "main.bin" do :

st-flash write main.bin 0x8000000

I am pretty sure the texane/stlink debug (using gdb) will work fine too though not tested that yet. Just chuffed to have this working. RTM in the distro on how to use gdb with texane/stlink

Much thanks to the texane/stlink authors for their great work!

Much thanks to mbed too. Looks like a great IDE a and libs. Looking forward to getting stuck in!

regards Andy

16 Dec 2014

I had to update nucleo firmware for that. If you manage to use gdb, please alse write how-to.

18 Feb 2017

Hi, Google brought me here. I have a Nucleo STM32F446 and someone made a program for my Nucleo but I cant get it on the board. Its a .bin file and I`m using Windows 10 64-bit. Is there a program that can upload this file to the Nucleo?

P.S. I`m a newbie.

19 Feb 2017

Hello Jeroen,
When you connect your Nucleo board via a USB cable to your Windows PC, you should see a new disk drive being created - something like this: (uploading to Imgur because image uploading not working right now)
http://imgur.com/a/h2th7
When you see the above, simply copy your .bin file to the drive (E: in the picture) and you will see the LED on the Nucleo Board flicker as the code is being flashed to the STM32 device.

If you don't see the USB drive, you most likely have driver problems.
In that case, see this https://developer.mbed.org/teams/ST/wiki/ST-Link-Driver
If that doesn't fix it, report back with exactly what you are seeing, especially under Device Manager/Disk Drives.
Regards,
Azq

22 Feb 2017

Oh that simple ;)

Thanks for helping!

I have an account at armmbed and after I followed the link on the drive it automaticaly added my Nucleo to my account. On the right side I see; Open mbed compiler". Can I use this to see my code?