Skip to content

Commit 7f3639c

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 a50858a commit 7f3639c

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

arch/Kconfig

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

591+
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 dependencie, 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 trigerred.
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 theirs dependencies in RAM.
604+
This option allow to not get latency (by accessing flash) when an interrupt is trigerred
605+
in a real time application.
606+
591607
config IRQ_OFFLOAD_NESTED
592608
bool "irq_offload() supports nested IRQs"
593609
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()

0 commit comments

Comments
 (0)