2017-05-29 05:01 AM
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-utilitySolved! Go to Solution.
2017-05-29 07:22 AM
With -w8 ?
You do know have to erase flash to program 1's. You can only program 0's.
2017-05-29 07:22 AM
With -w8 ?
You do know have to erase flash to program 1's. You can only program 0's.
2017-05-29 09:31 AM
-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?
2017-05-29 12:19 PM
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.
2017-05-29 12:44 PM
Hi Clive,
It's quite easy extending the BootLoader.hex with the SerialNumber, knowing HEX file format, but it seems incorrect design.
BootLoader may be updated, grow bigger (while it's vector-table can't), SerialNumber can't change - that's the reason for putting the SN in this exact address.
I prefer a method of injecting each element without ST-Link Utility erasing other addresses.
P.S. - are the changes in the linker icf-file correct? Will
region ROM_production
be omitted from BootLoader.hex?Thanks
2017-05-29 02:20 PM
I'm not using IAR, but it looks reasonable. Check the .HEX, it should be reasonably apparent if there is a void in the memory described.
I understand that the boot loader might change, and the serial/calibration data won't, but you're production programming at the factory, so you have precise control over what gets into memory on day zero. In the field presumably the boot loader takes the role of updating the application, or itself. Different F1 parts have different erase page sizes, not looked up yours or using F1 parts currently.
2017-05-29 02:51 PM
HEX file is perfect, addresses 0x0100-0x01FF missing.
F101 has 128 sectors of 1KB - I can't 'waste' a whole 1KB on production data.
I can live with your option, but still hoping to find the Skip Flash Erase in the command-line utility...
2017-05-30 12:27 AM
maybe
-no_erasewill do the job.launch
STVP_CmdLime.exe -helpto see all available options.2017-06-01 01:42 AM
Thanks Max,
I'm not familiar to the STVP and didn't find any documentation about the STVP_CmdLime.exe.
Production is beyond the scope of my project, so I will not spent time learning the tool.
Jeroen3's solution (-w8) works well, a few lines of code in the calling script - no problems.
I'll open a separate post regarding theSkip Flash Erase missing option.