cancel
Showing results for 
Search instead for 
Did you mean: 

Has ChatGPT bricked my NUCLEO-L433RC-P board :(

freeflyer
Senior II

I wanted to do a full chip erase using STM32Programmer (I am trying to debug a custom bootloader) but kept getting the error "Mass erase operation failed.  Please verify flash protection".

I sent the following option byte screenshot to ChatGPT....

freeflyer_3-1758476281788.png

ChatGPT said...

 

Problem: PCROP Protection

In your PCROP Protection section:

  • PCROP1_STRT = 0xFFFF

  • PCROP1_END = 0x0000

  • PCROP_RDP is enabled

This is an invalid PCROP range: start at 0xFFFF, end at 0x0.
That effectively protects a huge chunk of flash against erase/program.

So even though WRP and RDP are fine, PCROP is blocking your erase.


Fix

  1. In STM32CubeProgrammer → Option Bytes → PCROP:

    • Set PCROP1_STRT = 0xFF

    • Set PCROP1_END = 0xFF

    • Uncheck PCROP_RDP unless you specifically need PCROP linked to readout protection.

  2. Apply changes (Program Option Bytes → Reset).

  3. Retry Full Chip Erase with ST-Link.

 
 

I did the suggested fix but it obviously didnt work.

But worse still, I cant even change the option bytes back to as they were because I get the following error....

18:45:49 : UPLOADING OPTION BYTES DATA ...
18:45:49 :   Bank          : 0x00
18:45:49 :   Address       : 0x40022020
18:45:49 :   Size          : 20 Bytes
18:45:49 : OPTION BYTE PROGRAMMING VERIFICATION:
18:45:49 : Error: Expected value for Option Byte "PCROP1_END": 0x0, found: 0xFF
18:45:49 : Error: Expected value for Option Byte "PCROP1_STRT": 0xFFFF, found: 0xFF
18:45:49 : Error: Option Byte Programming failed Or modified by application after OB_LAUNCH

I cant program or debug in STMCubeIDE either so Im worried my board is bricked.

Is it recoverable and if so how ?

1 ACCEPTED SOLUTION

Accepted Solutions

Before you give up - maybe last action:  to reset the pcrop...whatever its now....

AScha3_0-1758655426514.png

 

So try set : Uncheck PCROP_RDP + set RDP to level1 (protected) , 01  (or whatever, but NOT 0xCC !);

then restart/ power cycle and set Uncheck PCROP_RDP + RDP to 0xAA , to do regression;

AScha3_1-1758655692752.png

then apply....

AScha3_2-1758655825697.png

 

restart/ power cycle....and we know.

 

+

btw

The AI should know , how its done and not tell silly stories, except ...AI =Artificial I.d.i.o.t.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

14 REPLIES 14
MNapi
Senior III

connect your boot PIN to VCC then power your board, now you should be able to erase the chip.

I connected BOOT0 pin to +3.3V and did a reset.

Then connected to STM32Programmer via STLINK and tried a full chip erase, but still got the same error "Mass erase operation failed. Please verify flash protection".

I also tried a power reset but the result is the same

I have no idea what you actually did.

You keep the PIN to VCC and keep connected when powering up and connect STM32programmr.

You do not do any reset power down or whatever you did and then connect STM32 programmer.

 

  • BOOT0 = 0 (Low): Normal operation, code execution from Flash memory.

  • BOOT0 = 1 (High): Enter bootloader mode for firmware update or debugging.

 

 

 

On the dev board, I connected BOOT0 to 3V3....

 

freeflyer_5-1758528752045.png

 

 

I then powered up the board and connected STMProgrammer to STLINK...

freeflyer_1-1758528181106.png

Once connected, I clicked on the 'Full chip erase' button...

freeflyer_3-1758528268874.png

But it still fails with the same error...

freeflyer_4-1758528321256.png

 

I know that BOOT0 pin is used to enter the internal bootloader, when developing my custom bootloader I call the internal bootloader via software rather than the BOOT0 pin. 

When I called the internal bootloader via software, the USB DFU device appeared on the computer.  The same happens when I pull BOOT0 pin high.

So it is running the internal bootloader, but still wont let me erase the chip.

Since changing PCROP1_STRT, PCROP1_END and PCROP_RDP settings I cant seem to do anything with this board.

I can't even change the PCROP1_STRT, PCROP1_END and PCROP_RDP back to the default values.

MNapi
Senior III

click on the icon OB you might have write protection active

Write protection is set to level 0 (0xAA) as shown in the OB in the screenshot in the original post

SPRMOD is enabled uncheck and click apply

Did you check the block protection...on ALL blocks ? (need scroll down, to see until the last one !)

AScha3_1-1758558645972.png

in option bytes,  here...

 

 

( I once hade a strange problem like this....and there was a protected block. Down at the end...)

If you feel a post has answered your question, please click "Accept as Solution".

Thanks all, I gave up and replaced the board.  It was a right hassle as I had made modificaitons to the dev board so had to make the same modifications to the replacement new board which took around 6 hours, but at least its working now.  I gave Chatgpt a mouthfall for bricking my board !