2021-04-01 05:58 AM
Hi,
I'm not sure what is going on exactly, but I think there is either an issue with the HAL or the USB windows driver for STM32 CDC.
I am using an STM32L072KBU, STM32Cube MCU Package 1.17.0.
I wait until the device is enumerated (by checking the dev_State in the device handle), send a byte to the STM32 over USB to allow the STM32 to begin sending 4-byte packets every 5 seconds.
I noticed that the STM32 stopped sending packets, and I narrowed this down to TxState never being cleared. (It is set to 1 in USBD_CDC_TransmitPacket, and should be cleared by USBD_CDC_DataIn).
I connected by Saleae Logic8 Pro to the USB lines, and noticed that I get either an error packet or a CRC failure as the last packet I send out.
Any ideas??
Thanks in advance
EDIT: I've also attached a Logic2 capture of sending 4 bytes every 5ms (yes milliseconds) now, to help capture as much detail as possible. I am also sending the same 4 bytes out over UART. If anyone looks at the data, I'm pretty sure the USB doesn't send the 4th packet (PuTTY only shows 3 commas [0x2C] in the output)