AnsweredAssumed Answered

Flashing boot-loader, production-data and application

Question asked by Rami Rosenbaum on May 29, 2017
Latest reply on Jun 1, 2017 by Rami Rosenbaum


I'm working on a project, on a stm32F101.

The product is a proprietary boot-loader and application (which can be updated later on, via the BL).

I'll need to hold some production-data, serial-number, etc, less than 256 bytes.

I'm short in storage, don't want to waste a whole sector.

I want to hold it in a known location, for the application to read, say address 0x08000100, enough for the boot-loader vector-table.

I'm trying to flash the 3 via ST-Link Utility command-line interface, but they erase one another.

How can I Skip Flash Erase?


I'm flashing the boot-loader:

ST-LINK_CLI.exe -c SWD -P BootLoader.hex -V

I'm flashing the serial-number:

ST-LINK_CLI.exe -c SWD -P SerialNumber.bin 0x08000100 -V

I'm flashing the application:

ST-LINK_CLI.exe -c SWD -P Application.bin 0x08008000 -V


My additions to boot-loader linker script:

define symbol __ICFEDIT_intvec_start__                = 0x08000000;
define symbol __ICFEDIT_region_ROM_PRODUCTION_start__ = 0x08000100;
define symbol __ICFEDIT_region_ROM_PRODUCTION_end__   = 0x080001FF;
define symbol __ICFEDIT_AppHeader_start__             = 0x08000200;

define symbol __ICFEDIT_region_ROM1_start__           = 0x08000000;
define symbol __ICFEDIT_region_ROM1_end__             = 0x080000FF;
define symbol __ICFEDIT_region_ROM2_start__           = 0x08000200;
define symbol __ICFEDIT_region_ROM2_end__             = 0x0801FFFF;

define region ROM_region     = mem:[from __ICFEDIT_region_ROM1_start__ to __ICFEDIT_region_ROM1_end__] | mem:[from __ICFEDIT_region_ROM2_start__ to __ICFEDIT_region_ROM2_end__];
define region ROM_production = mem:[from __ICFEDIT_region_ROM_PRODUCTION_start__ to __ICFEDIT_region_ROM_PRODUCTION_end__];