Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions applications/installer/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CONFIG_IMG_MANAGER=y
CONFIG_CRC=y
CONFIG_REBOOT=y
CONFIG_MULTITHREADING=n
CONFIG_GEN_SW_ISR_TABLE=n
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_MAIN_STACK_SIZE=8192

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ CONFIG_PARTITION_MANAGER_ENABLED=n
CONFIG_MULTITHREADING=n
CONFIG_ZERO_LATENCY_IRQS=y

# Disable generation of the redundant SW ISR table
CONFIG_GEN_SW_ISR_TABLE=n
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjarki-andreasen This should be added to S145 board variants as well.


# Allow FLASH writes
CONFIG_MPU_ALLOW_FLASH_WRITE=y

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ CONFIG_PARTITION_MANAGER_ENABLED=n
CONFIG_MULTITHREADING=n
CONFIG_ZERO_LATENCY_IRQS=y

# Disable generation of the redundant SW ISR table
CONFIG_GEN_SW_ISR_TABLE=n

# Allow FLASH writes
CONFIG_MPU_ALLOW_FLASH_WRITE=y

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ CONFIG_PARTITION_MANAGER_ENABLED=n
CONFIG_MULTITHREADING=n
CONFIG_ZERO_LATENCY_IRQS=y

# Disable generation of the redundant SW ISR table
CONFIG_GEN_SW_ISR_TABLE=n

# Allow FLASH writes
CONFIG_MPU_ALLOW_FLASH_WRITE=y

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ CONFIG_PARTITION_MANAGER_ENABLED=n
CONFIG_MULTITHREADING=n
CONFIG_ZERO_LATENCY_IRQS=y

# Disable generation of the redundant SW ISR table
CONFIG_GEN_SW_ISR_TABLE=n

# Allow FLASH writes
CONFIG_MPU_ALLOW_FLASH_WRITE=y

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ CONFIG_PARTITION_MANAGER_ENABLED=n
CONFIG_MULTITHREADING=n
CONFIG_ZERO_LATENCY_IRQS=y

# Disable generation of the redundant SW ISR table
CONFIG_GEN_SW_ISR_TABLE=n

# Allow FLASH writes
CONFIG_MPU_ALLOW_FLASH_WRITE=y

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ CONFIG_PARTITION_MANAGER_ENABLED=n
CONFIG_MULTITHREADING=n
CONFIG_ZERO_LATENCY_IRQS=y

# Disable generation of the redundant SW ISR table
CONFIG_GEN_SW_ISR_TABLE=n

# Allow FLASH writes
CONFIG_MPU_ALLOW_FLASH_WRITE=y

Expand Down
13 changes: 9 additions & 4 deletions drivers/console/console_bm_uarte.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@

static const nrfx_uarte_t uarte_inst = NRFX_UARTE_INSTANCE(BOARD_CONSOLE_UARTE_INST);

ISR_DIRECT_DECLARE(console_bm_uarte_direct_isr)
{
NRFX_UARTE_INST_HANDLER_GET(BOARD_CONSOLE_UARTE_INST)();
return 0;
}

static int uarte_init(void)
{
int err;
Expand All @@ -33,10 +39,9 @@ static int uarte_init(void)
uarte_config.interrupt_priority = CONFIG_BM_UARTE_CONSOLE_UARTE_IRQ_PRIO;

/** We need to connect the IRQ ourselves. */
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(
NRF_UARTE_INST_GET(BOARD_CONSOLE_UARTE_INST)),
CONFIG_BM_UARTE_CONSOLE_UARTE_IRQ_PRIO,
NRFX_UARTE_INST_HANDLER_GET(BOARD_CONSOLE_UARTE_INST), 0, 0);
IRQ_DIRECT_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_CONSOLE_UARTE_INST)),
CONFIG_BM_UARTE_CONSOLE_UARTE_IRQ_PRIO,
console_bm_uarte_direct_isr, 0);

irq_enable(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_CONSOLE_UARTE_INST)));

Expand Down
22 changes: 18 additions & 4 deletions lib/bm_buttons/bm_buttons.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ static void gpiote_uninit(void)
nrfx_gpiote_uninit(&gpiote30_instance);
}

