Skip to main content
Visitor II
June 1, 2017
Solved

ST-LINK_CLI.exe - Skip Flash Erase

  • June 1, 2017
  • 1 reply
  • 2605 views
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
    This topic has been closed for replies.
    Best answer by Amel NASRI
    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

    1 reply

    Technical Moderator
    June 8, 2017
    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

    Visitor II
    June 11, 2017
    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)

    Graduate II
    June 11, 2017
    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.