STM32U535 Memory Mapped OCTOSPI from NonSecure Context
I'm working on a project which is being ported over to be TrustZone aware, part of this project makes use of an OCTOSPI configured in memory mapped mode for file access. Base settings come from the IOC however the memory mapping is executed in source.
In the non-TrustZone project this works without issue, however in the TrustZone aware one it is triggering a SecureFault upon trying to access a memory region.
// Sample access that causes the SecureFault
uint32_t testAccess = *(uint32_t *)0x90008000;
The SAU reports an AUTHVIOL error for the address 0x9000_8000.
The SAU is configured to enable NonSecure access to the region 0x9000_0000 through 0x9FFF_FFFF.
The MPCWM settings have also been configured to mark the same region as NonSecure and Unprivileged
The OCTOSPI DMA channel is configured for NonSecure and Unprivileged
The MPU is disabled, however we have also tested with enabling the MPU in both contexts and mapping the same region to be Non-Secure, Unprivileged with no success.
I am able to read the JEDEC flash ID via HAL_OSPI_Receive in the NonSecure context so am confident that the physical link is working correctly, the problem seems to be uniquely tied to Memory Mapped mode.
Additionally if I use a NSC function to read the memory mapped address from the Secure context it works as expected, confirming there must be another region/setting that is still Secure despite the configuration.
Finally I have also attempted to set the OCTOSPI1_S address space to NonSecure in the SAU which resolved the SecureFault but saw all data Read-As-Zero.
Is there anyway to operate a memory mapped OCTOSPI from the NonSecure context, directly reading those memory addresses?
