cancel
Showing results for 
Search instead for 
Did you mean: 

PCROP Not disabled after RDP Regression, Option change not possible in RDP0

aco990
Associate III

Hello everyone,

I'm experimenting PCROP activation on stm32h743 following this ST-tutorial: https://youtu.be/7Wr90XFA8_Q?si=tDpqUtMdin9Oyn-P

The activation works fine but i cannot disable PCROP using CubeProgrammer.
I did a RDP1 to RDP0 regression with DMWP1 checked but the PCROP is still active

aco990_0-1717517806630.png


After RDP regression i can se that the unprotected flash are is erase:

aco990_1-1717517520089.png

But not the protected one:

aco990_2-1717517571238.png
I can also not change the option bytes anymore, even RDP0 to RDP1 does not work

aco990_3-1717517635012.png


How can i recover from this situation ?


@Jocelyn RICARD, @Fred 

10 REPLIES 10
aco990
Associate III

Hi @Jocelyn RICARD ,

now PCROP is removed and the device is working fine! 🙂
If you encounter the same problem a "bank mass erase with automatic protection-removal" as described in the reference manual could help you:

 

__HAL_FLASH_CLEAR_FLAG_BANK1(FLASH_FLAG_ALL_ERRORS_BANK1);
HAL_FLASH_OB_Unlock();

SET_BIT(FLASH->PRAR_PRG1, FLASH_PRAR_DMEP);
uint32_t temp = ~((0xFFF << 0) | (0xFFF << 16));
FLASH->PRAR_PRG1 &= temp;  // Clear bits 11:0 and 27:16
FLASH->PRAR_PRG1 |=  (2 << 0);
FLASH->WPSN_PRG1 = 0xFF;

HAL_FLASH_Unlock();
SET_BIT(FLASH->CR1, FLASH_CR_BER);
SET_BIT(FLASH->CR1, FLASH_CR_START);
while (READ_BIT(FLASH->SR1, FLASH_SR_QW) > 0) {} // Wait for erase completion