I recently bought myself one of ST’s cheap Nucleo development boards with an STM32F072RB controller on it to quickly start developing one of my projects. The microcontroller has native USB support even without an external clock which makes it quite attractive.
The downside is that this board does not come with a USB connector that can be used by the controller itself. The USB connector on it is already used by ST’s own programmer (ST-Link). You could of course rewire the port to the microcontroller directly – but then you would lose the connection to the ST-Link and had to connect an external programmer.
So I came up with another solution: I just glued a straight (180°) THT mini USB connector to the bottom side of the board and wired the USB-D- pin to PA11 and USB-D+ pin to PA12. Luckily both pins are not already used on the board and are easily accessible since they are routed to pin headers. USB GND (and shield) must also be connected to GND. You can see the little hack in the following picture. The same hack can probably be done with all Nucleo boards that provide a controller with USB support. Maybe someone finds this useful. 😉

Happy hacking,
André
Hello. Why do not require connected vcc+?
Hi Zhenya,
the connection to +5V of USB is not needed in my case because I supply the board separately using the other USB connector (ST-Link).
Technically you are not required to connect pin 1 of the USB connector (that is if you don’t need the 5V).
Kind regards,
André
Can I connect to the Nucleo-f072rb usb gsm modem? I must connect 5V?
This will not work. The STM32F072 device has a USB device interface, not a USB host interface.
Your modem is already a device so there is no way to connect two USB devices together.
It needs a host interface (e.g. a PC, Raspberry Pi, etc.).
Is arm controller with host interface?
I have to use these devices STM32F105xx, STM32F107xx, STM32F2xx and STM32F4xx with OTG?
Yes, that could work. But keep in mind that you must write a USB device driver for your modem. This is probably not an easy task.
At commands not help with this? Which layer I must write?
Sorry, I cannot help you with this. I have never done anything with the USB host interface or with a GSM modem as USB device. This is also out of scope of this article.
Thank you. You help me.
Hi André,
Hope you can help me out! Did you use an IDE? If so, which IDE did you use? Did you by any chance use mbed? If so, which library, because all the libraries I found, were without the F072RB target. Any chance of sharing your code?
Thanks in advance!
Hi,
the IDE I am using is just plain Eclipse in combination with the GNU ARM toolchain. I don’t use any libraries expect for ST’s standard peripheral library. You can find a good starting point in ST’s standard peripheral library which also includes some USB examples like the Virtual Comport implementation.
Kind regards,
André
I’ve just picked up one of these boards to build a canable/cantact usb2canbus adapter and was shocked to not see a device usb port or even the pads to add one, especially with it being one of the main selling points of this chip.
Thanks for the photo this has given me some ideas!
Same here, this article helps save time with the usb connection!
Thanks!
Thank you I was trying for a week to figure out why my pc is not recognizing my nucleo board as audio device haha