I am trying to configure SAU to use 4 regions.
The SAU is being set up as follows:SAU->TYPE = 0x4 (4 regions)SAU->CTRL = 0x3 (all non-secure by default and SAU is enabled)SAU registers RNR, RBAR and RLAR are written to 4 times, in order to set up individual region numbers, start address and end address of the region. RLAR register also takes care of the correct secure/non-secure bit setting for each region. TZ_SAU_Setup function which initializes the SAU is called in System initialization function.
In main, the SAU registers are read out in order to verify the settings. The values read out are the most recent settings of the RNR, RBAR and RLAR registers of SAU. The settings of other regions cannot be read out.I have a couple of queries:1. How to verify that the SAU settings are applied properly? Is that any way to read out the settings? 2. When the SAU is disabled the simulation hard faults (Exception - 3). The ALLNS bit is set to 1 when the SAU is disabled in TZ_SAU_Setup function. Can you give us some pointers on how to run an application without SAU using only IDAU to configure the secure/non-secure settings?
The problem was with SAU setup. The number of regions being set up in partition file were 8 in number, whereas the hardware had allowed only 4 regions to be configured. Changing RTL fixed the problem.
View all questions in TrustZone for Armv8-M forum