Skip to main content
EBonv
Associate III
June 8, 2021
Solved

Enabling PCROP with RDP level 0 causes board to crash

  • June 8, 2021
  • 2 replies
  • 1946 views

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.

This topic has been closed for replies.
Best answer by Tesla DeLorean

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.

2 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
June 8, 2021

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 VenmoUp vote any posts that you find helpful, it shows what's working..
EBonv
EBonvAuthor
Associate III
June 8, 2021

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 ?

Pavel A.
Super User
June 9, 2021

yes.

0693W00000BaXPyQAN.png

EBonv
EBonvAuthor
Associate III
June 11, 2021

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.