cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103 USB circuit

Mohammad A
Senior
Posted on May 31, 2017 at 23:17

I am trying to make usb operate in STM32F103 but it seems doing so is a lot different than usb fs in STM32F4 series.

In F4 series it was just enough to connect usb connector to Data pins and MCU would take care of other parts. But in F103 series it is required to pull-up D+ with a resistor and also it is required to handle this pullup in different situations. From what I can find in the schematics of STLink, there is pin (USB_RENUMn) controlling this pullup resistor

https://i.stack.imgur.com/tgpRh.jpg

Does anybody know how to handle this pull up resistor? I could not find out what to do with this USB_RENUMn thing.

You guys have any idea?

usb stm32f103

1 ACCEPTED SOLUTION

Accepted Solutions
Mohammad A
Senior
Posted on June 02, 2017 at 20:08

Found the answer. It is mandatory to pull up D+ to

3.3V

using a 1.5Kb Resistor, in this series probably. Other series such as F4xx have internal pull up resistor but this series require external pull up. using a bjt to control this pull up is useful in case of soft resetting USB.

My mistake was pulling up to 5V instead of 3.3V . I think this is required to mention this issue in the datasheet or refrence manual of this chip.

View solution in original post

7 REPLIES 7
Mohammad A
Senior
Posted on June 02, 2017 at 20:08

Found the answer. It is mandatory to pull up D+ to

3.3V

using a 1.5Kb Resistor, in this series probably. Other series such as F4xx have internal pull up resistor but this series require external pull up. using a bjt to control this pull up is useful in case of soft resetting USB.

My mistake was pulling up to 5V instead of 3.3V . I think this is required to mention this issue in the datasheet or refrence manual of this chip.

Khouloud GARSI
Lead II
Posted on June 09, 2017 at 16:27

Hi

Amj.Mohammad_H

,

It's mandatory to pull up the the USB_DP pin with a 1.5KΩ resistor to a 3.0 to 3.6 voltage range.

This is already indicated on the datasheet as a note below table ''USB DC electrical characteristics'' (USB characteritics section):

0690X00000607JAQAY.png

Khouloud.

how is (USB_RENUMn) pin controlling this pullup resistor?

how is (USB_RENUMn) pin controlling this pullup resistor?

NNAMK.1
Associate II

how is (USB_RENUMn) pin controlling this pullup resistor? Is it on when it is reseting ?

NNAMK.1
Associate II

if it is +Vdc pull-up, why it needs to be controlled ?

You only need it if you want to re-enumerate the device on USB without physically removing the plug from the PC and re-inserting it. Also I suppose if you have different product scenarios where USB is not used. There are many examples of F103 circuits out there showing how the pullup resistor can be manually managed (and many that don't allow this such as the infamous Blue Pill). I am using an Olimex P103 board at the moment and the schematics for this board have what they call a DISC pin which disconnects the USB pullup under program control.

https://www.olimex.com/Products/ARM/ST/STM32-P405/resources/STM32-P103_P405_sch.pdf

There are simpler schemes out there that use another MCU pin in place of the transistor circuit. I have not tried that myself, but would be interested to see success stories going that route.