Increase stack size to 2kB

Signed-off-by: Mengsk <admin@hifiphile.com>
This commit is contained in:
Mengsk
2025-09-30 14:32:57 +02:00
parent 2f9f5c6840
commit c33fd3e618
5 changed files with 39 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ MEMORY
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
_Min_Stack_Size = 0x800; /* required amount of stack */
/* Sections */
SECTIONS

View File

@@ -2,9 +2,11 @@ set(MCU_VARIANT stm32u083xx)
set(JLINK_DEVICE stm32u083mc)
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32U083MCTx_FLASH.ld)
set(LD_FILE_IAR ${CMAKE_CURRENT_LIST_DIR}/stm32u083xx_flash.icf)
function(update_board TARGET)
target_compile_definitions(${TARGET} PUBLIC
STM32U083xx
CFG_EXAMPLE_VIDEO_READONLY
)
endfunction()

View File

@@ -4,6 +4,7 @@ CFLAGS += \
# All source paths should be relative to the top level.
LD_FILE = $(BOARD_PATH)/STM32U083MCTx_FLASH.ld
LD_FILE_IAR = $(BOARD_PATH)/stm32u083xx_flash.icf
# For flash-jlink target
JLINK_DEVICE = STM32U083MC

View File

@@ -0,0 +1,32 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x800;
define symbol __ICFEDIT_size_heap__ = 0x200;
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK, block HEAP };

View File

@@ -36,7 +36,9 @@ function(add_board_target BOARD_TARGET)
set(LD_FILE_GNU ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/linker/${MCU_VARIANT_UPPER}_FLASH.ld)
endif ()
set(LD_FILE_Clang ${LD_FILE_GNU})
set(LD_FILE_IAR ${ST_CMSIS}/Source/Templates/iar/linker/${MCU_VARIANT}_flash.icf)
if (NOT DEFINED LD_FILE_IAR)
set(LD_FILE_IAR ${ST_CMSIS}/Source/Templates/iar/linker/${MCU_VARIANT}_flash.icf)
endif ()
add_library(${BOARD_TARGET} STATIC
${ST_CMSIS}/Source/Templates/system_${ST_PREFIX}.c