ISR_DIRECT_DECLARE(gpiote_20_direct_isr)
{
NRFX_GPIOTE_INST_HANDLER_GET(20)();
return 0;
}

ISR_DIRECT_DECLARE(gpiote_30_direct_isr)
{
NRFX_GPIOTE_INST_HANDLER_GET(30)();
return 0;
}

static int gpiote_init(void)
{
int err;
Expand All @@ -89,8 +101,9 @@ static int gpiote_init(void)
return -EIO;
}

IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(20)) + NRF_GPIOTE_IRQ_GROUP,
IRQ_PRIO, NRFX_GPIOTE_INST_HANDLER_GET(20), 0, 0);
IRQ_DIRECT_CONNECT(
NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(20)) + NRF_GPIOTE_IRQ_GROUP,
IRQ_PRIO, gpiote_20_direct_isr, 0);
}

if (!nrfx_gpiote_init_check(&gpiote30_instance)) {
Expand All @@ -100,8 +113,9 @@ static int gpiote_init(void)
return -EIO;
}

IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(30)) + NRF_GPIOTE_IRQ_GROUP,
IRQ_PRIO, NRFX_GPIOTE_INST_HANDLER_GET(30), 0, 0);
IRQ_DIRECT_CONNECT(
NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(30)) + NRF_GPIOTE_IRQ_GROUP,
IRQ_PRIO, gpiote_30_direct_isr, 0);
}

return 0;
Expand Down
4 changes: 4 additions & 0 deletions samples/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
config MULTITHREADING
default n if !UNITY

# Software ISR table is not needed if multithreading is not used
config GEN_SW_ISR_TABLE
default n if !MULTITHREADING

# Prevent moving SoftDevice RAM region
# Need this when building without sysbuild
config PARTITION_MANAGER_ENABLED
Expand Down
32 changes: 26 additions & 6 deletions samples/bluetooth/ble_nus/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,26 @@ static void ble_nus_evt_handler(const struct ble_nus_evt *evt)
}
}

ISR_DIRECT_DECLARE(uarte_direct_isr)
{
NRFX_UARTE_INST_HANDLER_GET(NUS_UARTE_INST)();
return 0;
}

#if defined(CONFIG_NUS_LPUARTE)
ISR_DIRECT_DECLARE(gpiote_20_direct_isr)
{
NRFX_GPIOTE_INST_HANDLER_GET(20)();
return 0;
}

ISR_DIRECT_DECLARE(gpiote_30_direct_isr)
{
NRFX_GPIOTE_INST_HANDLER_GET(30)();
return 0;
}
#endif

/**
* @brief Initalize UARTE driver.
*/
Expand Down Expand Up @@ -386,17 +406,17 @@ static int uarte_init(void)

/** We need to connect the IRQ ourselves. */

IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(NUS_UARTE_INST)),
CONFIG_NUS_UART_IRQ_PRIO, NRFX_UARTE_INST_HANDLER_GET(NUS_UARTE_INST), 0, 0);
IRQ_DIRECT_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(NUS_UARTE_INST)),
CONFIG_NUS_UART_IRQ_PRIO, uarte_direct_isr, 0);

irq_enable(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(NUS_UARTE_INST)));

#if defined(CONFIG_NUS_LPUARTE)
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(20)) + NRF_GPIOTE_IRQ_GROUP,
CONFIG_GPIOTE_IRQ_PRIO, NRFX_GPIOTE_INST_HANDLER_GET(20), 0, 0);
IRQ_DIRECT_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(20)) + NRF_GPIOTE_IRQ_GROUP,
CONFIG_GPIOTE_IRQ_PRIO, gpiote_20_direct_isr, 0);

IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(30)) + NRF_GPIOTE_IRQ_GROUP,
CONFIG_GPIOTE_IRQ_PRIO, NRFX_GPIOTE_INST_HANDLER_GET(30), 0, 0);
IRQ_DIRECT_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(30)) + NRF_GPIOTE_IRQ_GROUP,
CONFIG_GPIOTE_IRQ_PRIO, gpiote_30_direct_isr, 0);

