Beware of deadlocks when using mBed on the nRF52 (NRF52 SDK when not using the easy DMA)

Hi,

We found a deadlock issue when we trying to use mBed OS on the nRF52. The NRF52 SDK interrupts handling code, when not using the easy DMA, might cause deadlocks that will be hard to find. Take a look at this blog post for more details.

Disclaimer - I’m the VP Product at Jumper. At Jumper, we are streamlining continuous integration and test automation processes for embedded software by through our virtual lab. While working with one of our customers we found this issue and thought it will be highly beneficial for developers that are using mBed OS on the nRF52.

It will be great to hear your thoughts and feedback.

Enjoy!

Yaniv

Hi Yaniv, thanks for finding that issue.

The underlying issue is not in Mbed OS, but in the Nordic SDK unfortunately (that Mbed wraps around)… In the SDK SPI handling code they should have cleared any old interrupts, enabled the new interrupt and then transmit the data. Not the other way around.

It’d be interesting to see if this was already fixed in the Nordic SDK or not… We’ll be updating the SDK version at some point in the near future, but no ETA at this point.

Hi Jan,

Thanks for your response. We’ve also updated Nordic with this issue. Until a fix will be rolled out, we thought that developers using mBed OS on the nRF52 must be aware of this issue.
Hope it will be beneficial for the community.

Best,

Yaniv