2011-06-05 03:58 AM
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-enumeration2011-06-05 08:21 AM
Additionally the USB HOST controller reportsthat the channel is halted - always.
Thanks,
Konstantin
2011-06-05 11:26 AM
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
2011-06-07 11:16 AM
Anyone?
2011-06-09 04:30 AM
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?2011-06-10 04:24 AM
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.
2011-06-18 09:51 PM
This turn out to be a compiler bug - it was generating wrong data for setup packet.
Thanks,
Konstantin
2011-06-19 08:58 PM
Which is the compiler and optimisation level you are using ?
Thanks.2011-06-19 09:52 PM
It was turned off. The problem is with the nested unions.
2011-06-19 11:10 PM
Thanks for this update. Which compiler your are using ? IAR/ KEIL ?