AnsweredAssumed Answered

STM32F042 USB does not work.

Question asked by wolff.roger on Mar 28, 2015
Latest reply on Mar 29, 2015 by wolff.roger
I have an application that works on an STM32F072R. It uses ChibiOS. Then I built a board with an STM32F042F, and now it doesn't work. I thought I could "test" the software on the '072, and then deploy on the '42, but it seems it is more difficult than that. 

The support for "042 processors in chibios has not been "well tested". Some of the '042's defines were in the wrong section,t hereby never activating the USB support. But with that fixed, it still doesn't work. Of course there is the option that I'm missing something. 

So now, as a "last resort", I've compiled my code for the '72, but implementing just a small patch: disable GPIOD. This compiles and works on the '72, and it fails in exactly the same way as the '42. 

So far I've traced the code, that I see it do "sensible things" and then expects to get an interrupt. But on the '42 it doesn't. RCC has the clock enabled, NVIC has the interrupt enabled. The control register with the interrupt enables in the USB module are identical. 

Somehow, there must be a difference between the '42 and the '72. 

I've considered that I might have hooked the USB pins to the usb connector up wrong. But I haven't: When powering up a blank chip, I get the bootloader on USB. So the hardware works.

What else could be different? the bus-power-pin (VBUSSENSE). Well I have not implemented that on either the '72 or the '42 board. That's the same.  

The interrupt status register on the '42 simply indicates that it doesn't want any attention. 

The host PC detects a "new USB device".  so the D+ line is being pulled up. But the hosts' configuration attempts are being ignored on the basis of no interrupts happening inside the '42. 

Suggestions on differences between the two chips? Suggestions on what else to look at?