2025-10-23 7:05 AM
Dear all,
I am using the cube programmer in order to set WRPA_PEND, WRPA_PSTRT and uncheck the unlock to actually lock the area defined by the WRPA field. It works fine and I can actually see that the memory region is protected.
I am unable to restore the situation and change back the unlock bit to 1 for this same region.
The cube programmer returns the following errors:
Error: Expected value for Option Byte "unlock_a": 0x1, found: 0x0
Error: Expected value for Option Byte "wrpa_pend": 0x0, found: 0x7F
Error: Option Byte Programming failed Or modified by application after OB_LAUNCH
The RDP level is set to 0xAA (not set at all nor changed).
Can anyone help me out with this issue?
Solved! Go to Solution.
2025-10-23 9:51 AM - edited 2025-10-23 9:52 AM
Hello @ivw, and welcome to ST Community!
Once the WRPA is locked by clearing the UNLOCK option bit, the area becomes write-protected and cannot be unlocked by simply setting the unlock bit back to 1. The unlock bit can only be set again when regressing from RDP Level 1 to Level 0 as stated in the reference manual section 3.7.2 Embedded flash memory write protection.
Best regards,
2025-10-23 9:51 AM - edited 2025-10-23 9:52 AM
Hello @ivw, and welcome to ST Community!
Once the WRPA is locked by clearing the UNLOCK option bit, the area becomes write-protected and cannot be unlocked by simply setting the unlock bit back to 1. The unlock bit can only be set again when regressing from RDP Level 1 to Level 0 as stated in the reference manual section 3.7.2 Embedded flash memory write protection.
Best regards,
2025-10-23 10:49 AM
thank you very much for your reply. My current RDP level is 0 I never changed the RDP level to 1 in the first place. Is there a guide that tell you how to do this setup step by step in a procedural way?
2025-10-23 11:11 AM
I did a regression from RDP 1 (value 0xDC) to level 0 (0xAA) and then I tried to check the unlock bit but it gives me the same error as I state before.
2025-10-23 11:36 AM
While I was trying I never activated RDP level 1 and despite that I cannot change the unlock bit back to 1. Now I tried to set RDP level to 1 with a password and I am able to regress back to level 0 (0xAA). Despite this procedure, I am still unable to set unlock bit back to 1 and change WRPA values.
2025-10-24 4:22 AM
Dear @STackPointer64,
I tried with a regression from RDP 1 to 0 but it doesn't work. I need to point out though that we are using the STM32WBA5MMG module in our project.