2013-09-06 12:20 AM
Hello. I
am
trying to use usb host in stm32f105. Done everything according to reference manual, usb libs, application notes, etc. The host works,but not always. To be more exact: not with all usb-devices. Keyboards, mouses, 3G modem work fine.But most flash memory sticks don't work. I tried about 10 different sticks and only 2 of them work. USB hubs don't work either. Withsuch
devices I get TXERR interrupt when sending the very first SETUP packet (to get dev descr). I sniffed the bus and discovered that those sticks don't even try to reply anything. I see the packets issued by stm32 and after second EOP the bus remains idle. Any ideas why this happens? And how to fix? Any help will behighlyappreciated.
#stm32 #stm32-usb-host #connectivity-usb2013-09-06 01:39 AM
Not that I have much detailed experience with USB, but it could simply be a power problem.
Did you try with a powered hub ? For example, my beagleboard also does weird things when attaching certain 'bigger' mass-storage devices.2013-09-06 04:47 AM
No. The power is sufficient for sure. The voltage doesn't drop below 5V in any contidions.
2013-10-11 11:28 AM
I had the problem that on occasion an attached device wouldn't enumerate. I decided that the device was slow, taking too long to respond to the USB bus reset, and was therefore missing the Get Descriptor packet. So I set a timeout after issuing the Get Descriptor and if there was no response in a certain amount of time, like a 1/4 second, the MCU resends the Get Descriptor command. If there's no response after 4 reties, the MCU issues a new bus reset and started the process all over. I don't like how hit and miss the process can be, but it keeps my code from waiting forever when the attached device doesn't respond.
2013-11-01 07:21 AM
It might be a USB 1.0 / USB 2.0 compatibility problem.
I couldn't make my USB 1 mice work on the F4 discovery board configured as a USB host but the USB 2.0 mice worked... I had the same problems with usb sticks. (there is also a formatting issue to respect)2013-11-01 07:38 AM
The other issue that comes up periodically is with cheaper devices not using crystal oscillators, and being out-of-spec with respect to the USB spec.
2013-11-01 11:03 AM
Did you try this modification :
2016-10-19 10:51 AM