AnsweredAssumed Answered

STM32F429 OTG_HS overwrites pinfunction in embedded PHY Mode

Question asked by vester.bjoern.001 on Jul 29, 2016
Latest reply on Aug 2, 2016 by kugler.daniel
Dear all,
we just encountered a problem with a STM32F429NI based hardware. We are using USB_OTG_HS in full speed mode with the integrated PHY, while using PB13 as a digital input.
At first PB13 behaves normal with internal pullup on a button and I can measure 3,3V on the IO. After initialization of the USB as virtual com port (init code generated by Cube MX), PB13 provides a constant voltage of 1,1V and cannot read another value than 0 on IDR Register. Debugging the application, I verified, that MODER register is set to input (00) for PB13, however after running over the lowlevel init of USB, the pin becomes unresponsive. It seems like the routine is activating OTG_HS_ULPI_D6 without changing the MODER to alternative function. I can only explain the 1,1V as a mid-termination voltage when both pullup and pulldown are active on the port. It is externally connected to a dip switch, so there is no load on the line, as long as the switch stays off.
This is the code snippet, that results in the wrong behaviour, it is in USBD_StatusTypeDef  USBD_LL_Init (USBD_HandleTypeDef *pdev) of ST's USB Driver middleware and called by MX_USB_DEVICE_Init, generated by CubeMX:

hpcd_USB_OTG_HS.Instance = USB_OTG_HS;
hpcd_USB_OTG_HS.Init.dev_endpoints = 11;
hpcd_USB_OTG_HS.Init.speed = PCD_SPEED_FULL;
hpcd_USB_OTG_HS.Init.dma_enable = ENABLE;
hpcd_USB_OTG_HS.Init.ep0_mps = DEP0CTL_MPS_64;
hpcd_USB_OTG_HS.Init.phy_itface = USB_OTG_EMBEDDED_PHY;
hpcd_USB_OTG_HS.Init.Sof_enable = DISABLE;
hpcd_USB_OTG_HS.Init.low_power_enable = DISABLE;
hpcd_USB_OTG_HS.Init.lpm_enable = DISABLE;
hpcd_USB_OTG_HS.Init.vbus_sensing_enable = DISABLE;
hpcd_USB_OTG_HS.Init.use_dedicated_ep1 = DISABLE;
hpcd_USB_OTG_HS.Init.use_external_vbus = DISABLE;

Can anybody reproduce this problem? Is there a workaround to retain normal pin function, or might it be an error in the HAL or even silicon?