• Home
  • Annotate
  • current directory
Name Date Size #Lines LOC

..22-Aug-2025-

dts/bindings/22-Aug-2025-

include/22-Aug-2025-

src/22-Aug-2025-

CMakeLists.txt A D22-Aug-2025939 2516

README.rst A D22-Aug-20252.2 KiB5844

app.overlay A D22-Aug-2025300 1815

prj.conf A D22-Aug-2025212 109

sections-rom.ld A D22-Aug-2025282 118

testcase.yaml A D22-Aug-2025688 2221

README.rst

1.. _vector_table_relocation:
2
3RAM Context for ISR
4###################
5
6Overview
7********
8A test that verifies the ISR vector table relocation and
9full IRQ execution under RAM context.
10
11Test Description
12****************
13
14This test verifies that interrupt service routines (ISRs), their callbacks, and the driver code
15can be fully relocated to RAM, ensuring that all interrupt handling occurs from SRAM rather than
16flash. This is important for real-time applications where minimizing interrupt latency is critical.
17
18The test uses a simple "fake driver" that registers an IRQ callback. The following aspects are
19validated:
20
21- The vector table and ISR wrapper are relocated to SRAM.
22- The fake driver's ISR and the registered callback are also located in SRAM.
23- When the interrupt is triggered, the callback and all relevant code execute from RAM, not flash.
24- The test asserts at runtime that the addresses of the callback, driver ISR, and ISR wrapper are
25  within the SRAM address range.
26
27Test Steps
28**********
29
301. The test registers a callback with the fake driver.
312. It triggers the interrupt (IRQ 27).
323. The callback checks (using assertions) that:
33   - Its own address,
34   - The driver's ISR address,
35   - The ISR wrapper address,
36   - And the device structure,
37   are all within the SRAM region.
384. The test passes if all assertions succeed and the callback is executed.
39
40Configuration
41*************
42
43The test is configured with the following options in prj.conf:
44
45- ``CONFIG_SRAM_VECTOR_TABLE=y``: Relocate the vector table to SRAM.
46- ``CONFIG_SRAM_SW_ISR_TABLE=y``: Relocate the software ISR table to SRAM.
47- ``CONFIG_CODE_DATA_RELOCATION_SRAM=y``: Enable code/data relocation to SRAM.
48- ``CONFIG_DEVICE_MUTABLE=y``: Allow device structures to be mutable (in RAM).
49- ``CONFIG_ZTEST=y``: Enable Zephyr's test framework.
50- ``CONFIG_TRACING_ISR=n``: Disables ISR tracing.
51- ``CONFIG_STACK_SENTINEL=n``: Disables stack overflow detection sentinels.
52- ``CONFIG_PM=n``: Disables power management.
53
54The last three options are disabled to avoid relocating code related to ISR tracing,
55stack overflow detection, and power management.
56
57The test is only supported on ARM Cortex-M platforms with VTOR (Vector Table Offset Register) support.
58