Skip to content

Commit db157bd

Browse files
samples: drivers: subsys: Don't use SW ISR table
The software ISR table is not required if multithreading is not used, and no argument is passed to the irq handlers. Update all drivers, samples and subsystems to not use the SW ISR table and exclude it from the build. This saves approximately 2K ROM for all builds. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
1 parent 89deb5e commit db157bd

File tree

17 files changed

+149
-38
lines changed

17 files changed

+149
-38
lines changed

applications/installer/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CONFIG_IMG_MANAGER=y
55
CONFIG_CRC=y
66
CONFIG_REBOOT=y
77
CONFIG_MULTITHREADING=n
8+
CONFIG_GEN_SW_ISR_TABLE=n
89
CONFIG_USE_DT_CODE_PARTITION=y
910
CONFIG_MAIN_STACK_SIZE=8192
1011

boards/nordic/bm_nrf54l15dk/bm_nrf54l15dk_nrf54l05_cpuapp_s115_softdevice_defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ CONFIG_PARTITION_MANAGER_ENABLED=n
3636
CONFIG_MULTITHREADING=n
3737
CONFIG_ZERO_LATENCY_IRQS=y
3838

39+
# Disable generation of the redundant SW ISR table
40+
CONFIG_GEN_SW_ISR_TABLE=n
41+
3942
# Allow FLASH writes
4043
CONFIG_MPU_ALLOW_FLASH_WRITE=y
4144

boards/nordic/bm_nrf54l15dk/bm_nrf54l15dk_nrf54l05_cpuapp_s115_softdevice_mcuboot_defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ CONFIG_PARTITION_MANAGER_ENABLED=n
3636
CONFIG_MULTITHREADING=n
3737
CONFIG_ZERO_LATENCY_IRQS=y
3838

39+
# Disable generation of the redundant SW ISR table
40+
CONFIG_GEN_SW_ISR_TABLE=n
41+
3942
# Allow FLASH writes
4043
CONFIG_MPU_ALLOW_FLASH_WRITE=y
4144

boards/nordic/bm_nrf54l15dk/bm_nrf54l15dk_nrf54l10_cpuapp_s115_softdevice_defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ CONFIG_PARTITION_MANAGER_ENABLED=n
3636
CONFIG_MULTITHREADING=n
3737
CONFIG_ZERO_LATENCY_IRQS=y
3838

39+
# Disable generation of the redundant SW ISR table
40+
CONFIG_GEN_SW_ISR_TABLE=n
41+
3942
# Allow FLASH writes
4043
CONFIG_MPU_ALLOW_FLASH_WRITE=y
4144

boards/nordic/bm_nrf54l15dk/bm_nrf54l15dk_nrf54l10_cpuapp_s115_softdevice_mcuboot_defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ CONFIG_PARTITION_MANAGER_ENABLED=n
3636
CONFIG_MULTITHREADING=n
3737
CONFIG_ZERO_LATENCY_IRQS=y
3838

39+
# Disable generation of the redundant SW ISR table
40+
CONFIG_GEN_SW_ISR_TABLE=n
41+
3942
# Allow FLASH writes
4043
CONFIG_MPU_ALLOW_FLASH_WRITE=y
4144

boards/nordic/bm_nrf54l15dk/bm_nrf54l15dk_nrf54l15_cpuapp_s115_softdevice_defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ CONFIG_PARTITION_MANAGER_ENABLED=n
3636
CONFIG_MULTITHREADING=n
3737
CONFIG_ZERO_LATENCY_IRQS=y
3838

39+
# Disable generation of the redundant SW ISR table
40+
CONFIG_GEN_SW_ISR_TABLE=n
41+
3942
# Allow FLASH writes
4043
CONFIG_MPU_ALLOW_FLASH_WRITE=y
4144

boards/nordic/bm_nrf54l15dk/bm_nrf54l15dk_nrf54l15_cpuapp_s115_softdevice_mcuboot_defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ CONFIG_PARTITION_MANAGER_ENABLED=n
3636
CONFIG_MULTITHREADING=n
3737
CONFIG_ZERO_LATENCY_IRQS=y
3838

39+
# Disable generation of the redundant SW ISR table
40+
CONFIG_GEN_SW_ISR_TABLE=n
41+
3942
# Allow FLASH writes
4043
CONFIG_MPU_ALLOW_FLASH_WRITE=y
4144

drivers/console/console_bm_uarte.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313

1414
static const nrfx_uarte_t uarte_inst = NRFX_UARTE_INSTANCE(BOARD_CONSOLE_UARTE_INST);
1515

