cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F042 USB does not work.

re.wolff9
Senior
Posted on March 28, 2015 at 19:49

Hi, 

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?

2 REPLIES 2
petr239955
Associate III
Posted on March 28, 2015 at 23:03

Look at this

https://my.st.com/edc25f20

re.wolff9
Senior
Posted on March 29, 2015 at 10:29

Bingo!

But in the mean time, I've found a bug in the silicon: The USB pullup works with or without the remap.