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

nrf51822 UART tx interrupt not firing, arbitrarily when soft device is enabled.

Hi,

I've written an app on the nrf51822 (rev2), with S110 (v7.3.0) and SDK v6.1.0. I've written a custom non-blocking UART driver. I'm running into an issue where the UART TX interrupt arbitrarily decides not to fire. ie,

NRF_UART0->TXD.AsWord32 = byte;

Does not always result in a tx interrupt. 99.9% of the time it will, though all of a sudden it will stop for a period of time. It's seams like something is clearing the tx interrupt enable bit?

This problem ONLY happens when the softdevice is enabled. I CANNOT repeat the problem when the BLE SD isn't running.

To test my application wasn't causing the issue, I went back to the ble_app_hrs example from the SDK and ported my serial driver to the project. So nothing but the hrs app and my serial driver is present. The problem persists, again, only when the SD stack is running.

Any ideas?

Cheers, Sam

Parents
  • Except for the peripherals that are reserved/restricted, the SoftDevice should not touch anything else. What could be happening is that you call a form of WFE (e.g. sd_app_evt_wait()) right when the interrupt triggers, also from a higher (i.e. lower numbered) priority than the UART interrupt. The call will then immediately return, but also clear the pending bit. If you then WFE again, without servicing the interrupt, you will not be woken up again from it.

Reply
  • Except for the peripherals that are reserved/restricted, the SoftDevice should not touch anything else. What could be happening is that you call a form of WFE (e.g. sd_app_evt_wait()) right when the interrupt triggers, also from a higher (i.e. lower numbered) priority than the UART interrupt. The call will then immediately return, but also clear the pending bit. If you then WFE again, without servicing the interrupt, you will not be woken up again from it.

Children
No Data
Related