Skip to content

Commit cd7ff76

Browse files
Add necessary initialization for NS app
1 parent 55d5f94 commit cd7ff76

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

hal/mcxn.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static void hal_sau_init(void)
6969
0);
7070

7171
/* Non-secure RAM */
72-
sau_init_region(2, 0x20020000, 0x20025FFF, 0);
72+
sau_init_region(2, 0x20000000, 0x2004FFFF, 0);
7373

7474
/* Peripherals */
7575
sau_init_region(3, 0x40000000, 0x4005FFFF, 0);
@@ -92,6 +92,14 @@ static void periph_unsecure(void)
9292

9393
GPIO_EnablePinControlNonSecure(GPIO0, (1UL << 10) | (1UL << 27));
9494
GPIO_EnablePinControlNonSecure(GPIO1, (1UL << 2) | (1UL << 8) | (1UL << 9));
95+
96+
/* Disable GDET for voltage configuration on app */
97+
GDET0->GDET_ENABLE1 = 0;
98+
GDET1->GDET_ENABLE1 = 0;
99+
100+
/* Configure ENET IRQs as non-secure */
101+
NVIC->ITNS[4] |= (1UL << 11) | (1UL << 12) | (1UL << 13);
102+
95103
}
96104
#endif
97105

hal/mcxn.ld

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
MEMORY
22
{
3-
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = @WOLFBOOT_KEYVAULT_ADDRESS@ - @ARCH_FLASH_OFFSET@
4-
RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 0x10000 /* 64K */
5-
RAM_HEAP (rwx) : ORIGIN = 0x30010000, LENGTH = 0xE000 /* 56K */
3+
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = @WOLFBOOT_KEYVAULT_ADDRESS@ - @ARCH_FLASH_OFFSET@
4+
RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 0x20000 /* 128K */
5+
RAM_HEAP (rwx) : ORIGIN = 0x30020000, LENGTH = 0xE000 /* 56K */
66
FLASH_KEYVAULT (rw) : ORIGIN = @WOLFBOOT_KEYVAULT_ADDRESS@, LENGTH = @WOLFBOOT_KEYVAULT_SIZE@
77
FLASH_NSC (rx) : ORIGIN = @WOLFBOOT_NSC_ADDRESS@, LENGTH = @WOLFBOOT_NSC_SIZE@
88
}
@@ -43,6 +43,7 @@ SECTIONS
4343
.data : AT (_stored_data)
4444
{
4545
_start_data = .;
46+
KEEP(*(.ramcode*))
4647
KEEP(*(.data*))
4748
. = ALIGN(4);
4849
_end_data = .;

0 commit comments

Comments
 (0)