Hi. I am using nrf52840 with Softdevice 16.0.0 + BLE_uart_peripheral.
The SPI master transmits 2 SPI packets every 10 ms. At the the SPIS event handler, I call ble_nus_data_send() to send the SPI packet out.
However, I found the first couple bytes of the second packet are quite often be zero or lost. But as far as I disconnected the bluetooth to the central, the packets are fine.
I put a GPIO lines before and after the ble_nus_data_send() to tell the master hold the spi transmission but the problem still there.
However, I found if I added 1 ms between the spi cs line low and start the first byte, and also 1 ms after cs line goes high, the chances to get a corrupted spi packet is significantly reduced.
I think it might be the issue similar to this post:
I preferred the GPIO solution mentioned in the post rather than the time delay.
Could you help to the GPIO in the right position?