16+
ISR_DIRECT_DECLARE(console_bm_uarte_direct_isr)
17+
{
18+
NRFX_UARTE_INST_HANDLER_GET(BOARD_CONSOLE_UARTE_INST)();
19+
return 0;
20+
}
21+
1622
static int uarte_init(void)
1723
{
1824
int err;
@@ -33,10 +39,9 @@ static int uarte_init(void)
3339
uarte_config.interrupt_priority = CONFIG_BM_UARTE_CONSOLE_UARTE_IRQ_PRIO;
3440

3541
/** We need to connect the IRQ ourselves. */
36-
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(
37-
NRF_UARTE_INST_GET(BOARD_CONSOLE_UARTE_INST)),
38-
CONFIG_BM_UARTE_CONSOLE_UARTE_IRQ_PRIO,
39-
NRFX_UARTE_INST_HANDLER_GET(BOARD_CONSOLE_UARTE_INST), 0, 0);
42+
IRQ_DIRECT_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_CONSOLE_UARTE_INST)),
43+
CONFIG_BM_UARTE_CONSOLE_UARTE_IRQ_PRIO,
44+
console_bm_uarte_direct_isr, 0);
4045

4146
irq_enable(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_CONSOLE_UARTE_INST)));
4247

lib/bm_buttons/bm_buttons.c

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,26 @@ static void gpiote_uninit(void)
9090
#endif
9191
}
9292

93+
#if defined(CONFIG_SOC_SERIES_NRF52X)
94+
ISR_DIRECT_DECLARE(gpiote_0_direct_isr)
95+
{
96+
NRFX_GPIOTE_INST_HANDLER_GET(0)();
97+
return 0;
98+
}
99+
#elif defined(CONFIG_SOC_SERIES_NRF54LX)
100+
ISR_DIRECT_DECLARE(gpiote_20_direct_isr)
101+
{
102+
NRFX_GPIOTE_INST_HANDLER_GET(20)();
103+
return 0;
104+
}
105+
106+
ISR_DIRECT_DECLARE(gpiote_30_direct_isr)
107+
{
108+
NRFX_GPIOTE_INST_HANDLER_GET(30)();
109+
return 0;
110+
}
111+
#endif
112+
93113
static int gpiote_init(void)
94114
{
95115
int err;
@@ -102,8 +122,8 @@ static int gpiote_init(void)
102122
return -EIO;
103123
}
104124

105-
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(0)), IRQ_PRIO,
106-
NRFX_GPIOTE_INST_HANDLER_GET(0), 0, 0);
125+
IRQ_DIRECT_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(0)),
126+
IRQ_PRIO, gpiote_0_direct_isr, 0);
107127
}
108128
#elif defined(CONFIG_SOC_SERIES_NRF54LX)
109129
if (!nrfx_gpiote_init_check(&gpiote20_instance)) {
@@ -113,8 +133,9 @@ static int gpiote_init(void)
113133
return -EIO;
114134
}
115135

116-
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(20)) + NRF_GPIOTE_IRQ_GROUP,
117-
IRQ_PRIO, NRFX_GPIOTE_INST_HANDLER_GET(20), 0, 0);
136+
IRQ_DIRECT_CONNECT(
137+
NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(20)) + NRF_GPIOTE_IRQ_GROUP,
138+
IRQ_PRIO, gpiote_20_direct_isr, 0);
118139
}
119140

120141
if (!nrfx_gpiote_init_check(&gpiote30_instance)) {
@@ -124,8 +145,9 @@ static int gpiote_init(void)
124145
return -EIO;
125146
}
126147

127-
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(30)) + NRF_GPIOTE_IRQ_GROUP,
128-
IRQ_PRIO, NRFX_GPIOTE_INST_HANDLER_GET(30), 0, 0);
148+
IRQ_DIRECT_CONNECT(
149+
NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(30)) + NRF_GPIOTE_IRQ_GROUP,
150+
IRQ_PRIO, gpiote_30_direct_isr, 0);
129151
}
130152
#endif
131153
return 0;

samples/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
config MULTITHREADING
1111
default n if !UNITY
1212

13+
# Software ISR table is not needed if multithreading is not used
14+
config GEN_SW_ISR_TABLE
15+
default n if !MULTITHREADING
16+
1317
# Prevent moving SoftDevice RAM region
1418
# Need this when building without sysbuild
1519
config PARTITION_MANAGER_ENABLED

0 commit comments

Comments
 (0)