2025-11-23 3:04 PM - last edited on 2025-11-24 2:21 AM by Andrew Neil
My nucleo f303re board was connected via USB but I was using a resistor around 2.2kohms to 5V. This was fine though and it functioned as normal but when I disconnected the pins on the MCU to move it, reconnecting it back resulted in nothing. While troubleshooting, I realised that if I connected the USB cables to the MCU's usb pins, device manager was showing an unknown usb device even without any resistors in place. This did not happen before while it was working and I realised this was due to PA12, DP, which was the pin pulled high, is now constantly at 2V when the MCU powered on. Now I am not sure if this is normal but I am quite confident in saying that this is not normal and is the reason this is not working anymore. If it's helpful, I know PA12 is at 2v because I measured this with a multimeter.
I suspect that whatever I had done cause damage to PA12 and the usb board is fried. Is this theory wrong or is there no hope for this board. Perhaps there is a way to use other pins for the usb?
Solved! Go to Solution.
2025-11-28 4:15 PM
If it doesn't toggle between 0 V and 3.3 V when initialized as a GPIO output, I would say the board is damaged and USB is unlikely to work correctly.
If the pin permanently 1.9+ V, Windows is likely interpreting this as if the line was pulled up and trying to enumerate it.
2025-11-23 5:08 PM - edited 2025-11-24 10:22 AM
This board only has one USB port which is connected to the onboard st-link, not the STM32F303 chip on the board. I understand you've added a secondary USB connector pigtailed to the PA11/PA12 pins?
> I was using a resistor around 2.2kohms to 5V
Why? The PA11/PA12 USB pins don't need an external pullup and certainly not to 5 V.
There are no alternative pins for USB.
If you initialize PA12 as a GPIO output and toggle it, does it toggle between 0 V and 3.3 V? Toggle an LED at the same time so you know the code is running. If not, chip is probably dead.
2025-11-24 9:13 AM
The f303 doesn't have an internal pullup so you have to have an external one. But I will see if I can still use the PA12 as an output.
2025-11-24 10:21 AM - edited 2025-11-24 11:05 AM
> The f303 doesn't have an internal pullup so you have to have an external one.
Thanks for the correction, you are right here (although you were using the wrong resistor value and voltage which could have led to damage).
Introduction to USB hardware and PCB guidelines using STM32 MCUs - Application note
2025-11-25 8:19 PM
Hi,
PA12 on F303 is a 5 V tolerant I/O (FT) in the datasheet, you may check if it still works in normal GPIO mode. DP is only on PA12 of F303, it seems no other choice.
B.R.
2025-11-28 3:09 PM
I have finally come around to testing it and it does in deed toggle an LED but it switches between roughly 1.9V-2.1V. I think this is good news right? If it can still toggle an LED does it necessarily mean that USB will still work?
It is still really odd that connecting the USB dp and dm directly to the board detects in device manager as an unknown usb device as when this was working, it did not do that without any resistor in place.
2025-11-28 4:15 PM
If it doesn't toggle between 0 V and 3.3 V when initialized as a GPIO output, I would say the board is damaged and USB is unlikely to work correctly.
If the pin permanently 1.9+ V, Windows is likely interpreting this as if the line was pulled up and trying to enumerate it.