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 ?

14 REPLIES 14

It is hard to figure out from descriptions but see here,  SPRMOD is enabled and I cannot erase the chip. See the the test below it fails to erase.

 

Untitled.png

here is the tricky part you have to change RDP to BB, becasue it does not allow just uncheck SPRMOD now, click apply

Untitled1.png

 

then you check RDP back to AA and uncheck SPRMOD and click apply

Untitled2.png

now you have SPRMOD unchecked and you can erase now

Untitled3.png

 

probably that was the problem, a little tricky to disable but it can be done.

 

 

Thanks MNapi

But my device (STM32L433) does not have SPRMOD....

 

freeflyer_0-1758650484633.png

 

I have scrolled down and searched around, but cannot find any reference to SPRMOD

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".

Thanks AScha.3,

I changed the RDP from 0xAA to 0xBB and unchecked PCROP_RDP, then applied the settings.

It failed to update PCROP_RDP, but when I changed RDP back to 0xAA it has now fixed the problem and the board is back working again

Right, so I was right and chatgpt wrong.

Great!

As I wrote it....to do the regression, first have to set RDP 1, then go back...

Only this clearing the full flash.

 

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