2022-01-15 7:40 AM
Hello All,
I have a certain STM32H7 that I can't erase sector 0 using STM32CubeProgrammer.
I think it is because PROT_AREA_START1 and PROT_AREA_END1 are not correct. I am trying to get back to default values of
PROT_AREA_START1 =0xFF (0x0800ff00)
PROT_AREA_END1 = 0x00 (0x080000ff) to disable the protection.
However I cant Actually change the option bytes through the programmer. I get:
an error: "Expected Value for option byteP: "PROT_AREA_START!: 0xFF, fount 0x00"
RDP is level 0 (AA)
I am using ST-link. Thanks for any help,
Trevor
2022-01-17 5:37 AM
Hello Trevor,
could you please share your STLink configuration?
Did you try to disconnect/connect your board?
The Security bit is disabled?
nWRPx = 1?
BR
Chloé
2022-01-17 9:30 AM
2024-03-10 11:49 PM
Hi,
I have the same problem, does someone have a solution?
Y.H
2025-01-23 2:34 AM - edited 2025-01-23 2:37 AM
Hi,
I am Facing Problem please suggest Some solution
i attached Batch Script running for changing option bytes and stm32cubeprogrammer.
Regards,
Prakash
2025-02-27 11:39 PM - edited 2025-02-27 11:39 PM
still No response
Regards,
Raja
2026-04-23 8:28 AM
I had a similar problem. The only way I could recover the device was to program RDP back to BB using the command line tool (it wouldn't work in the GUI programmer):
STM32_Programmer_CLI.exe -c port=SWD mode=HOTPLUG -ob RDP=0xBB nWRP0=1 nWRP1=1 nWRP2=1 nWRP3=1 nWRP4=1 nWRP5=1 nWRP6=1 nWRP7=1 BOOT_CM7_ADD0=0x0800 BOOT_CM7_ADD1=0x1FF0 SECURITY=0 -e all -ob displ
... then I went back to the GUI programmer and set RDP back to AA, making sure that before I hit 'apply', I also checked the DMEP1 and DMEP2 in PCROP protection. (This was my problem, with RDP = AA, I was not able to reset the PCPROP end/start fields in the GUI. I needed to get RDP back to BB so that setting it back to AA would reset the PCPROP start/end fields.)
This was a bitch - I spent all morning trying to reset my Nucleo 753 board. Hope this helps someone!
2026-04-28 10:58 AM
Hello,
Just seen this post.
One comment: when something is not working, my first reflex is to look into the reference manual.
For this topic, you can find the information in RM0433 Rev 8 Chapter 4.4.3 Option byte modification
"PCROP area size (PROT_AREA_START1/2 and PROT_AREA_END1/2)
These option bytes configure the size of the PCROP areas in FLASH_PRAR_CUR1/2
registers. They can be increased without any restriction by the Arm® Cortex®-M7 core.
To remove or reduce a PCROP area, an RDP level 1 to 0 regression (see
Section 4.5.3) or a bank erase with protection removal (see Section 4.3.10) must be
requested at the same time. DMEP must be set to 1 in either FLASH_PRAR_CUR1/2
or FLASH_PRAR_PRG1/2, otherwise an option byte change error is raised."
Sometimes (not always) it saves time :)
Best regards
Jocelyn