/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / USB Problem driving me nuts

Username:     
Password:     
             

Forum

# 1   2010-08-20 08:31:04 USB Problem driving me nuts

ashesman
New member
Registered: 2008-07-20
Posts: 7

USB Problem driving me nuts

Hi there,

    I have spent quite some time trying to get my own USB device working.  I just want to make a device that works like a simple bidirectional stream.  I have got this far:
  - Device enumerates fine
  - I can open the device pipes using winUSB
  - I can write to my OUT endpoint perfectly.
  - I can not read from my IN endpoint at all.

   At first I used endpoints 6 and 7 but could not read or write, then I switched to endpoints 1 and 2, absolutely no other changes and it started working on the OUT endpoint.  I have read so many data sheets and web pages, msdn, forums and so on.  I have checked, rechecked and double checked all my config descriptors,etc...   I am basically using the exact same endpoint setup as the mass storage example supplied by ST. 
   Win USB allows me to open the device, read the interface descriptor, get the correct numbered pipes and IDs.  Everything seems correct but I am obviously missing something.
   I have tried breakpointing the code in USB_Istr() for when the ISTR_CTR flag is set.  The breakpoint is hit on a write (OUT), but not on a read (IN).  USB packet sniffers show a IN request sent to the USB device (or hub).

   I have tried using WinUSB library functions as well as the .NET WinUSBNet class.  Both do not work.  The USB sniffer shows a packet going to the usb hub but it never gets to the micro I dont think.
   Any advice or help would be greatly appreciated...

Offline

 

# 2   2010-08-22 07:00:24 USB Problem driving me nuts

ashesman
New member
Registered: 2008-07-20
Posts: 7

Re: USB Problem driving me nuts

Solved now...  It turns out that the IN callback does not get hit when you read data.  You just write the data to the endpoint when you are ready and it is all good...

Offline

 

Board footer