3
\$\begingroup\$

I would like to use the builtin USB DFU bootloader of STM32F107 chip. My MCU is powered by the device, I don't need to use 5V from the USB.

So far I have connected pins PA11, PA12 and GND directly to a USB cable, but the computer does nothing when I attach the device (I have the BOOT0 pin tied to 3V3).

STM32F107 pin assignments taken from datasheet

When I was studying STM32 bootloader details, I noticed that the bootloader also uses OTG_FS_VBUS pin PA9 - probably to detect connection of USB cable. On the other hand, another guy here uses pin PA10 to do the same thing. Now I am a bit confused.

What pins should I connect to be able to use USB DFU bootloader? Also sometimes there is a pull-up resistor at DP line in schematics from the internet. Is it necessary?

Thank you for your suggestions, have a nice time :) Klasyc

\$\endgroup\$
  • \$\begingroup\$ The USB mode pullup resistor typically is necessary with STM32 parts, as they don't implement this internally. If they are saying it is under software control, then you would connect the high side of it to the GPIO they are controlling, rather than a supply voltage. Without that resistor the PC won't know anything is connected. \$\endgroup\$ – Chris Stratton Jul 27 '16 at 16:19
1
\$\begingroup\$

Can't comment so putting here as an answer. AN2606, page 15 states:

If DFU is used to connect to the bootloader: the USART1_RX (PA10), USART2_RX (PD6) and CAN2_RX (PB5) pins have to be kept at a high or low level and must not be left floating during the detection phase.

Also BOOT1 shall be tied LOW (page 8).

USB DP shall be controlled by MCU - bootloader sets USB DFU Device mode so pullup R should be unnecessary.

\$\endgroup\$
  • \$\begingroup\$ Seems like a fine answer to me, but I think you're referring to some shortened synopsis of AN2606. st.com/content/ccc/resource/technical/document/application_note/… has what you're talking about on page 58!! Can you correct it and provide a link? \$\endgroup\$ – Scott Seidman Jul 27 '16 at 13:11
  • \$\begingroup\$ Thank you, but what about OTG_FS_VBUS line? \$\endgroup\$ – klasyc Jul 27 '16 at 13:44
  • \$\begingroup\$ I used the AN2606 you provided in your original post, there it is page 15 :) The last one is newer (more detailed BTW), so yes now it is under section for chips with date code below 937 (older ones) and for newer ones it is not a requirement anymore. \$\endgroup\$ – Flanker Jul 27 '16 at 13:48
  • \$\begingroup\$ BTW, after DFU selection phase, the bootloader switches to external clock (p 55). I guess you have them? \$\endgroup\$ – Flanker Jul 27 '16 at 13:52
  • \$\begingroup\$ Oh, you need to connect it too. Bootloader checks for HIGH on VBUS (to detect if device is connected to USB HOST or PC in your case). Tie HIGH or connect to USB connector. \$\endgroup\$ – Flanker Jul 27 '16 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.