Blinky on the STM32L011 Nucleo

The STM32L011 Nucleo board is an mbed enabled development kit featuring the STM32Lo11K4 MCU. This is a Cortex M0+ device with some interesting features such as hardware accelerated AES encryption (Correction: AES not present on the STM32L011) and a “Firewall” which seems to prevent firmware and other data being offloaded from the device. The board is meant to be programmed with a large IDE or using the mbed online development environment. I was curious to see could it be done from the command line with all code contained in a single directory. Normally I would tackle this with OpenOCD and GDB but this is such a new board that OpenOCD/GDB can’t interface with it properly (yet). All is not lost however! The mbed feature of this board means that it appears as a removable storage device to the operating system. Programming the board is simply a matter of dropping a correctly formatted executable (binary) file into this removable storage device. The utility objcopy can be used to prepare the executable file.
Assuming you have compiled your code to an “elf” file called main.elf, you can generate a binary file as follows:
objcopy -O binary main.elf main.bin
The “bin” file can be dropped on the Nucleo and should run fine.
Code for blinky is available here

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s