err = bm_lpuarte_init(&lpu, &lpu_cfg, uarte_evt_handler);
if (err != NRFX_SUCCESS) {
Expand Down
31 changes: 24 additions & 7 deletions samples/peripherals/lpuarte/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ static void lpuarte_event_handler(nrfx_uarte_event_t const *event, void *ctx)
}
}

ISR_DIRECT_DECLARE(gpiote_20_direct_isr)
{
NRFX_GPIOTE_INST_HANDLER_GET(20)();
return 0;
}

ISR_DIRECT_DECLARE(gpiote_30_direct_isr)
{
NRFX_GPIOTE_INST_HANDLER_GET(30)();
return 0;
}

ISR_DIRECT_DECLARE(lpuarte_direct_isr)
{
NRFX_UARTE_INST_HANDLER_GET(BOARD_APP_LPUARTE_INST)();
return 0;
}

/* Initialize UARTE driver. */
static uint32_t uarte_init(void)
{
Expand All @@ -71,15 +89,14 @@ static uint32_t uarte_init(void)

lpu_cfg.uarte_cfg.interrupt_priority = CONFIG_LPUARTE_IRQ_PRIO;

IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(20)) + NRF_GPIOTE_IRQ_GROUP,
CONFIG_LPUARTE_GPIOTE_IRQ_PRIO, NRFX_GPIOTE_INST_HANDLER_GET(20), 0, 0);
IRQ_DIRECT_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(20)) + NRF_GPIOTE_IRQ_GROUP,
CONFIG_LPUARTE_GPIOTE_IRQ_PRIO, gpiote_20_direct_isr, 0);

IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(30)) + NRF_GPIOTE_IRQ_GROUP,
CONFIG_LPUARTE_GPIOTE_IRQ_PRIO, NRFX_GPIOTE_INST_HANDLER_GET(30), 0, 0);
IRQ_DIRECT_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(30)) + NRF_GPIOTE_IRQ_GROUP,
CONFIG_LPUARTE_GPIOTE_IRQ_PRIO, gpiote_30_direct_isr, 0);

IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_APP_LPUARTE_INST)),
CONFIG_LPUARTE_IRQ_PRIO,
NRFX_UARTE_INST_HANDLER_GET(BOARD_APP_LPUARTE_INST), 0, 0);
IRQ_DIRECT_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_APP_LPUARTE_INST)),
CONFIG_LPUARTE_IRQ_PRIO, lpuarte_direct_isr, 0);

irq_enable(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_APP_LPUARTE_INST)));

Expand Down
11 changes: 9 additions & 2 deletions samples/peripherals/pwm/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ static void pwm_handler(nrfx_pwm_evt_type_t event_type, void *ctx)
curr_loop++;
}

ISR_DIRECT_DECLARE(pwm_direct_isr)
{
NRFX_PWM_INST_HANDLER_GET(20)();
return 0;
}

int main(void)
{
nrfx_err_t err;
Expand All @@ -49,8 +55,9 @@ int main(void)

LOG_INF("PWM sample started");

IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_PWM_INST_GET(PWM_INST_IDX)),
CONFIG_PWM_IRQ_PRIO, NRFX_PWM_INST_HANDLER_GET(20), 0, 0);
IRQ_DIRECT_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_PWM_INST_GET(PWM_INST_IDX)),
CONFIG_PWM_IRQ_PRIO,
pwm_direct_isr, 0);

err = nrfx_pwm_init(&pwm_instance, &config, pwm_handler, &pwm_instance);
if (err != NRFX_SUCCESS) {
Expand Down
12 changes: 9 additions & 3 deletions samples/peripherals/uarte/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ static void uarte_event_handler(nrfx_uarte_event_t const *event, void *ctx)
}
}

ISR_DIRECT_DECLARE(uarte_direct_isr)
{
NRFX_UARTE_INST_HANDLER_GET(BOARD_APP_UARTE_INST)();
return 0;
}

/* Initialize UARTE driver. */
static int uarte_init(void)
{
Expand All @@ -106,9 +112,9 @@ static int uarte_init(void)
uarte_config.interrupt_priority = CONFIG_UARTE_IRQ_PRIO;

/* We need to connect the IRQ ourselves. */
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_APP_UARTE_INST)),
CONFIG_UARTE_IRQ_PRIO,
NRFX_UARTE_INST_HANDLER_GET(BOARD_APP_UARTE_INST), 0, 0);
IRQ_DIRECT_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_APP_UARTE_INST)),
CONFIG_UARTE_IRQ_PRIO,
uarte_direct_isr, 0);

