From 1dfda9db14ed72b9050ca607450d0c8fc9f927e0 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Thu, 13 Jun 2019 15:40:36 +0200 Subject: [PATCH] drivers/nrf52: do not set IRQ prio for RIOT RIOT does not allow for nested interrupts and initializes all IRQs to the same priority during system initialization. Assigning different priorities in the driver leads to system crashes. --- nimble/drivers/nrf52/src/ble_hw.c | 2 ++ nimble/drivers/nrf52/src/ble_phy.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/nimble/drivers/nrf52/src/ble_hw.c b/nimble/drivers/nrf52/src/ble_hw.c index 07297a21c..f084ff15e 100644 --- a/nimble/drivers/nrf52/src/ble_hw.c +++ b/nimble/drivers/nrf52/src/ble_hw.c @@ -319,7 +319,9 @@ ble_hw_rng_init(ble_rng_isr_cb_t cb, int bias) /* If we were passed a function pointer we need to enable the interrupt */ if (cb != NULL) { +#ifndef RIOT_VERSION NVIC_SetPriority(RNG_IRQn, (1 << __NVIC_PRIO_BITS) - 1); +#endif #if MYNEWT NVIC_SetVector(RNG_IRQn, (uint32_t)ble_rng_isr); #else diff --git a/nimble/drivers/nrf52/src/ble_phy.c b/nimble/drivers/nrf52/src/ble_phy.c index b36e502c0..e8e69780a 100644 --- a/nimble/drivers/nrf52/src/ble_phy.c +++ b/nimble/drivers/nrf52/src/ble_phy.c @@ -1440,7 +1440,9 @@ ble_phy_init(void) NRF_PPI->CH[5].TEP = (uint32_t)&(NRF_RADIO->TASKS_DISABLE); /* Set isr in vector table and enable interrupt */ +#ifndef RIOT_VERSION NVIC_SetPriority(RADIO_IRQn, 0); +#endif #if MYNEWT NVIC_SetVector(RADIO_IRQn, (uint32_t)ble_phy_isr); #else