Skip to content

Commit 89c76c4

Browse files
committed
[nrf fromtree] platform: nordic_nrf: Fix SAU region limit off by one
The SAU region limit is inclusive and 32-byte aligned, so using the UICR base as the limit makes the region cover the first 32 bytes of the UICR, which is where UICR.APPROTECT lives. Use the last address before the UICR instead. Change-Id: Ife5ba7c2e75c9571072ab176f63e4d8cbaa46d72 Signed-off-by: Dag Erik Gjørvad <dag.erik.gjorvad@nordicsemi.no> (cherry picked from commit e6a1352bc557b3f65c73dae48ab18716702782e8)
1 parent c7fa24e commit 89c76c4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

platform/ext/target/nordic_nrf/common/core/target_cfg_54l.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void sau_and_idau_cfg(void)
186186
non-secure NVM and before the UICR.*/
187187
SAU->RNR = 0;
188188
SAU->RBAR = (memory_regions.non_secure_partition_base & SAU_RBAR_BADDR_Msk);
189-
SAU->RLAR = (NRF_UICR_S_BASE & SAU_RLAR_LADDR_Msk) | SAU_RLAR_ENABLE_Msk;
189+
SAU->RLAR = ((NRF_UICR_S_BASE - 1) & SAU_RLAR_LADDR_Msk) | SAU_RLAR_ENABLE_Msk;
190190

191191
/* Leave SAU region 1 disabled until we find a use for it */
192192

platform/ext/target/nordic_nrf/common/core/target_cfg_71.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void sau_and_idau_cfg(void)
157157
non-secure NVM and before the UICR.*/
158158
SAU->RNR = 0;
159159
SAU->RBAR = (memory_regions.non_secure_partition_base & SAU_RBAR_BADDR_Msk);
160-
SAU->RLAR = (NRF_UICR_S_BASE & SAU_RLAR_LADDR_Msk) | SAU_RLAR_ENABLE_Msk;
160+
SAU->RLAR = ((NRF_UICR_S_BASE - 1) & SAU_RLAR_LADDR_Msk) | SAU_RLAR_ENABLE_Msk;
161161

162162
/* Leave SAU region 1 disabled until we find a use for it */
163163

0 commit comments

Comments
 (0)