cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling PCROP with RDP level 0 causes board to crash

EBonv
Associate III

Hello,

I have an unexpected behavior with a H753ZI board. After a very few steps, I ended up in a situation where PCROP seems to be enabled and RDP level is set to 0. For some reasons, this causes the board to freeze indefinitely, moreover after disconnecting it, it became unresponsive to any action using STM32CubeProgrammer or ST Link Utility.

The symptoms:

  • The board can not be connected to in a mode other than "hot plug" mode. Trying to connect in "normal" mode yields the error DEV_TARGET_NOT_HALTED. Trying to connect to the board using the "under reset" mode while holding the reset button down does not work either. This has been tried using STM32CubeProgrammer, ST Link Utility and STM32 Programmer CLI.
  • Once connected in "hot plug" mode, full chip erase is impossible. An error is given saying "Error: Mass erase operation failed.Please verify flash protection".
  • In "hot plug" mode, I am also unable to modify any of the option bytes. For example, if I try to set the RDP level from 0 to 1, I get the error "Error: Expected value for Option Byte "RDP": 0xBB, found: 0xAA".
  • RDP level is locked to 0 and DMEP1 and DMEP2 option bytes are disabled (and cannot be modified). The start and end addresses of the PCROP flash banks also became immutable.

How I ended up here:

  • I loaded a test code of my own on the board in debug mode. A code that I know works and never caused any issues.
  • I wanted to ensure PCROP protections to be disabled. Therefore I applied the following steps as I knew PCROP would be disabled if RDP level is switched from 1 to 0 with DMEP1 bit enabled and end address greater than start address for the PCROP flash bank 1 (same analogously for the second bank with DMEP2).
  • I switched RDP level from 0 to 1 and applied the changes.
  • I enabled DMEP1 and DMEP2 and applied the changes.
  • I switched RDP level back from 1 to 0 and applied the changes.
  • I disconnected the board.

Since then, the behavior I described before happened and I could not find any way to recover the board in a programmable state. Did I unknowingly follow a sequence of manipulations that set the board in a dead state ? I am still a novice with STM32 products so I may very much have.

Any suggestions are welcome, I am completely out of ideas and desperate. I don't even know how I ended up in such a situation that easily.

1 ACCEPTED SOLUTION

Accepted Solutions

Strap BOOT0 High and power cycle a few times, need to ensure none of your code is running. Then attempt recovery. If SWD/JTAG connectivity is blocked try USART.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

5 REPLIES 5

Strap BOOT0 High and power cycle a few times, need to ensure none of your code is running. Then attempt recovery. If SWD/JTAG connectivity is blocked try USART.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks a lot for your answer. Just to clarify, when you say "strap BOOT0 high", you mean connecting the pins 5 and 7 using a jumper on the CN11 side of the H753ZI board ?

yes.

0693W00000BaXPyQAN.png

EBonv
Associate III

Thank you! Strapping BOOT0 high did allow me to connect to the board in "normal" mode. I was then able to perform a full chip erase.

However, the board does not seem recovered yet. I can not introduce new code on it using STM32CubeIDE in debug mode. Moreover, as soon as I set BOOT0 back to 0, all the symptoms I described before come back.

Do you have any idea how I can completely recover the board?

EDIT: it may also help to know that with BOOT0 high, the LED3 of the board is on.

EBonv
Associate III

Thank you very much @Community member​ and @Pavel A.​ for the advice. After a bit more struggle with the option bytes, I finally recovered the board.

For the record, here are the steps I followed to finally disable the PCROP:

  • Strap BOOT0 high and connect to the board in normal mode.
  • Ensure RDP level is 1.
  • All at the same time, set RDP level to 0, uncheck DMEP1 and DMEP2, set PROT_AREA_START1, PROT_AREA_END1, PROT_AREA_START2 and PROT_AREA_END2 to 0x8000100, 0x80000FF, 0x8100100, 0x81000FF respectively (any value such that the end addresses are smaller than the start addresses should work).
  • Apply all the changes.
  • Perform a full chip erase.
  • Unplug the board, unstrap BOOT0.

After all these steps, the board was ready to be used again.