cancel
Showing results for 
Search instead for 
Did you mean: 

USB OTG HOST Enumoration

iozho
Associate II
Posted on June 05, 2011 at 12:58

Hi:

I got stuck trying to use STM32 Connective line controller towork as a USB HOST. If I attach flash drive the device attaching is detectedbut the enumeration is not working. USB Control packet is send but the devicealways returns URB_STALL (as per USB OTG flag). I tried different devices sameresult.

Anyone has any suggestions?

Thanks,

Konstantin

#off-topic #old-thread #usb-host-library-enumeration
16 REPLIES 16
iozho
Associate II
Posted on June 05, 2011 at 17:21

Additionally the USB HOST controller reportsthat the channel is halted - always.

Thanks,

Konstantin

iozho
Associate II
Posted on June 05, 2011 at 20:26

This is what else I have found (which did not fix my problem thou) that is wrong in little endian machines (usbh_def.h):

/*  This Union is copied from usb_core.h  */

typedef union

{

  uint16_t w;

  struct BW

  {

    uint8_t msb;

    uint8_t lsb;

  }

  bw;

}

uint16_t_uint8_t;

Thanks,

Konstantin

iozho
Associate II
Posted on June 07, 2011 at 20:16

Anyone?

iozho
Associate II
Posted on June 09, 2011 at 13:30

Here is more data. Again the problem is the setup part of the device i.e. the device is deteced but when the setup starts it is not working. This is what I am getting in the interrupt handler:

Breakpoint 2, USB_OTG_USBH_handle_hc_n_In_ISR (pdev=0x20000b70, num=1)

    at fw/std/src/usb_hcd_int.c:468

468  if (hcint.b.ack)

$1 = {d32 = 16, b = {xfercompl = 0, chhltd = 0, ahberr = 0, stall = 0, 

    nak = 1, ack = 0, reserved6 = 0, xacterr = 0, bblerr = 0, frmovrun = 0

$3 = {d32 = 24, b = {xfercompl = 0, chhltd = 0, ahberr = 0, stall = 1, 

    nak = 1, ack = 0, reserved6 = 0, xacterr = 0, bblerr = 0, frmovrun = 0, 

    datatglerr = 0, Reserved = 0}}

$4 = {d32 = 2, b = {xfercompl = 0, chhltd = 1, ahberr = 0, stall = 0, 

    nak = 0, ack = 0, reserved6 = 0, xacterr = 0, bblerr = 0, frmovrun = 0, 

    datatglerr = 0, Reserved = 0}}

So I get only NAK, STALL and channel halted. Clearly something is not right. I have also checked the USB cables and they seem to be fine.

Suggestions?

iozho
Associate II
Posted on June 10, 2011 at 13:24

So as it seems I am the only one who is looking at this but so far what I have found is that in the Control Channel when we send setup packet we receive STALL and the firmware is setting the status to  USBH_NOT_SUPPORTED.

iozho
Associate II
Posted on June 19, 2011 at 06:51

This turn out to be a compiler bug - it was generating wrong data for setup packet.

Thanks,

Konstantin

alok472
Associate II
Posted on June 20, 2011 at 05:58

Which is the compiler and optimisation level you are using ?

Thanks.

iozho
Associate II
Posted on June 20, 2011 at 06:52

It was turned off. The problem is with the nested unions.

alok472
Associate II
Posted on June 20, 2011 at 08:10

Thanks for this update. Which compiler your are using ? IAR/ KEIL ?