My Nordic device (nRF52833, using SDK 2.1.2) is a peripheral.
I need to periodically transfer to it large amount of data from central device over connectable Nordic UART Service.
I perform this data transfer in batches of 16 packets, 128 bytes each (due to max payload limitation of 170).
After each batch of 16, peripheral sends XOFF packet, which causes central to wait, so that peripheral can write the data to SPI flash.
After write to flash is complete, peripheral sends XON packet, and transfer resumes.
Very basic flow control.
That works for the most part, but occasionally, Nordic device throws an error
I tried to introduce a small delay between individual packets within batch of 16, but that doesn't solve the problem.
I found an SDK's Zephyr BT code where this message is printed, but not sure what to make of it
Would appreciate any insights to what might be causing it and how to avoid it.
My code recovers form this failure on application level, but it affects performance and I'd rather solve it properly