cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 Cant Set PROT_AREA Option Bytes

TCash.1
Associate III

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

7 REPLIES 7
Chloe Meunier
ST Employee

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é

TCash.1
Associate III

Hi Chloe,

The results are the same after reconnects/resets/power cycling 

All security bits are disabled.

nWRPx = 1

I attached a log, where I connect, and then try a full chip erase.

Thanks,

Trevor

yhak.1
Associate II

Hi,

I have the same problem, does someone have a solution?

Y.H

Hi,

I am Facing Problem please suggest Some solution 

i attached Batch Script running for changing option bytes and stm32cubeprogrammer.

Prakash_Raj1994_0-1737628531831.pngPrakash_Raj1994_1-1737628585505.png

 

Regards,

Prakash

Prakash_Raj1994
Associate III

still No response

Regards,

Raja

edward2
Associate

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!

Jocelyn RICARD
ST Employee

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