cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 : USE USB DP and DM as GPIOs?

mario basanta
Associate II
Posted on June 25, 2018 at 05:04

Hello,

I am using an STM32F427 with the ULPI interface for USB communication, since i am not using the USB signals DP and DM for the USB communication, I would like to use those signals as GPIOs. Right now, the problem i have its that everytime i execute the function 'USBD_Initialize(0);', I am not able to use PB14 and PB15 as GPIOs. I already tried to overwrite the Pin configuration without any success. 

Does anyone know if its possible to use these pins as GPIOs (PB14 and PB15), while USB module its running?

Harwdare details:

MCU: STM32F427IG

Package: LQFP 176.

USB Interface: ULPI ( HS USB)

Thanks in advance.

#usb-init #stm32f4
1 REPLY 1
Posted on June 26, 2018 at 10:35

An (yet) undocumented property of the OTG modules is, that as soon as the respective PHY is enabled,

https://community.st.com/0D50X00009XkVvOSAV

.

You don't need the internal PHY if using ULPI, so simply don't enable it (don't enable OTG_xx_GCCFG.PWRDWN). I won't help with finding out how to do that with the 'library'.