Skip to content

Commit 9e7670b

Browse files
committed
fix(LinkerScript): Provide needed symbols
1 parent a573632 commit 9e7670b

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

Inc/HALAL/Models/MPU.hpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@
8686
// Constants in DTCM (default is FLASH because DTCM is small) @note Not protected by MPU
8787
#define DTCM_RODATA __attribute__((section(".dtcm.rodata"))) const
8888

89+
// Retrocompatibility macros
90+
#define D1_NC D1_NC_BSS
91+
#define D2_NC D2_NC_BSS
92+
#define D3_NC D3_NC_BSS
93+
#define D1_C D1_C_BSS
94+
#define D2_C D2_C_BSS
95+
#define D3_C D3_C_BSS
96+
8997
// Memory Bank Symbols from Linker
9098
extern "C" const char _itcm_base;
9199
extern "C" const char _itcm_size;
@@ -103,12 +111,12 @@ extern "C" const char _peripheral_base;
103111
extern "C" const char _peripheral_size;
104112

105113
// MPU Non-Cached Section Symbols from Linker
106-
extern "C" const char __mpu_d1_nc_start;
107-
extern "C" const char __mpu_d1_nc_end;
108-
extern "C" const char __mpu_d2_nc_start;
109-
extern "C" const char __mpu_d2_nc_end;
110-
extern "C" const char __mpu_d3_nc_start;
111-
extern "C" const char __mpu_d3_nc_end;
114+
extern "C" const char _ram_d1_nc_start;
115+
extern "C" const char _ram_d1_nc_end;
116+
extern "C" const char _ram_d2_nc_start;
117+
extern "C" const char _ram_d2_nc_end;
118+
extern "C" const char _ram_d3_nc_start;
119+
extern "C" const char _ram_d3_nc_end;
112120

113121
template <typename T>
114122
concept mpu_buffer_request = requires(typename T::domain d) {

LinkerScript.ld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ ENTRY(Reset_Handler)
44
/* Highest address of the user mode stack */
55
__sstack = ORIGIN(DTCMRAM);
66
__estack = ORIGIN(DTCMRAM) + LENGTH(DTCMRAM);
7+
PROVIDE(_sstack = __sstack);
8+
PROVIDE(_estack = __estack);
79
/* Generate a link error if heap and stack don't fit into DTCM */
810
__Min_Heap_Size = 0x200; /* required amount of heap */
911
__Min_Stack_Size = 0x400; /* required amount of stack */
12+
PROVIDE(_Min_Heap_Size = __Min_Heap_Size);
13+
PROVIDE(_Min_Stack_Size = __Min_Stack_Size);
1014

1115
#if !defined(__ITCM_SIZE)
1216
#define __ITCM_SIZE (64K) /* Default ITCM size if not defined by the build system */
@@ -76,6 +80,7 @@ SECTIONS
7680
{
7781
. = ALIGN(4);
7882
__stext = ABSOLUTE(.);
83+
PROVIDE(_stext = __stext);
7984

8085
#if !__ITCM_BUILD
8186
*(.text) /* .text sections (code) */
@@ -90,6 +95,7 @@ SECTIONS
9095

9196
. = ALIGN(4);
9297
__etext = ABSOLUTE(.);
98+
PROVIDE(_etext = __etext);
9399
} >FLASH
94100

95101
/* Code running in ITCM RAM (0 Wait States, Instruction Bus) */
@@ -182,10 +188,12 @@ SECTIONS
182188
{
183189
. = ALIGN(8);
184190
__hf_stack_start = .;
191+
PROVIDE(_hf_stack_start = __hf_stack_start);
185192
. += 0x400; /* 1 KB */
186193

187194
. = ALIGN(8);
188195
__hf_stack_end = .;
196+
PROVIDE(_hf_stack_end = __hf_stack_end);
189197
} >DTCMRAM
190198

191199
/* Initialized data sections goes into RAM, copied from FLASH */

0 commit comments

Comments
 (0)