cancel
Showing results for 
Search instead for 
Did you mean: 

IAP: Command line tool to program Flash ROM of STM32 SOC

gmate1
Associate II
Posted on May 04, 2016 at 11:27

Hi All,

Sometime ago, I developed a bootloader for firmware update over the air (GSM/GPRS network) for STM32F0xx SOC; many thanks to ample information shared by the community members and ST's documentation. To make the DFU-OTA failsafe (e.g. power cycle during upgrade process, firmware image corruption due to lossy network, etc), I implemented, application CRC validation in the bootloader, which works fine, however, during the bootloader development and testing process, I would like to bypass CRC validation of the application (e.g. when the SOC has only bootloader programmed in the Flash Rom using ICP tools, such as ST-Link using SWD interface and sample application is also programmed using ICP). One way of achieving this by setting a flag in reserved area of Flash ROM (outside of areas allocated for bootloader and application) to let the bootloader know that it should not perform checksum validation for the application, before jumping to it. So, I started searching for a command line tool, available on windows platform, that lets me erase and program Flash ROM of STM32 target. Closest, I've found so far is STVP_CmdLine.exe but It doesn't seem to offer, what I'm looking for (something on the lines of nrfjprog.exe, that is distributed by Nordic semiconductor as part of one of it's product installations). 

For example, the following command writes value '0x1' at the address 0x03FC00 of nRF51822 SOC.(Another ARM cortex M0 based SOC)

 

$ /c/Program Files (x86)/Nordic Semiconductor/nrf5x/bin/nrfjprog.exe --memwr 0x03fc00 --val 0x1

 

#iap
1 REPLY 1
Posted on May 04, 2016 at 11:40

Well the Flash Loader Demonstrator hasa command line version with source.

Seems like a bit of a production though, its not unduly hard to sign an image the debugger will upload as part of the build process, or frankly to mark the image, say in the vector table to indicate if the image is signed or not, and have the boot loader use that to make the determination to do the CRC or not.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..