2021-04-18 10:18 PM
I have next trouble:
The board was not made by me and there is a suspicion that the series resistors in the D + and D- circuit do not correspond to the datasheet: they cost 10 ohms instead of 22.
Any help please.
2021-04-19 12:18 AM
How is the connected device powered? Is it powered when the problem occurs? Can you switch off/on its VBUS?
Measure voltage on DP/DM. USB host pulls down DP/DM by a nominally 15kOhm resistor; USB host detects connection when the device pulls up one of these line by a nominally 1k5 resistor, so this is easily seen on DP/DM.
JW
2021-04-19 07:07 AM
How is the connected device powered?
-- from self battery - is a smart phone and take a power charge from board STM32 where usb host build
Is it powered when the problem occurs?
-- yes
Can you switch off/on its VBUS?
-- no, the pin PA9 used as UART1_TX
Measure voltage on DP/DM.
-- any condition: connected and not connected - 770-800mV
USB host pulls down DP/DM by a nominally 15kOhm resistor; USB host detects connection when the device pulls up one of these line by a nominally 1k5 resistor, so this is easily seen on DP/DM.
-- i know. I'm try using code with pull-down resistor before USB_Init aka
do {
GPIO_InitTypeDef GPIO_InitStruct;
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_DOWN;
GPIO_Init(GPIOA, &GPIO_InitStruct);
} while(0);
...not working
I get debug log from USB stack.
The success connect (with connected ST-LINK) looking as:
D 17:54:42 USB.cpp#66 USB constructor
D 17:54:42 USB.cpp#72 USB host init
> AndroidAccessory inited..
> Device Disconnected..
DEBUG : --------Start USBH_LL_Init..
--------Start HAL_HCD_Init success..
USBH_LL_DriverVBUS(), state: 1
> ----Handle Host Port Interrupts..
> ----HCD_Port_IRQHandler..
> ---------- (hprt0 & USB_OTG_HPRT_PCDET) == USB_OTG_HPRT_PCDET..
> ---------- (hprt0 & USB_OTG_HPRT_PCSTS) == USB_OTG_HPRT_PCSTS..
DEBUG : > USBH_LL_Connect..
> ----USB connected..
> USB Device connected
> ----Handle Host Port Interrupts..
> ----HCD_Port_IRQHandler..
> ---------- (hprt0 & USB_OTG_HPRT_PENCHNG) == USB_OTG_HPRT_PENCHNG..
> ---------- (hprt0 & USB_OTG_HPRT_PENA) == USB_OTG_HPRT_PENA..
and fail connect strings looking as:
D 17:57:14 USB.cpp#66 USB constructor
D 17:57:14 USB.cpp#72 USB host init
> AndroidAccessory inited..
> Device Disconnected..
DEBUG : --------Start USBH_LL_Init..
--------Start HAL_HCD_Init success..
(... no connection after power on)
(..and tryed to reconnect with button that run pull down resistor code)
USBH_LL_DriverVBUS(), state: 0
> Device Disconnected..
> AndroidAccessory inited..
> Device Disconnected..
DEBUG : --------Start USBH_LL_Init..
--------Start HAL_HCD_Init success..
DEBUG : > ----DPPullDown..
DEBUG : > ----USB GPIO_Pin_12 reset..
> ----Handle Host Port Interrupts..
> ----HCD_Port_IRQHandler..
> ---------- (hprt0 & USB_OTG_HPRT_PCDET) == USB_OTG_HPRT_PCDET..
USBH_LL_DriverVBUS(), state: 1
... no connection USB device
2021-04-19 07:24 AM
And VBUS is freeing from level measurement with bun VBUS (VBUS sensing) options -- the set NOVBUSSENS bit in OTG_FS_GCCFG registry..
2021-04-19 07:58 AM
The USB PHY contains the required pulldowns and they are switched on automatically when you enable the host on 'F4. You don't need to enable pulldown in GPIO.
700mV on both DP and DM means, that the device does not work as expected.
JW