cancel
Showing results for 
Search instead for 
Did you mean: 

stm32 USB OTG Host doen't work with some usb-devices

maxim
Associate
Posted on September 06, 2013 at 09:20

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. With 

such 

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 behighly 

appreciated.

 

#stm32 #stm32-usb-host #connectivity-usb
7 REPLIES 7
frankmeyer9
Associate II
Posted on September 06, 2013 at 10:39

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.

maxim
Associate
Posted on September 06, 2013 at 13:47

No. The power is sufficient for sure. The voltage doesn't drop below 5V in any contidions. 

ajoyce
Associate
Posted on October 11, 2013 at 20:28

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.

bluexav
Associate III
Posted on November 01, 2013 at 15:21

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)

Posted on November 01, 2013 at 15:38

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
rafik
Associate II
Posted on October 19, 2016 at 19:51

Good evening,

I work on a small project and I want to use a STM32F4 board with a  3g modem, so the board will be in USB host mode and I can not seem to do the operation. I would like you to tell me how you did and thank you