@Alex-Kushleyev and @Eric-Katzfey apologies for the delay in my response. I've just picked this up again after the winter break and have some updates.
"Can you please clarify how the data is batched when the byte loss happens - how many bytes are sent without a break?" - During runtime of this application, it is difficult to tell for sure but it looks like when sending data of ~170 bytes, data was getting dropped. As it wasn't very clear what was triggering the dropouts, I ended up setting up a test application described below.
I created a Uart loop-back module running on the DSP (any data read is immediately written out the same uart). This module was running (really polling the UART RX) at 2 kHz. I also made an application on the microcontroller (communicating with the DSP over the UART) that sends a fixed block of data, sleeps and then repeats this for 10 seconds. With this I performed some testing trying to find when the data begins to drop.
I am left with the impression that there are 3 factors contributing to the dropouts:
- Volume of data sent without a break
- Delay between each data block
- Load on the DSP processor
Based on the loop-back test, it looked like the maximum bandwidth I could get was by sending packets of 225 bytes with a delay of ~3ms in between. This results in about ~76300 bytes/s getting transmitted and reliably looped back.
Unfortunately, applying that to my application didn't fix the issue. I believe the real-world use causes there to be a higher system load and this in turn contributed to more data dropouts.
I ended up settling on a maximum of 75 bytes but with a delay of ~1.5ms. This then results in an upper limit of ~50000 bytes/s. I am still getting dropouts but they are infrequent and acceptable for this particular use-case. Note: I don't need 50000 bytes/s but I am interested in keeping buffered data minimized so sending in larger blocks is preferable.
It would be really great to understand how the data is handled in the lower level on the DSP. If there was DMA in place, I would expect no dropouts (or maybe more consistency in the dropouts).
Thanks for your help on this.