Skip to content

Commit 63618b7

Browse files
arch: Add sram_isr_exec_context symbol
The goal of this symbol is to have all the interrupt context in SRAM in order to avoid flash latency in case of real time constraints. It is actually not compatible with TRACING_ISR by default otherwise it means that all the tracing susbys have to be in SRAM. Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
1 parent bf6988a commit 63618b7

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

arch/Kconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,22 @@ config SRAM_SW_ISR_TABLE
589589
The option specifies that the software interrupts vector table will be
590590
placed inside SRAM instead of the flash.
591591

592+
593+
config SRAM_ISR_EXEC_CONTEXT
594+
bool "Interruption context in SRAM"
595+
select SRAM_VECTOR_TABLE
596+
select SRAM_SW_ISR_TABLE
597+
select CODE_DATA_RELOCATION
598+
# In case you want to remove this dependency, place all code for the tracing susbys in RAM
599+
depends on !TRACING_ISR
600+
help
601+
Relocate all the vector table and the necessary files (isr_wrapper)
602+
in SRAM in order to have a fully SRAM context when an interruption is triggered.
603+
(except if it's to get out of idle state with CONFIG_PM=y)
604+
It remains to the user to place ISR callbacks and their dependencies in RAM.
605+
This option allows to not get latency (by accessing flash) when an interrupt is triggered
606+
in a real time application.
607+
592608
config IRQ_OFFLOAD_NESTED
593609
bool "irq_offload() supports nested IRQs"
594610
depends on IRQ_OFFLOAD

arch/arm/core/cortex_m/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,8 @@ zephyr_linker_sources_ifdef(CONFIG_SRAM_VECTOR_TABLE
7171
ram_vector_table.ld
7272
)
7373
endif()
74+
75+
if (CONFIG_SRAM_ISR_EXEC_CONTEXT)
76+
zephyr_code_relocate(FILES ${ZEPHYR_BASE}/arch/arm/core/cortex_m/isr_wrapper.c LOCATION RAM)
77+
zephyr_code_relocate(FILES ${ZEPHYR_BASE}/arch/arm/core/cortex_m/irq_init.c LOCATION RAM)
78+
endif()

doc/releases/release-notes-4.2.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ New APIs and options
112112
* :kconfig:option:`CONFIG_SRAM_VECTOR_TABLE` moved from ``zephyr/Kconfig.zephyr`` to
113113
``zephyr/arch/Kconfig`` and added dependencies to it.
114114
* :kconfig:option:`CONFIG_SRAM_SW_ISR_TABLE`
115+
* :kconfig:option:`CONFIG_SRAM_ISR_EXEC_CONTEXT`
115116

116117
* Kernel
117118

0 commit comments

Comments
 (0)