Skip to content

Commit 269a2fe

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 269a2fe

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

arch/Kconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,21 @@ 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+
config SRAM_ISR_EXEC_CONTEXT
593+
bool "Interruption context in SRAM"
594+
select SRAM_VECTOR_TABLE
595+
select SRAM_SW_ISR_TABLE
596+
select CODE_DATA_RELOCATION
597+
# In case you want to remove this dependency, place all code for the tracing susbys in RAM
598+
depends on !TRACING_ISR
599+
help
600+
Relocate all the vector table and the necessary files (isr_wrapper)
601+
in SRAM in order to have a fully SRAM context when an interruption is triggered.
602+
(except if it's to get out of idle state with CONFIG_PM=y)
603+
It remains to the user to place ISR callbacks and their dependencies in RAM.
604+
This option allows to not get latency (by accessing flash) when an interrupt is triggered
605+
in a real time application.
606+
592607
config IRQ_OFFLOAD_NESTED
593608
bool "irq_offload() supports nested IRQs"
594609
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)