summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMengsk <[email protected]>2025-09-30 14:32:57 +0200
committerMengsk <[email protected]>2025-09-30 15:40:39 +0200
commitc33fd3e618760b2ced5640e6afd4d08ab4184179 (patch)
tree798796f27a06ace887d8e88b29b4df2e3fa97a57
parent2f9f5c6840f2576b4fb16b883f40fca54d8a59f3 (diff)
Increase stack size to 2kB
Signed-off-by: Mengsk <[email protected]>
-rw-r--r--hw/bsp/stm32u0/boards/stm32u083cdk/STM32U083MCTx_FLASH.ld2
-rw-r--r--hw/bsp/stm32u0/boards/stm32u083cdk/board.cmake2
-rw-r--r--hw/bsp/stm32u0/boards/stm32u083cdk/board.mk1
-rw-r--r--hw/bsp/stm32u0/boards/stm32u083cdk/stm32u083xx_flash.icf32
-rw-r--r--hw/bsp/stm32u0/family.cmake4
5 files changed, 39 insertions, 2 deletions
diff --git a/hw/bsp/stm32u0/boards/stm32u083cdk/STM32U083MCTx_FLASH.ld b/hw/bsp/stm32u0/boards/stm32u083cdk/STM32U083MCTx_FLASH.ld
index 6aeac70e7..c5ea72fb0 100644
--- a/hw/bsp/stm32u0/boards/stm32u083cdk/STM32U083MCTx_FLASH.ld
+++ b/hw/bsp/stm32u0/boards/stm32u083cdk/STM32U083MCTx_FLASH.ld
@@ -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
diff --git a/hw/bsp/stm32u0/boards/stm32u083cdk/board.cmake b/hw/bsp/stm32u0/boards/stm32u083cdk/board.cmake
index 2c9843533..945146810 100644
--- a/hw/bsp/stm32u0/boards/stm32u083cdk/board.cmake
+++ b/hw/bsp/stm32u0/boards/stm32u083cdk/board.cmake
@@ -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()
diff --git a/hw/bsp/stm32u0/boards/stm32u083cdk/board.mk b/hw/bsp/stm32u0/boards/stm32u083cdk/board.mk
index c04bbd33e..892854f54 100644
--- a/hw/bsp/stm32u0/boards/stm32u083cdk/board.mk
+++ b/hw/bsp/stm32u0/boards/stm32u083cdk/board.mk
@@ -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
diff --git a/hw/bsp/stm32u0/boards/stm32u083cdk/stm32u083xx_flash.icf b/hw/bsp/stm32u0/boards/stm32u083cdk/stm32u083xx_flash.icf
new file mode 100644
index 000000000..cfaa305af
--- /dev/null
+++ b/hw/bsp/stm32u0/boards/stm32u083cdk/stm32u083xx_flash.icf
@@ -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 };
diff --git a/hw/bsp/stm32u0/family.cmake b/hw/bsp/stm32u0/family.cmake
index 8d0926d9b..fefaea9de 100644
--- a/hw/bsp/stm32u0/family.cmake
+++ b/hw/bsp/stm32u0/family.cmake
@@ -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