2022-07-27 11:40 AM
I followed ST wiki, success to display OTP by the command:
STM32_Programmer_CLI.exe --connect port=usb1 -otp displ
Then I try to test writing a value to wordid 79 which currently is 0x00000000, and free for user.
STM32_Programmer_CLI -c port=usb1 -otp program wordID=0x4F value=0x12345678
No thing wrong, command return sucess:
I display cmd again, it is till 0x00000000, even reset the board.
Any one know what I am missing, please?
Solved! Go to Solution.
2022-07-28 08:07 AM
Hi Dat Tran (Community Member)
Good to hear that you are sorted out..
Regarding the syntax I just followed the wiki. CubeProgrammer syntax sometimes change between version so it is important to align the wiki version to the DV version used. By default the wiki page points to the latest DV (which is here DV4.0.1)
https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer_OTP_management
2022-07-28 08:36 AM
Hi @OlivierK
Sorry for bother you one more time, because we have only one board for testing so I have to very careful to program OTP or the board dead and it will delay our project.
I read BSEC_OTP_STATUS, BSEC_OTP_DISTURBED, BSEC_OTP_ERROR but I am not sure how they become 0x30000000 as picture below.
Thank you for your help!
2022-07-28 09:42 AM
Hi Dat Tran (Community Member)
The upper OTPs have ECC, so as you can only write "1" to OTP words it is likely that the ECC value will not match if you write again to the same OTP word. so you will get an error.
For the OTP status, this page will answer your questions
https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer_OTP_management
For more on the subject, the product reference Manuel will help (BSEC section)
3.3.5 OTP words status
• BSEC_OTP_DISTURBEDx registers (x = 0...2) provide the disturbed status for each
OTP word. Any bit set to 1 means that the last reading of the corresponding word has
been disturbed. Abnormal reading conditions in circuitry decoding and voltages reading
have been detected.
• BSEC_OTP_ERRORx registers (x = 0...2) provide error status for each OTP word.
Any bit set to 1 means that the last read operation of the word concerned revealed a
redundancy or ECC check error.
• BSEC_OTP_WRLOCKEDx registers (x = 0...2) provide a permanent write lock
status for each OTP word. Any bit set to 1 means that the corresponding word is
permanently locked for writing.