cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F042 usb device fails

Laurence Blaxter
Associate II
Posted on October 20, 2017 at 18:51

Hi, I'm attempting to make a usb audio device using an stm32f042. I have managed to prototype the same basic concept using an F4 discovery, but the same code (with some changes and new CubeMX autogenerated parts) fails on F042.

The failure occurs soon after the device is connected to PC, during enumeration. The PC tries to set configuration 1, and the device replies with error.

I have attached a screenshot from a usb analyser. Can anyone advise where to look?

2 REPLIES 2
Laurence Blaxter
Associate II
Posted on October 23, 2017 at 15:43

ok an update: the configuration is actually set correctly, but the following transactions give an error.

I've tried debugging the device and it seems that device class functions such as USBD_AUDIO_Init are never called, but USBD_RegisterClass(&hUsbDeviceFS, &USBD_AUDIO); is called.

I'm out of ideas at this point and would appreciate any ideas for where to look (even if they are completely random!)

Same code works fine on F4discovery.

Laurence Blaxter
Associate II
Posted on October 23, 2017 at 15:45

just a note - when I say following transactions I mean the ones in the original screenshot. The screenshot is from vusb-analyzer, which seems to have the wrong endianess so sees configuration 1 as 256.