Bluefruit nrf52 - any way to find if soft device was "busy" (i.e. blocking app code)

Hi all,

Im using a bluefruit nRF52 with arduino framework, and using bluefruit library. its connected to the bluefruit connect app, but also acting as an SPI slave from another device (an stm32).

I'm having to bit-bang the spi as the arduino SPI library wont work as a slave (for nordic nrf52 devices), and using a gpio FROM the nRF52 to tell the stm32 im ready to receive spi (normally 5 to 10 bytes), after it detects SPI nCS assertion. To bitbang the spi data, i'm then waiting on an interrupt on rising edge SPI CLK, at which point clock in the MOSI data.

its mostly working except the odd message (1 in 5ish full transfers) gets missed. ive traced this to one spi clk interrupt being missed during the transfer. (each transfer is 10 bytes).

as the nrf52 softdevice has higher priority than any user code, including interrupt handlers - im wondering if the irq is being missed because it happens during a period where the softdevice is in control. which is asynchronous.

so im wondering if i wait until soft device takes control, then wait till its done, then i signal that im ready to receive over spi, that will give me the best chance to receive a full message.

does anyone know if there's a way that i can poll some flag / variable / register to know if the softdevice has just been busy?

many thanks,
Michael.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.