Skip to content

Commit c33fd3e

Browse files
committed
Increase stack size to 2kB
Signed-off-by: Mengsk <[email protected]>
1 parent 2f9f5c6 commit c33fd3e

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed

hw/bsp/stm32u0/boards/stm32u083cdk/STM32U083MCTx_FLASH.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ MEMORY
3737
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
3838

3939
_Min_Heap_Size = 0x200; /* required amount of heap */
40-
_Min_Stack_Size = 0x400; /* required amount of stack */
40+
_Min_Stack_Size = 0x800; /* required amount of stack */
4141

4242
/* Sections */
4343
SECTIONS

hw/bsp/stm32u0/boards/stm32u083cdk/board.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ set(MCU_VARIANT stm32u083xx)
22
set(JLINK_DEVICE stm32u083mc)
33

44
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32U083MCTx_FLASH.ld)
5+
set(LD_FILE_IAR ${CMAKE_CURRENT_LIST_DIR}/stm32u083xx_flash.icf)
56

67
function(update_board TARGET)
78
target_compile_definitions(${TARGET} PUBLIC
89
STM32U083xx
10+
CFG_EXAMPLE_VIDEO_READONLY
911
)
1012
endfunction()

hw/bsp/stm32u0/boards/stm32u083cdk/board.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CFLAGS += \
44

55
# All source paths should be relative to the top level.
66
LD_FILE = $(BOARD_PATH)/STM32U083MCTx_FLASH.ld
7+
LD_FILE_IAR = $(BOARD_PATH)/stm32u083xx_flash.icf
78

89
# For flash-jlink target
910
JLINK_DEVICE = STM32U083MC
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*###ICF### Section handled by ICF editor, don't touch! ****/
2+
/*-Editor annotation file-*/
3+
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
4+
/*-Specials-*/
5+
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
6+
/*-Memory Regions-*/
7+
define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
8+
define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF;
9+
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
10+
define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF;
11+
12+
/*-Sizes-*/
13+
define symbol __ICFEDIT_size_cstack__ = 0x800;
14+
define symbol __ICFEDIT_size_heap__ = 0x200;
15+
/**** End of ICF editor section. ###ICF###*/
16+
17+
18+
define memory mem with size = 4G;
19+
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
20+
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
21+
22+
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
23+
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
24+
25+
initialize by copy { readwrite };
26+
do not initialize { section .noinit };
27+
28+
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
29+
30+
place in ROM_region { readonly };
31+
place in RAM_region { readwrite,
32+
block CSTACK, block HEAP };

hw/bsp/stm32u0/family.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ function(add_board_target BOARD_TARGET)
3636
set(LD_FILE_GNU ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/linker/${MCU_VARIANT_UPPER}_FLASH.ld)
3737
endif ()
3838
set(LD_FILE_Clang ${LD_FILE_GNU})
39-
set(LD_FILE_IAR ${ST_CMSIS}/Source/Templates/iar/linker/${MCU_VARIANT}_flash.icf)
39+
if (NOT DEFINED LD_FILE_IAR)
40+
set(LD_FILE_IAR ${ST_CMSIS}/Source/Templates/iar/linker/${MCU_VARIANT}_flash.icf)
41+
endif ()
4042

4143
add_library(${BOARD_TARGET} STATIC
4244
${ST_CMSIS}/Source/Templates/system_${ST_PREFIX}.c

0 commit comments

Comments
 (0)