STM32H562 reading OBK in nonsecure application with TrustZone enabled
I am having trouble to get OBK data reading working on the STM32H562 / H563 (which do not support secure storage because they are lacking hardware crypto support).
My plan is to store keys in the OBK area, (encrypted with some storage key of my own) and use HDPL to make sure the application cannot access the bootloader keys.
I am not really using the TrustZone, but I need to enable it in order to get HDPL support.
So my secure application is very small, it configures nonsecure access for GPIO's, most of the flash (apart from the area where the secure application resides), and all IRQ's, then it jumps to my nonsecure bootloader.
When I have TrustZone disabled, I can write and read OBK data like expected.
As soon as I enable TrustZone, I can no longer read OBK data in my nonsecure bootloader or application, instead I'm reading all zeros.
The HDP level matches the area I'm trying to read.
But to be sure I'm trying to read all HDP areas, just in case I'm in an unexpected level.
I expect that OBK writing will not work from nonsecure context, because the FLASH_NSOBKCFGR register is only available when TZ_STATE = 0xC3.
But shouldn't OBK reading work?
Perhaps I am overlooking how to configure OBK to be used from nonsecure context?
I did not find any settings to do so.
