2024-06-20 01:30 AM - edited 2024-06-27 11:10 PM
I have an issue when changing the option bit of STM32H742 to change the RDP level to 1.
I read out option bit from register FLASH->OPTSR_CUR, change the RDP bits to eg 0xBB, write the result to FLASH->OPTSR_PRG and then set bit FLASH_OPTCR_OPTSTART in FLASH->OPTCR.
After that the system hangs, even a hard reset (NRST) does not work anymore. It needs a power cycle. After that the software runs normally and the option bits are programmed as set.
As the option bits are properly programmed I obviously can't debug after setting OPTSTART. I get errors "can't read memory" and "can't set breakpoint" and so on.
CPU runs with 1.8V at 480 MHz, can this have any impact?
(I am not using HAL)
Thanks for any help
2024-06-21 12:25 AM
Further investigations:
When my STM32H7 has RDP level 1 set and I try to read it out with STM Cube Programmer (simply click Connect, confirm the read out error message and click disconnect) a following hard reset on NRST has no effect.
So it seems this is intended behaviour?
Is it possible to set RDP level 1 on the fly during program execution? Or is a power cycle needed after setting RDP level?