diff --git a/hal/stm32_tz.c b/hal/stm32_tz.c index 0288067bd..a039b4e4c 100644 --- a/hal/stm32_tz.c +++ b/hal/stm32_tz.c @@ -119,18 +119,25 @@ void hal_tz_release_nonsecure_area(void) void hal_gtzc_init(void) { int i; - /* Configure lower half of total RAM as secure */ + /* Configure lower half of total RAM as secure + * 0x3000 0000 : 0x3001 FFFF - 128KB + */ for (i = 0; i < 16; i++) { SET_GTZC_MPCBBx_S_VCTR(1, i, 0xFFFFFFFF); } - /* Configure rest of SRAM1 as non-secure */ + + /* Configure high portion of SRAM1 as non-secure + * 0x2002 0000 : 0x2002 FFFF - 64 KB + */ for (i = 16; i < 24; i++) { SET_GTZC_MPCBBx_S_VCTR(1, i, 0x0); } - /* Configure SRAM2 as secure */ + /* Configure SRAM2 as non-secure + * 0x2003 0000 : 0x2003 FFFF - 64 KB + */ for (i = 0; i < 8; i++) { - SET_GTZC_MPCBBx_S_VCTR(2, i, 0xFFFFFFFF); + SET_GTZC_MPCBBx_S_VCTR(2, i, 0x0); } } diff --git a/test-app/ARM-stm32l5-ns.ld b/test-app/ARM-stm32l5-ns.ld index db2548f4d..ab154492c 100644 --- a/test-app/ARM-stm32l5-ns.ld +++ b/test-app/ARM-stm32l5-ns.ld @@ -1,7 +1,7 @@ MEMORY { FLASH (rx) : ORIGIN = @WOLFBOOT_TEST_APP_ADDRESS@, LENGTH = @WOLFBOOT_TEST_APP_SIZE@ - RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x10000 + RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x20000 } SECTIONS