cancel
Showing results for 
Search instead for 
Did you mean: 

ST-LINK_CLI.exe - Skip Flash Erase

Rami Rosenbaum (old)
Associate II
Posted on June 01, 2017 at 08:58

Hi,

I want to use the ST-Link Utility command-line tool for production:

  1. flash a BootLoader and the current application
  2. do production tests
  3. if all is OK - flash the production data (serial-number, timestamp, etc., ~50 bytes)

Due to flash size-limitations, production data is located in a specific location, after the BootLoader vector-table (address 0x08000100). BootLoader can grow larger, if needed to upgrade.

I want to flash a production-data file via ST-LINK_CLI.exe:

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

but without erasing the BootLoader.

The ST-Link Utility GUI has a check-box: Skip Flash Erase.

How can I do this via command-line?

#st-link_cli #st-link-utility
1 ACCEPTED SOLUTION

Accepted Solutions
Amel NASRI
ST Employee
Posted on June 08, 2017 at 14:40

Hi

Rosenbaum.Rami

‌,

The equivalent of 'Skip Flash Erase' option is '-ske' to be used with

ST-LINK_CLI.exe.

Please try it and let me know if it helps to get the expected result.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Amel NASRI
ST Employee
Posted on June 08, 2017 at 14:40

Hi

Rosenbaum.Rami

‌,

The equivalent of 'Skip Flash Erase' option is '-ske' to be used with

ST-LINK_CLI.exe.

Please try it and let me know if it helps to get the expected result.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Posted on June 11, 2017 at 12:27

Thanks,

'ske' (without the '-') works.

It's in the application 'help', but not described.

But, then I'm getting:

The elf loader Program function fails.

The elf loader Program function fails.

Memory-Loader error

Error occured during program operation!

Programming error @ 0x08000100!

The sector is already flashed with data (I remind you that the bootloader resides in sector 0, and the data I'm flashing, the production data, sits in the middle of this sector)

Posted on June 11, 2017 at 16:40

>>The sector is already flashed with data (I remind you that the bootloader resides in sector 0, and the data I'm flashing, the production data, sits in the middle of this sector)

Which means is DOES actually need to be erased if those locations were previously programmed. Really not sure the code in the Utilities is that smart or flexible. Even if the cells in question are programmed to 0xFF, the F1 as I recall does not allow for subsequent reprogramming of bits from 1 to 0, which is frequently possible on stand-alone FLASH parts. I suspect ST has some parity/hamming scheme on the array.

Provide data for the entire sector, ie RMW your data into the sector

I would try not to be dependent on ST for the success of your production programming stations. Ideally the boot loader should control the writing of the data, and the erase/program of sectors it resides in. Investigate third part programming toolkits, Segger offers some solutions as I recall.

This is an area where you'd really want to get with the FAE, or sales contact, responsible for your account.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 13, 2017 at 14:48

I managed to work around this, still via ST-Link Utility, using the '-w8' option, writing one byte at a time.

A new issue has arose, this is a secure device, boxed in a mesh and epoxy. There are over 10,000 devices with the same HW, but old FW around, which will need to be upgraded (by and 'old style' application which will flash the new bootloader).

In this scenario there will not be JTAG interface for serial-number, so we'll have to use the bootloader for flashing the SN.

Thanks.