Skip to main content
Visitor II
May 29, 2017
Solved

Flashing boot-loader, production-data and application

  • May 29, 2017
  • 1 reply
  • 2396 views
Posted on May 29, 2017 at 14:01

hi,

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__];

Thanks

#linker-script #st-link-utility
    This topic has been closed for replies.
    Best answer by Jeroen3
    Posted on May 29, 2017 at 16:22

    With -w8 ?

    You do know have to erase flash to program 1's. You can only program 0's.

    1 reply

    Jeroen3Answer
    Visitor II
    May 29, 2017
    Posted on May 29, 2017 at 16:22

    With -w8 ?

    You do know have to erase flash to program 1's. You can only program 0's.

    Visitor II
    May 29, 2017
    Posted on May 29, 2017 at 16:31

    -w8/-w32 writes 1/4 bytes to flash.

    Easier for me to write the full serial-number with

    -P SerialNumber.bin

    , after all, the SN is generated by a production-tool.

    But - that's not the issue, I didn't write the flash driver, I only have the ST-LINK_CLI.exe interface...

    How should I use it correctly?

    Graduate II
    May 29, 2017
    Posted on May 29, 2017 at 19:19

    Can you have the serializer, or other app, combine the .hex and .bin into a singular .hex that's burned in one operation?

    Can't say I've battled my way through the ST-LINK command line.