-
Notifications
You must be signed in to change notification settings - Fork 36
Description
If the USB device is polled periodically, the STM32F407 fails to enumerate. To recreate, use the following example:
https://github.com/stm32-rs/stm32f4xx-hal/blob/master/examples/usb_serial.rs and update the loop as follows:
let cp = cortex_m::Peripherals::take().unwrap();
let mut delay = stm32f4xx_hal::delay::Delay::new(cp.SYST, clocks);
loop {
delay.delay_ms(1u8);
// ... rest
}A wireshark capture of the USB transactions with the device give some insight as to what is happening:

The first BOS descriptor request gets no response. The following 2 requests do get a response. However, then the first DEVICE_QUALIFIER descriptor gets a malformed packet as a response. Analysis of this packet seems to indicate that this is actually a BOS descriptor response from earlier.
This seems to indicate that the descriptor responses are offset by 1 improperly. It is unclear why the first BOS descriptor response fails, but initial debugging indicates it may be an improper ControlState setting. I'm still investigating root cause here.