2019-10-23 07:12 PM
Hi,
Currently I'm working with a CubeMX project in which STM32F105 acts as a USB Host and communicates with USB flash drives. The problem is after detecting attached device and getting device speed successfully the enumeration stage fails. Tracing down the problem I see that when the host try to send out a packet to get the description of max packet size the TX channel is halted and the transaction error code HC_XACTERR is returned in HCD_HC_OUT_IRQHandler(). I'm using a custom board which works well with an old USB library, so I conclude that the hardware is correct and the problem lies within the CubeMX setting or USB library. Can anyone suggests about this problem? Here is a few more details of my project and what I've tried so far:
- Hardware: USB DP and DM are connected directly to the USB port without any pull-up resistor, the USB device is powered by a fixed 5V bus.
- CubeMX version: 5.3.0. Firmware package version: STM32Cube FW_F1 V1.8.0. IDE: Keil v5.28.0.
- Pinout&configuration: USB Host: Mode Mass Storage Class, FreeRTOS is disabled, Drive_VBUS_FS pin is unconnected. USB OTG FS: Mode Host only, PA11 and PA12 are USB DM and DP. FATFS: USB Disk is selected. The other options are kept the same as default. UART3 is used to send debug messages to a PC. Interrupt priority level is 5 for USB OTG and 6 for UART3.
- Clock: Using HSE source with a 25MHz oscillator, USB frequency is 48MHz, other units frequency is 25MHz.
- The current program is the same as the default generated code, MX_USB_HOST_Init() is called first in the setup routine, the while() loop of the main() only contains function MX_USB_HOST_Process().
- What I've tried so far:
+ Compare the old USB library and the CubeMX library. The functions for Host Enumeration
are implemented almost the same in the driver level. I've changed a few details like the amount of time delayed according to the old library but the results are still the same.
+ Enable and disable debug messages, the results are the same.
+ Try different USB flash drives having USB protocol 2.0 and capacity range from 500MBs to 8GBs, the results are the same.
+ Try the HID class with mice and keyboards, the process also fails with the same enumeration error.
2019-12-14 05:41 PM
I have the exact same problem.
2020-09-05 06:37 PM
i have the same problem,the enumeration can't reach APPLICATION_READY,just stay at APPLICATION_START,not sure why
2020-09-06 12:15 AM
This worked for me:
I needed long names for my project so additional were required