cancel
Showing results for 
Search instead for 
Did you mean: 

Write OTP lock bytes using ST-LINK/V2

YWilk.1
Associate II

Hi,

i try to write the OTP area lock bytes using the ST-LINK/V2 programmer with the ST STM_Programmer_CLI tool included in the STM32CubeProgrammer software package.

I can successfully write to the OTP area blocks using the -w32 command but if i try to also write the according Lock byte it will fail with the following error message:

Command: STM32_Programmer_CLI.exe -c port=SWD -w32 0x1FFF7AC 0xFFFFFF00

Error: Failed to download data!If it's a Flash memory, it may be not erased or protected

Any idea why the write fails for the Lock bytes while OTP blocks are successfully written ?

17 REPLIES 17
Houda GHABRI
ST Employee

Hi @PZuid.1​ ,

this issue is fixed in last CubeProgrammer version 2.9.0, can you please try?

To be sure that the correct address is used , according to RM0401 Table12.OTP area organization, the lock byte address(for NucleoF410RB) is 0x1FFF 7A00 so the Command line should be :

STM32_Programmer_CLI.exe -c port=SWD -w32 0x1FFF7A00 0xFFFFFF00

Hope this helps you.

Houda

Internal ticket number: 108076 (PS: This is an internal tracking number and is not accessible or usable by customers).  

I tested it, but it still doesn't work.

0693W00000KbQNPQA3.pngSTM32F407IG and ST-LINK V2. Verified by reading the lock bytes afterwards - nothing changed.

Kind regards,

Peter

Houda GHABRI
ST Employee

Hello @PZuid.1​ ,

Ok, I'll check again and come back with updates.

Houda

Houda GHABRI
ST Employee

Hello @PZuid.1​ ,

You are right ! the issue is fixed in 2.9.0 only for F4 0x458 device ID.

Issue still exist for 0x413 and will be fixed in future release.

Meanwhile I will send you the patch via private message.

Hope this helps you.

Houda

I can confirm the lock bytes can now be written in the OTP area of the STM32F407IG (0x413).

Bugfix/change in STM32_Prog_DB_0x413.xml:

<Parameters address="0x1FFF7800" name=" 512 Bytes Data OTP" size="0x210"/>

Regards,

Peter

This issue is still not fixed in STM32 CubeProgrammer v2.10.0 (tested the 64-bit version).

Quick fix is to change "Data_Base\STM32_Prog_DB_0x413.xml" manually. But for deployment within our company this is sub-optimal...

Houda GHABRI
ST Employee

Hi @PZuid.1​ ,

Yes the fix was not scheduled for CubeProgrammer v2.10.0 because the reporting date for this issue (device ID 0x413) is close to the final release date.

We expect to deliver the fix in next Cubeprogrammer release  if everything goes according to the plan.

Houda

I can confirm CubeProgrammer v2.11.0 has finally bug fixed this (writing to OTP lock area for device ID 0x413).

Regards,

Peter