I have coded an LPC54608 application which includes a composite USB HS device (dual CDC) running on FreeRTOS, based upon the code provided in the SDK example (lpcxpresso54608_dev_composite_cdc_vcom_cdc_vcom_freertos), from SDK version 2.5.0. The code appears to work correctly most of the time, but when I carried out a more extensive testing I have found that the data in vcomInstance->currRecvBuf occasionally gets corrupted.
The USB_DeviceCdcVcomCallback() and the USB_DeviceCdcVcomTask() are called as expected, so the SDK code ‘appears’ to the working, but the data in the buffer is not always what I have sent. To confirm that the data is being sent correctly I added a CRC to my applications packet handling layer which confirms that I am indeed receiving USB data packets which occasionally contain invalid data.
I know the USB standard includes a CRC check at a lower layer for all data transfers, so only valid packets should be accepted by the USB peripheral device. Therefore, I can only presume that this data corruption is happening while the data is being passed from the USB controller up the SDK USB stack.
As I have mentioned this corruption only happens occasionally, less than 1% of data packets are affected, but absolutely no data corruption is allowed for my application. Due to the infrequent nature of the problem I have not been able to correlate the occurrence of the data corruption with any other USB events.
Just wondering if anyone else has seen this problem or can help me to resolve the root cause?