2010-05-06 05:44:29 BF548 ezkit high speed usb bulk read problems
Ian Guest (SOUTH AFRICA)
Message: 89173
Dear USB experts
I have worked on the BF548 (EZKIT and Bluetchnix) host USB before. I have now got a problem where I am trying to talk to a vendor supplied Cypress FX2 based high speed USB device. As part of the setup, I have to load the device firmware to the peripheral using control messages. To do this I ported FXLOAD to libusb, and this works as the device is recoconfigured, reset and reappears with the correct (changed) PID. I have verified the load by transferring to a desktop and continuing.
The code I have written uses Libusb, and I have cross compiled it for Windows and Suse (where it works. The problem occurs when a bulk read is issued to the device on end point 84. The desktop machines receive zeros for a while and then they receive some bytes triggering the transactions required. On the EZKIT, I only receive zeros.
I suspect there is some problem with the high speed transfers or power (I have mounted 100uF cap and tried throuh a powered hub). I have also checked the USB_PLL multiplier setting as to be 20 - which it is (full setting 0x30a8). I have used usbmon on both the blackfin and the suse box (included) which shows the deviation as described as the bulk reads start.
I have also included the dmesg on both systems. On the blackfin I run through a telnet session so as to keep the system messages uncluttered.
The USB descriptor of the configured device is as follows:
Dev #119: 1512 PIPE PROFILER v1.0 - MARINE ELECTRONICS 1512
wTotalLength: 60
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: a0h
MaxPower: 50
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 6
bInterfaceClass: 255
bInterfaceSubClass: 0
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 02h
wMaxPacketSize: 64
bInterval: 0
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 01h
bmAttributes: 02h
wMaxPacketSize: 64
bInterval: 0
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 02h
bmAttributes: 02h
wMaxPacketSize: 64
bInterval: 0
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 84h
bmAttributes: 02h
wMaxPacketSize: 64
bInterval: 0
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 86h
bmAttributes: 02h
wMaxPacketSize: 64
bInterval: 0
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 88h
bmAttributes: 02h
wMaxPacketSize: 64
bInterval: 0
bRefresh: 0
bSynchAddress: 0
The simplified program is as follows (after configuration - I use a usb_reset and usb_close after configuring):
dh = usb_open(dev);
#if
defined(LIBUSB_HAS_GET_DRIVER_NP)
#if
printf("Seeing if a driver has claimed the interface");
printf("interface %i already claimed by %s - will try detach",0,name);
printf("%s\n", usb_strerror());
}
defined(LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP)if (LIBUSBLOG_usb_get_driver_np(dh, 0, (char *) name, sizeof(name)) == 0) {if (LIBUSBLOG_usb_detach_kernel_driver_np(dh, 0) < 0) {return;}
#endif
#endif
res = usb_set_configuration(dh,1);
res = usb_claim_interface(dh, 0);res = usb_set_altinterface(dh, 0);
retval = usb_bulk_read(dh, 0x84 ,outBuffer,outBufferSize,1000);
ANY help in debugging or getting the high speed bulk reads going will be much appreciated
Ian Guest
QuoteReplyEditDelete
2010-05-06 05:53:34 Re: BF548 ezkit high speed usb bulk read problems
Ian Guest (SOUTH AFRICA)
Message: 89174
Here are the files.
suse dmesg.txt
blackfin dmesg.txt
usbmonblackfin.txt
usbmon suse.txt
QuoteReplyEditDelete
2010-05-06 14:23:30 Re: BF548 ezkit high speed usb bulk read problems
Mike Frysinger (UNITED STATES)
Message: 89197
have you checked the async port timings ?
also, have you asked Cypress about working with their part ?
QuoteReplyEditDelete
2010-05-06 14:56:26 Re: BF548 ezkit high speed usb bulk read problems
Ian Guest (SOUTH AFRICA)
Message: 89199
Could you tell me where the asynch settings are? And what they should be?
QuoteReplyEditDelete
2010-05-07 09:23:23 Re: BF548 ezkit high speed usb bulk read problems
Ian Guest (SOUTH AFRICA)
Message: 89225
I looked around. These settings seem to apply to the external asynchronous bus. I am using the BF548 internal Inventra USB OTG controller? Are there any other settings to increase the amount of debug information coming out?
QuoteReplyEditDelete
2010-05-07 14:11:17 Re: BF548 ezkit high speed usb bulk read problems
Robin Getz (UNITED STATES)
Message: 89236
Ian:
The Cypress FX2 based high speed USB device that you were talking about - that's the USB controller on the async bus? or that is the USB device on the other end of the USB cable?
-Robin
QuoteReplyEditDelete
2010-05-07 16:08:30 Re: BF548 ezkit high speed usb bulk read problems
Ian Guest (SOUTH AFRICA)
Message: 89239
Sorry if it was unclear - it is on the other side of the cable. I am using a type A (host) connector to connect the device to the EZKIT.
QuoteReplyEditDelete
2010-05-08 18:09:52 Re: BF548 ezkit high speed usb bulk read problems
Mike Frysinger (UNITED STATES)
Message: 89254
you can try toggling the musb dma/pio option in the kernel config to see if that makes a difference
QuoteReplyEditDelete
2010-05-09 11:37:33 Re: BF548 ezkit high speed usb bulk read problems
Ian Guest (SOUTH AFRICA)
Message: 89268
Thank you Mike - I have already tried that with no success. Do you have any other ideas?
QuoteReplyEditDelete
2010-05-10 17:25:59 Re: BF548 ezkit high speed usb bulk read problems
Mike Frysinger (UNITED STATES)
Message: 89294 can you force the lowest speed possible to see if it makes a difference ?
perhaps double check the cable to make sure you're using the right tips ...
otherwise, a USB analyzer might help to compare the traffic between
the two parts
QuoteReplyEditDelete
2010-05-12 11:11:05 Re: BF548 ezkit high speed usb bulk read problems
Ian Guest (SOUTH AFRICA)
Message: 89337
Hi Mike
As another option I ported the code to an OMAP with an Inventra USB OTG and it works there. A difference is that the libusb is version 1.0 with a layer using libusb-compat-0.1 so that it looks like the old libusb v0.1.12.
I tried to compile it for the blackfin manually - but it causes an error: Dmesg attached.
Could the old version of libusb be the problem?
Ian
libusb1_dmesg.txt