cancel
Showing results for 
Search instead for 
Did you mean: 

Executable format for flashing under Linux

WKowo
Associate II

Hi,

I use Linux as a development environment for STM32F429. I've created several Makefile files for my project and I'm able to compile it. Now I'd like to flash project's output binary file to STM32F429. I know that it is possible to mount STM32F429 as a usb storage under Linux. In other words flash in STM is visible under Linux as a disk drive.

My question is: what file format should I use for flashing? What file extension should it have?

Should it be elf, or ihex or maybe binary format? I tried all of them but not succeeded. The only way to flash binaries is by using Atollic TrueStudio. But my intention is to do it just by "make flash" from command line. Any suggestions?

3 REPLIES 3

I'm not a Linux user.

> I know that it is possible to mount STM32F429 as a usb storage under Linux. In other words flash in STM is visible under Linux as a disk drive.

I don't think you can with the chip alone unless you write a custom bootloader which accomplishes that. But then the question arises, how would you burn that bootloader into the chip?

You can also use something like STLinkV2-1 (or ST-LINK/V2-B on STM32F429I-DISC1, the newer version of the board) which would "mount" as a disk; however, AFAIK, this does not work well (or at all) on Linux. On windows, you need .bin to use this method.

You might want to have a look at http://openocd.org/doc/html/Flash-Programming.html#Flash-Programming .

JW

WKowo
Associate II

Sorry, I didn't tell that I'm using Nucleo F429ZI with embedded st-link, and AFAIK this st-link provides usb storage functionality (visible as disk under Linux).

In the future I'm planning to use J-Link for the first burn and write some kind of bootloader for further upgrading.

Just a while ago I tried again to copy .bin file to disk exported by st-link under Linux but seems it is not working.

Thank you for your response.

Ozone
Lead II

> ... I'm using Nucleo F429ZI with embedded st-link, and AFAIK this st-link provides usb storage functionality ...

I think not.

This "mass storage device" is a functionality of special bootloaders, like MBED or MIKROE have.

For direct flashing through the ST-Link, you need a file format that the application you use to flash supports.

Segger for example has a "JFlash Lite" standalone application for it's JLink debug pods, supporting several formats.

With ST-Link, you might try the supplied ST-Link Utility application.

Or you can download a JLink firmware from Segger's website, to convert the ST-Link into a JLink.

Or try an OpenOCD firmware for the ST-Link with a CLI. You could then use a shell script to get your "make flash". Never tried that, though.