AnsweredAssumed Answered

STM32CubeMX Custom HID shifted/corrupted contents of USB Device RX/TX Buffer

Question asked by Louie Francis Ouano on Mar 16, 2018

I'm quite new to USB and have been trying to make a custom HID using STM32CubeMX. I'm using the STM32L433 Nucleo 64 board and this is connected to the Windows PC with a custom application running. I was able to transmit and receive the 64 byte packets but sometimes when I restart my custom application while the USB is still connected, I am able to receive packets that are somehow shifted from the start of my buffer. The image below is a capture of the packets I received:

 

 

The first 8 lines are my expected packets, the remaining lines where it starts with "0" are the shifted packets(note the "3" and "7" near the end seems to be the start of my expected packets would be). I see the same problem when transmitting packets as well(i.e., data I received in my PC application is shifted).

 

Here are my environment details:

1. STM32CubeMX version 4.24

2. STM32Cube_FW_L4_V1.11.0 library

 

Does anyone here have the same problem? 

 

Thanks.

Outcomes