STM32H523 can't enable BKPSRAM clock in RCC from non-secure application.
After enabling trustzone in my project, I am unable to set the BKPRAMEN bit from non-secure context in the RCC_AHB1ENR register.
My setup is a secure bootloader jumping to a non-secure application, this is working fine.
I make the backup RAM non-secure using the GTZC memory 4 subregion watermark configuration before jumping to non-secure application. When i enable the BKPRAMEN clock from secure world, and disable it again before jumping to non-secure, i am unable to re-enable the clock enable bit from non-secure preventing access to the backup RAM region.
When i leave the clock enabled from secure before jumping, the non-secure application can read the backup RAM just fine. Now this setup would also work, but i would like to understand why this is happening.
I found in RM0481 at 11.5.1:
When a peripheral is configured as secure, its related clock, reset, clock source selection
and clock enable during low-power modes control bits, are also secure in the
RCC_AHBxENR, RCC_APBxENR, RCC_CCIPRx and RCC_BDCR registers.
However, backupram is not a seperate peripheral you can set as secure in the GTZC. None of the peripherals are setup for secure acces only (all non-secure) and I use the watermark to mark the backup area non-secure.
Could anyone point me in the right direction as to why this is happening?
