Skip to content

Commit

Permalink
Expanded RAM space for App 64->128 KB
Browse files Browse the repository at this point in the history
  • Loading branch information
danielinux committed Aug 21, 2023
1 parent f5b03f3 commit 1e464fb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions hal/stm32_tz.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test-app/ARM-stm32l5-ns.ld
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 1e464fb

Please sign in to comment.