File tree 3 files changed +10
-4
lines changed 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ CFLAGS += $(OPTIMIZATION_FLAGS)
48
48
# Add -ftree-vrp optimization and checking to all builds. It's not enabled for -Os by default.
49
49
CFLAGS += -ftree-vrp
50
50
51
- # MCU Series is defined by the HAL package and doesn't need to be specified here
52
- C_DEFS = -D$(MCU_PACKAGE ) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(MCU_VARIANT )
51
+ # STM32 MCU series must be defined. See supervisor/linker.h
52
+ C_DEFS = -D$(MCU_PACKAGE ) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(MCU_VARIANT ) -DSTM32 $( MCU_SERIES )
53
53
54
54
CFLAGS += $(INC ) -Werror -Wall -std=gnu11 -fshort-enums $(BASE_CFLAGS ) $(C_DEFS ) $(CFLAGS_MOD ) $(COPT ) -nostdlib -nostartfiles
55
55
Original file line number Diff line number Diff line change @@ -284,8 +284,9 @@ uint32_t *port_heap_get_bottom(void) {
284
284
return & _ld_heap_start ;
285
285
}
286
286
287
+ // heap memory can be set in SRAM and stack can be set in DTCM
287
288
uint32_t * port_heap_get_top (void ) {
288
- return port_stack_get_limit () ;
289
+ return & _ld_heap_end ;
289
290
}
290
291
291
292
uint32_t * port_stack_get_limit (void ) {
Original file line number Diff line number Diff line change 8
8
9
9
#pragma once
10
10
11
- #if defined(IMXRT1XXX ) || defined(FOMU ) || defined(STM32H7 ) || defined( RASPBERRYPI )
11
+ #if defined(IMXRT1XXX ) || defined(FOMU ) || defined(RASPBERRYPI )
12
12
#define PLACE_IN_DTCM_DATA (name ) name __attribute__((section(".dtcm_data." #name)))
13
13
#define PLACE_IN_DTCM_BSS (name ) name __attribute__((section(".dtcm_bss." #name)))
14
14
// Don't inline ITCM functions because that may pull them out of ITCM into other sections.
15
15
#define PLACE_IN_ITCM (name ) __attribute__((section(".itcm." #name), noinline, aligned(4))) name
16
+ #elif defined(STM32H7 )
17
+ #define PLACE_IN_DTCM_DATA (name ) name __attribute__((section(".dtcm_data." #name)))
18
+ #define PLACE_IN_DTCM_BSS (name ) name __attribute__((section(".dtcm_bss." #name)))
19
+ // using ITCM on the H7 generates hard fault exception
20
+ #define PLACE_IN_ITCM (name ) name
16
21
#else
17
22
#define PLACE_IN_DTCM_DATA (name ) name
18
23
#define PLACE_IN_DTCM_BSS (name ) name
You can’t perform that action at this time.
0 commit comments