Example locating interrupt and main stacks in DTCM #81162
-
The attached example uses a linker script to place the pinned linker sections in DTCM. This includes the The example is tested on the |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Marking as answered |
Beta Was this translation helpful? Give feedback.
-
Hey @DerekSnell,
The error seems to stem from missing linker symbols For context, I'm using Zephyr version Could you share how you resolved this issue on your end? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi @ofirshe , Best regards |
Beta Was this translation helpful? Give feedback.
-
We got this working on a more complicated application but also had to add Additionally we moved ALL stacks to the DTCM with this patch: From 094a29a8c938ab7c9a323c746991aeef4c8dcd1b Mon Sep 17 00:00:00 2001
From: JaagupA <[email protected]>
Date: Wed, 27 Aug 2025 14:44:14 +0300
Subject: [PATCH 2/2] Add CONFIG_LINKER_PINNED_STACKS.
Can be used to place all kernel stacks into the .pinned memory region, which can then in turn be moved by the application to whatever region desired, e.g DTCM.
---
Kconfig.zephyr | 7 +++++++
include/zephyr/linker/section_tags.h | 4 ++++
2 files changed, 11 insertions(+)
diff --git a/Kconfig.zephyr b/Kconfig.zephyr
index c6cf8ded2ab..cf81078e6be 100644
--- a/Kconfig.zephyr
+++ b/Kconfig.zephyr
@@ -254,6 +254,13 @@ config LINKER_USE_PINNED_SECTION
Requires that pinned sections exist in the architecture, SoC,
board or custom linker script.
+
+config LINKER_PINNED_STACKS
+ bool "Place all stacks into pinned memory"
+ depends on LINKER_USE_PINNED_SECTION
+ help
+ When selected, all kernel stacks will be placed into pinned memory.
+
config LINKER_USE_ONDEMAND_SECTION
bool "Use Evictable Linker Section"
depends on DEMAND_MAPPING
diff --git a/include/zephyr/linker/section_tags.h b/include/zephyr/linker/section_tags.h
index ab73c044501..f86524ef228 100644
--- a/include/zephyr/linker/section_tags.h
+++ b/include/zephyr/linker/section_tags.h
@@ -70,7 +70,11 @@
#else
#define __incoherent
#define __stackmem Z_GENERIC_SECTION(.user_stacks)
+#if defined(CONFIG_LINKER_PINNED_STACKS)
+#define __kstackmem __pinned_noinit
+#else
#define __kstackmem __noinit
+#endif
#endif /* CONFIG_KERNEL_COHERENCE */
#if defined(CONFIG_LINKER_USE_BOOT_SECTION) Does that seem valid? |
Beta Was this translation helpful? Give feedback.
Marking as answered