Other Parts Discussed in Thread: EK-TM4C1294XL
Tool/software: TI-RTOS
I've been scratching my head as to why a buffered USB write behaves oddly when I put USBBuffer in front of my USBCDC implementation until I started looking at the code in usbbuffer.c in usblib. As it turns out, while the buffer implementation there accounts for rollover of the index, it doesn't account for overflow....like at all. Maybe I just missed it, but I can't find any references to overflow in the file. Maybe I'm missing something, but this seems like a huge oversight for a buffer implementation.
I would have expected to see at least a callback with an event indicating a buffer overflow so the application can log it and flush the buffer because here's the thing, once you overflow the buffer implementation in usblib, it doesn't seem to ever recover without explicitly calling the flushing function. The application would never no since no event/callback is triggered when this happens.