File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ CFLAGS += $(OPTIMIZATION_FLAGS)
4848# Add -ftree-vrp optimization and checking to all builds. It's not enabled for -Os by default.
4949CFLAGS += -ftree-vrp
5050
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 )
5353
5454CFLAGS += $(INC ) -Werror -Wall -std=gnu11 -fshort-enums $(BASE_CFLAGS ) $(C_DEFS ) $(CFLAGS_MOD ) $(COPT ) -nostdlib -nostartfiles
5555
Original file line number Diff line number Diff line change @@ -284,8 +284,9 @@ uint32_t *port_heap_get_bottom(void) {
284284 return & _ld_heap_start ;
285285}
286286
287+ // heap memory can be set in SRAM and stack can be set in DTCM
287288uint32_t * port_heap_get_top (void ) {
288- return port_stack_get_limit () ;
289+ return & _ld_heap_end ;
289290}
290291
291292uint32_t * port_stack_get_limit (void ) {
Original file line number Diff line number Diff line change 88
99#pragma once
1010
11- #if defined(IMXRT1XXX ) || defined(FOMU ) || defined(STM32H7 ) || defined( RASPBERRYPI )
11+ #if defined(IMXRT1XXX ) || defined(FOMU ) || defined(RASPBERRYPI )
1212#define PLACE_IN_DTCM_DATA (name ) name __attribute__((section(".dtcm_data." #name)))
1313#define PLACE_IN_DTCM_BSS (name ) name __attribute__((section(".dtcm_bss." #name)))
1414// Don't inline ITCM functions because that may pull them out of ITCM into other sections.
1515#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
1621#else
1722#define PLACE_IN_DTCM_DATA (name ) name
1823#define PLACE_IN_DTCM_BSS (name ) name
You can’t perform that action at this time.
0 commit comments