2017-02-03 12:31 AM
I use ''USB Device'' on STM.
My STM32F401 has USB OTG so it means that it can pull up USB_FS_DP data line without pull up resistor .
But I can't find a way how to do it, please help me
2017-02-03 05:49 AM
Hi
Chuev.Vladimir
,By default, the USB selected pins will be configured as following (in USB_FS configuration wizard):
Select the pin for which the configuration hasto be updated (if this is really needed) then make the modifications you want.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2017-02-06 01:42 AM
Hi.
I've already tried this way, he didn't give any results.2017-10-04 04:36 AM
Please note that STM32Cube HAL library does not support OTG mode, but only Host or Device modes.
In device mode, changing the USB_OTG_FS_DP pin settings to pull-up mode should update the stm32cubef4xx_hal_msp.c file with the following code:
void HAL_PCD_MspInit(PCD_HandleTypeDef* hpcd){
....
GPIO_InitStruct.Pin = GPIO_PIN_12;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);...
}
2017-10-04 07:05 AM
But that does not set the proper USB pullup... The GPIO pullup is nominally 40kOhm; the USB pullup is lower and as implemented on silicon it's composed of two resistors and a switch, see 22.3.2 Full-speed OTG PHY in RM0368. It is controlled from the USB core and switches on when device mode is selected, either through the OTG mechanisms, or if device mode is forced by setting OTG_FS_GUSBCFG.FDMOD then by the VUSB detection input, potentially overriden by OTG_FS_GCCFG.NOVBUSSENS
JW