cancel
Showing results for 
Search instead for 
Did you mean: 

To what voltage should the D+ line be pulled up when designing USB connection in STM32? +5V or +3.3V? All documentation and dev board scematics says it's 3.3V, but it didn't work.

AksultanK
Associate II

Hello everyone, I have been learning to work with USB connection in STM32 and while my research I've noticed that some schematics have D+ line pulled up to +5V, when in stm32 dev board schematics and in AN4879 it's pulled up to 3.3V and that's what I did when designing my own board (below schematics from AN4879 and Dicovery VL dev board, I did the same thing). But it didn't work, then I resoldered the D+ line and pulled it up to 5V. After that USB started working and I can write to VCP now. Please could someone clarify this issue and tell me what I've missed?

EDIT: forgot to attach pictures0693W000008G5wdQAC.png0693W000008G5wYQAS.png

2 REPLIES 2
MM..1
Chief II

FYI

Speed Identification

A USB device must indicate its speed by pulling either the D+ or D- line high to 3.3 volts. A full speed device, pictured below will use a pull up resistor attached to D+ to specify itself as a full speed device. These pull up resistors at the device end will also be used by the host or hub to detect the presence of a device connected to its port. Without a pull up resistor, USB assumes there is nothing connected to the bus. Some devices have this resistor built into its silicon, which can be turned on and off under firmware control, others require an external resistor.

For example Philips Semiconductor has a SoftConnectTM technology. When first connected to the bus, this allows the microcontroller to initialise the USB function device before it enables the pull up speed identification resistor, indicating a device is attached to the bus. If the pull up resistor was connected to Vbus, then this would indicate a device has been connected to the bus as soon as the plug is inserted. The host may then attempt to reset the device and ask for a descriptor when the microprocessor hasn’t even started to initialise the usb function device.

AksultanK
Associate II

This means everything is correct hardware wise. But then how to initialise USB VCP properly in this case? I've found couple of similar questions here, but none of them had an answer. Do you have an example?