2023-08-19 03:59 AM
Hi, I'm working on a modified CDC USB device in full-speed mode (STM32WB55, with STM Cube 1.9.0). I modified it to be a CCID class device.
The issue I'm having is that when I send data of length 50 (51, 52, 242,243,244, 247,248,249), it just fails and crashes the USB port.
After trying to find the source of the problem. I have found that the length of data returned passed to my CCID code is the wrong length.
I've pinpointed that the USBD_LL_getrxdatasize function is returning the wrong length or gets corrupted somewhere (when it fails it returns something like 50000 bytes and that's what probably crashes the device).
Any help would be appreciated
2024-05-16 01:54 AM
Fixed it. There was an offset in the code that strips the header. For CCID, the header is 10 bytes while in the code it was set to 7 bytes. Which resulted in this anomaly