irq_enable(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_APP_UARTE_INST)));

Expand Down
13 changes: 9 additions & 4 deletions subsys/logging/backends/log_backend_bm_uarte.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ static char uarte_tx_buf[CONFIG_LOG_BACKEND_BM_UARTE_BUFFER_SIZE];
static int log_out(uint8_t *data, size_t length, void *ctx);
LOG_OUTPUT_DEFINE(bm_lbu_output, log_out, lbu_buffer, CONFIG_LOG_BACKEND_BM_UARTE_BUFFER_SIZE);

ISR_DIRECT_DECLARE(log_backend_bm_uarte_direct_isr)
{
NRFX_UARTE_INST_HANDLER_GET(BOARD_CONSOLE_UARTE_INST)();
return 0;
}

static int uarte_init(void)
{
int err;
Expand All @@ -42,10 +48,9 @@ static int uarte_init(void)
uarte_config.tx_cache.length = sizeof(uarte_tx_buf);

/** We need to connect the IRQ ourselves. */
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(
NRF_UARTE_INST_GET(BOARD_CONSOLE_UARTE_INST)),
CONFIG_LOG_BACKEND_BM_UARTE_IRQ_PRIO,
NRFX_UARTE_INST_HANDLER_GET(BOARD_CONSOLE_UARTE_INST), 0, 0);
IRQ_DIRECT_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_CONSOLE_UARTE_INST)),
CONFIG_LOG_BACKEND_BM_UARTE_IRQ_PRIO,
log_backend_bm_uarte_direct_isr, 0);

irq_enable(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_CONSOLE_UARTE_INST)));

Expand Down
12 changes: 9 additions & 3 deletions subsys/mgmt/mcumgr/transport/src/bm_uart_mcumgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ void uart_mcumgr_register(uart_mcumgr_recv_fn *cb)
uart_mcumgr_recv_cb = cb;
}

ISR_DIRECT_DECLARE(bm_uart_mcumgr_direct_isr)
{
NRFX_UARTE_INST_HANDLER_GET(BOARD_APP_UARTE_INST)();
return 0;
}

/**
* @brief Initialize UARTE driver.
*/
Expand All @@ -219,9 +225,9 @@ static int bm_uarte_init(void)
uarte_config.interrupt_priority = CONFIG_MCUMGR_TRANSPORT_BM_UART_UARTE_IRQ_PRIO;

/** We need to connect the IRQ ourselves. */
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_APP_UARTE_INST)),
CONFIG_MCUMGR_TRANSPORT_BM_UART_UARTE_IRQ_PRIO,
NRFX_UARTE_INST_HANDLER_GET(BOARD_APP_UARTE_INST), 0, 0);
IRQ_DIRECT_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_APP_UARTE_INST)),
CONFIG_MCUMGR_TRANSPORT_BM_UART_UARTE_IRQ_PRIO,
bm_uart_mcumgr_direct_isr, 0);

irq_enable(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INST_GET(BOARD_APP_UARTE_INST)));

Expand Down
6 changes: 3 additions & 3 deletions subsys/softdevice_handler/nrf_sdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,15 @@ void SD_EVT_IRQHandler(void)

#endif /* NRF_SDH_DISPATCH_MODEL */

static void isr_handler(const void *arg)
ISR_DIRECT_DECLARE(sd_direct_isr)
{
ARG_UNUSED(arg);
SD_EVT_IRQHandler();
return 0;
}

static int sd_irq_init(void)
{
IRQ_CONNECT(SD_EVT_IRQn, 4, isr_handler, NULL, 0);
IRQ_DIRECT_CONNECT(SD_EVT_IRQn, 4, sd_direct_isr, 0);
irq_enable(SD_EVT_IRQn);

return 0;
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ manifest:
projects:
- name: nrf
repo-path: sdk-nrf
revision: f0af8f2008d39bcb46516554d00611ac7fd87d5d
revision: pull/24966/head
import:
name-allowlist:
- cmsis_6
Expand Down
Loading