From fd4f3eb7c32c992af064c3c633c72f0e848f20e9 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Thu, 13 Jun 2019 15:38:31 +0200 Subject: [PATCH] drivers/nrf51: 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/nrf51/src/ble_hw.c | 2 ++ nimble/drivers/nrf51/src/ble_phy.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/nimble/drivers/nrf51/src/ble_hw.c b/nimble/drivers/nrf51/src/ble_hw.c index 59bd46f83..c371af813 100644 --- a/nimble/drivers/nrf51/src/ble_hw.c +++ b/nimble/drivers/nrf51/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/nrf51/src/ble_phy.c b/nimble/drivers/nrf51/src/ble_phy.c index eac60f6d8..2ed81e973 100644 --- a/nimble/drivers/nrf51/src/ble_phy.c +++ b/nimble/drivers/nrf51/src/ble_phy.c @@ -908,7 +908,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