Use linker script variables for MPU setup for Nuvoton M2351 Keil Project
Earlier we were using hard-coded addresses for MPU setup which were ensured to be the same as linker script setup. This change updates the Keil uVision project for Nuvoton Numaker-PFM-M2351 to use the variables exported from the linker script. This ensures that the MPU setup never goes out of sync with linker script.pull/5/head
parent
d449c8979d
commit
d58e6a7b09
@ -1,59 +1,70 @@
|
||||
|
||||
; Privileged Code:
|
||||
; Start : 0x10040000
|
||||
; End : 0x10047000 - 1
|
||||
; Size : 28 Kbytes
|
||||
; NOTE: ARMv8-M MPU requires that each region must start on a 32 byte aligned
|
||||
; address and the size of a region must be a multiple of 32 bytes.
|
||||
;
|
||||
; Flash Layout
|
||||
;
|
||||
; ---------------------
|
||||
; | Privileged Code |
|
||||
; ---------------------
|
||||
; | System Calls |
|
||||
; ---------------------
|
||||
; | Unprivileged Code |
|
||||
; ---------------------
|
||||
;
|
||||
; RAM Layout
|
||||
;
|
||||
; Privileged Data:
|
||||
; Start : 0x30008000
|
||||
; End : 0x30009000 - 1
|
||||
; Size : 4 Kbytes
|
||||
LR_IROM_NS_PRIVILEGED 0x10040000 0x00007000 ; load region size_region
|
||||
; ---------------------
|
||||
; | Privileged Data |
|
||||
; ---------------------
|
||||
; | Unprivileged Data |
|
||||
; ---------------------
|
||||
|
||||
LR_APP 0x10040000 ; load region
|
||||
{
|
||||
ER_IROM_NS_PRIVILEGED +0 ; load address = execution address
|
||||
ER_IROM_NS_PRIVILEGED +0 ALIGN 32
|
||||
{
|
||||
*.o(RESET, +First)
|
||||
*(InRoot$$Sections) ; All sections that must be in a root region
|
||||
*(privileged_functions)
|
||||
}
|
||||
|
||||
ER_IRAM_NS_PRIVILEGED 0x30008000 0x00001000
|
||||
ER_IROM_NS_PRIVILEGED_ALIGN +0 ALIGN 32 EMPTY 0x0
|
||||
{
|
||||
*(privileged_data)
|
||||
}
|
||||
}
|
||||
|
||||
; System Calls:
|
||||
; Start : 0x10047000
|
||||
; End : 0x10048000 - 1
|
||||
; Size : 4 Kbytes
|
||||
LR_IROM_NS_SYSTEM_CALLS 0x10047000 0x00001000 ; load region size_region
|
||||
{
|
||||
ER_IROM_NS_SYSTEM_CALLS +0 ; load address = execution address
|
||||
ER_IROM_NS_FREERTOS_SYSTEM_CALLS +0 ALIGN 32
|
||||
{
|
||||
*(freertos_system_calls)
|
||||
*(freertos_system_calls)
|
||||
}
|
||||
}
|
||||
|
||||
; Unprivileged Code:
|
||||
; Start : 0x10048000
|
||||
; End : 0x10080000 - 1
|
||||
; Size : 224 Kbytes
|
||||
;
|
||||
; Unprivileged Data:
|
||||
; Start : 0x30009000
|
||||
; End : 0x30018000 - 1
|
||||
; Size : 60 Kbytes
|
||||
LR_IROM_NS_UNPRIVILEGED 0x10048000 0x00038000 ; load region size_region
|
||||
{
|
||||
ER_IROM_NS_UNPRIVILEGED +0 ; load address = execution address
|
||||
ER_IROM_NS_FREERTOS_SYSTEM_CALLS_ALIGN +0 ALIGN 32 EMPTY 0x0
|
||||
{
|
||||
}
|
||||
|
||||
ER_IROM_NS_UNPRIVILEGED +0 ALIGN 32
|
||||
{
|
||||
*(+RO)
|
||||
*(+RO)
|
||||
}
|
||||
|
||||
ER_IRAM_NS_UNPRIVILEGED 0x30009000 0x0000F000
|
||||
ER_IROM_NS_UNPRIVILEGED_ALIGN +0 ALIGN 32 EMPTY 0x0
|
||||
{
|
||||
}
|
||||
|
||||
ER_IRAM_NS_PRIVILEGED 0x30008000 ALIGN 32
|
||||
{
|
||||
*(privileged_data)
|
||||
}
|
||||
|
||||
ER_IRAM_NS_PRIVILEGED_ALIGN +0 ALIGN 32 EMPTY 0x0
|
||||
{
|
||||
}
|
||||
|
||||
ER_IRAM_NS_UNPRIVILEGED +0 ALIGN 32
|
||||
{
|
||||
*(+RW, +ZI)
|
||||
}
|
||||
}
|
||||
|
||||
ER_IRAM_NS_UNPRIVILEGED_ALIGN +0 ALIGN 32 EMPTY 0x0
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue