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

Incomplete transfers in SPIS and other strange behaviors

I have an existing product to which I need to add SPI to get Wifi compatibility. Basically the Nrf52 is acting as central and passes BLE events on to an ESP32 with Arduino to send it to Wifi.

I am using the SPIS example from SDK 15.0.0 and use the Arduino as a master.

However the transmissions are randomly truncated (the first byte always transfers correctly, then there are some DEF characters and the transmission may restart within the same block.

Here is an excerpt of what the output looks like on the Arduino:

No⸮⸮⸮⸮
Nordic
No⸮⸮⸮⸮
N⸮⸮⸮⸮⸮
Nordic
Nordic
Nordic
Nordic
N⸮⸮⸮⸮⸮
N⸮⸮⸮⸮⸮
N⸮⸮⸮No
Nordic
⸮⸮⸮⸮⸮⸮
⸮⸮⸮⸮⸮⸮

I already enabled the SPIS_NRF52_ANOMALY_109_WORKAROUND but that does not change anything.

I noticed some strange anomalies in the debugger (but I am not entirely sure those are real):

1. the breakpoint on    

 spis_xfer_done = true;

is triggered even though the event.evt_type is shown as NRFX_SPIS_BUFFERS_SET_DONE in the debugger.

Moreover, if I check the call stack it appears as if the library is actually calling the event handler with a pointer to the event, and does not pass by value as the function declaration is shown.

Is it possible that there is some mismatch between libraries / header files/. examples in SDK 15? I tried to compile the example from SDK 13 and it behaves the same.

I need some help since I am stuck at this bizarre issue and have a deadline coming up soon.

Thanks

Johannes

Related