Page 1 of 1
Other USB_CONNECT pin on STM32F4xx
Posted: Wed Mar 11, 2020 2:02 pm
by mrguen
Could someone tell me if it would be possible to modify the pin used for USB_CONNECT. The pin used on the STM32F401RC board I am using is PD2 but I would be using this pin that is also SDIO_CMD to communicate with an SD CARD. So I would like to change it.
Re: Other USB_CONNECT pin on STM32F4xx
Posted: Wed Mar 11, 2020 2:36 pm
by stas2z
Usb device mode doesn't require any "usb_connect" pins, only dm/dp (pa11/12) and gnd, so u can use pd2 without any problems
Re: Other USB_CONNECT pin on STM32F4xx
Posted: Wed Mar 11, 2020 2:44 pm
by fpiSTM
I
guess you use the STM32 core...
USB_CONNECT is not part of the code, I guess you want change the
USB_DISC_PIN defined here:
https://github.com/stm32duino/Arduino_C ... ant.h#L129
If your board is not the CoreBoard_F401RC then it is not defined per default. So you can use the generic F401RC variant and defined the one you want thanks build_opt.h or hal_confextra.h.
Else this is normal it is defined as the schematics said and so no way to redefine it as it is wired for USB.

- CoreBoardF401_USB_CONNECT.png (2.41 KiB) Viewed 16037 times
Anyway if you don't use USB I guess you can use it for other thing without any issue.
Re: Other USB_CONNECT pin on STM32F4xx
Posted: Wed Mar 11, 2020 5:10 pm
by mrguen
Thanks. I will try with another pin.
Re: Other USB_CONNECT pin on STM32F4xx
Posted: Fri Jun 23, 2023 1:31 am
by donna1205
It is part of the USB interface circuitry on the microcontroller. By properly configuring this pin, you can enable USB communication and data transfer between the microcontroller and a connected USB device, such as a computer.
Re: Other USB_CONNECT pin on STM32F4xx
Posted: Tue Sep 12, 2023 4:23 am
by horaortiz
With pd2, you can utilize USB device mode without worrying about the extra "usb_connect" pins; all you need are dm/dp (pa11/12) and gnd.