Skip to content

Commit 6f649ed

Browse files
Yehor Hrektdrozdovsky
Yehor Hrek
authored andcommitted
mps2: put the .gnu.sgstubs section in a hard coded address
- if the address of the .gnu.sgtubs is not defined, it's not possible to provide a correct SAU permissions for non secure calleble code
1 parent 9aab755 commit 6f649ed

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

arch/cortex-m33/mps2/src/mps2_an505_qemu/secure/partition_ARMCM33.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@
125125
/*
126126
// <o>Start Address <0-0xFFFFFFE0>
127127
*/
128-
#define SAU_INIT_START2 0x10000000
128+
#define SAU_INIT_START2 0x10020000
129129

130130
/*
131131
// <o>End Address <0x1F-0xFFFFFFFF>
132132
*/
133-
#define SAU_INIT_END2 0x1000FFFF
133+
#define SAU_INIT_END2 0x1002FFFF
134134

135135
/*
136136
// <o>Region is

arch/cortex-m33/mps2/src/mps2_an505_qemu/secure/secure.ld

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MEMORY
44
{
55
/* Flash is actually 224M */
66
S_FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 512K
7-
S_FLASH_END (rx) : ORIGIN = 0x10020000, LENGTH = 32K
7+
S_FLASH_END (rx) : ORIGIN = 0x10030000, LENGTH = 32K
88
S_RAM (rwx) : ORIGIN = 0x38000000, LENGTH = 0x2000
99
}
1010

@@ -50,13 +50,14 @@ SECTIONS
5050
* '--section-start' or in a linker script, to indicate where to place these
5151
* veneers in memory.
5252
*/
53-
.gnu.sgstubs :
53+
.gnu.sgstubs 0x10020000 : AT(0x10020000)
5454
{
5555
_ld_veneer_base = .;
5656
*(.gnu.sgstubs*)
5757
. = ALIGN(32);
5858
_ld_veneer_limit = .;
5959
} > S_FLASH
60+
ASSERT(SIZEOF(.gnu.sgstubs) <= 0x010000, "Error: .gnu.sgstubs section is too large!")
6061

6162
.heap (COPY):
6263
{

0 commit comments

Comments
 (0)