2018-10-04 04:22 PM
I wish to program the OTP0 area and lock it. So, I created the following .hex record file:
:020000041FF0EB
:08F0000070B3D584D0100000AC
:01F40000000B
:00000001FF
The first line sets the address offset to 0x1FF0 0000
The second line contains the 8 byte payload for OTP0 at base 0x1FF0 0000 + 0xF000
The third line contains the single byte 00 to be written at the LOCK0 location of 0x1FF0 F400
The last line is the EOF marker.
If I use the Erasing and Programming tab to program this file, it does program the OTP0 and LOCK0 bytes correctly.
However, the LOCK1, LOCK2, and LOCK3 bytes at 0x1FF0 F401-0x1FF0 F403 also get programmed with random contents, when they should remain at 0xFF.
Can STM32CubeProgrammer program a single byte here so that the other LOCK bytes are unaltered, or am I stuck with having to flash all 32 bits LOCK0-LOCK3 at the same time?
What is the recommended course of action if I only want to use the OTP0 area and lock it while leaving the rest of the OTP and LOCK area unaltered?
Thanks!