This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to make the IRQn available in the ble_app_uart application?

Hello,

I just want to add SPI master module into the ble_app_uart application, and only add spi_master.c and .h into this project with no any other change, and just call the initial function. But, error, NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE, returns when the spi_master_open() called, exactly returned by APP_ERROR_CHECK(sd_nvic_ClearPendingIRQ(p_spi_instance->irq_type)). The irq_type is 0x00000003 which standby for SPI0_TWI0_IRQn. The SPI number I used is SPI 0. The instruction shows that this error means for this IRQn is not available in this ble app uart application, how to correct it?

Thanks.

Parents
  • Hi

    Try to initialize the SPI library after you have initialized the softdevice. I suspect that this is the issue. The sd_nvic_ClearPendingIRQ is a softdevice function which calls the softdevice API, and the softdevice needs to be enabled in order the call to work. However, in the spi_master.c example, the nrf_soc.h file is different (since it is an example not for BLE) and does not contain softdevice API functions.

    Update 17.2.2015 I tried this with SDK 6.0.0 and I can not reproduce this issue. I get the results that RK predicted actually, that when I initialize the SPI before enabling the softdevice, I got the error NRF_ERROR_SOFTDEVICE_NOT_ENABLED when calling sd_nvic_ClearPendingIRQ. But if I initialize the SPI after enabling the softdevice, everything runs smoothly. I include my test code.

    ble_app_uart_with_spi_master.zip

  • That was my first thought when I read this question, however the poster says he gets error NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE (0x2001). If the softdevice were not enabled would he not get NRF_ERROR_SOFTDEVICE_NOT_ENABLED (0x0002)? I thought if the softdevice were not enabled then any call to an sd_ function gave you that generic error, is that wrong?

Reply Children
No Data
Related