AnsweredAssumed Answered

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

Question asked by sidekick on May 4, 2016
Latest reply on May 4, 2016 by Clive One
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