UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
617 Views
Registered: ‎09-28-2018

Xilinx 2018.2: Uboot commands: ext4load from USB fails

Dear Xilinx, 

 

I'm strugggling a bit with the USB device at the Uboot stage. We want 2 options in the field to update the Zynq US+: Either via tftp or USB. 

I've made some commands in Uboot to do so. Next example shows a kernel update via tftp followed by the USB. 

ZynqMP> run install_kernel_tftp
install_kernel_tftp command issued
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
DHCP client bound to address 172.16.103.56 (1006 ms)
Using ethernet@ff0e0000 device
TFTP from server 172.16.1.67; our IP address is 172.16.103.56
Filename 'Image'.
Load address: 0x8000
Loading: *<0x08>#################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 ##########################
	 13.3 MiB/s
done
Bytes transferred = 14686720 (e01a00 hex)
writing Image
14686720 bytes written

ZynqMP> run install_kernel_usb install_kernel_usb command issued starting USB... USB0: Register 2000440 NbrPorts 2 Starting the controller USB XHCI 1.00 scanning bus 0 for devices... 2 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found Device 0: Vendor: Kingston Rev: 1.00 Prod: DataTraveler 2.0 Type: Removable Hard Disk Capacity: 15287.9 MB = 14.9 GB (31309760 x 512) ... is now current device WARN halted endpoint, queueing URB anyway. Unexpected XHCI event TRB, skipping... (7dec6f90 00000000 13000000 01008401)

Basically the USB load command goes wrong.  The USB engine has been started and the size of Image has been determined previously

ZynqMP> ext4load usb 0 0x8000 Image $filesize 
WARN halted endpoint, queueing URB anyway.
Unexpected XHCI event TRB, skipping... (7decec90 00000000 13000000 01008401)
BUG at drivers/usb/host/xhci-ring.c:496/abort_td()!
BUG!
### ERROR ### Please RESET the board ###

Edit: extra addition: The threshold seems to be between  24 and 25 blocks. ( 12288 bytes and 12800 bytes) which is rather small. ??

ZynqMP> usb read 0x8000 0 18
usb read: device 0 block # 0, count 24 ... 24 blocks read: OK
ZynqMP> usb read 0x8000 0 19
usb read: device 0 block # 0, count 25 ... WARN halted endpoint, queueing URB anyway.
Unexpected XHCI event TRB, skipping... (7dececd0 00000000 13000000 01008400)
BUG at drivers/usb/host/xhci-ring.c:496/abort_td()!
BUG!
### ERROR ### Please RESET the board ###

 

Has someone an idea what is going wrong? Any help is welcome here. 

Deville

0 Kudos
12 Replies
Adventurer
Adventurer
589 Views
Registered: ‎09-28-2018

Re: Xilinx 2018.2: Uboot commands: ext4load from USB fails

I've some extra debug information to add: 

usb_read: udev 0
 
usb_read: dev 0 startblk 0, blccnt 1 buffer 7dea8340
read10: start 0 blocks 1
COMMAND phase
xhci_submit_bulk_msg: dev='dwc3@fe200000', udev=000000007deafde0
dev=000000007deafde0, pipe=c0010203, buffer=000000007dea8200, length=31
EP STATE RUNNING.
usb_stor_BBB_comdat:usb_bulk_msg error
failed to send CBW status 128
BBB_reset
usb_control_msg: request: 0xFF, requesttype: 0x21, value 0x0 index 0x0 length 0x0
xhci_submit_control_msg: dev='dwc3@fe200000', udev=000000007deafde0, udev->dev='usb_mass_storage', portnr=1
req=255 (0xff), type=33 (0x21), value=0 (0x0), index=0
EP STATE RUNNING.
start_trb 000000007deaf060, start_cycle 1
req->requesttype = 33, req->request = 255,le16_to_cpu(req->value) = 0,le16_to_cpu(req->index) = 0,le16_to_cpu(req->length) = 0
length_field = 0, length = 0,xhci_td_remainder(length) = 0 , TRB_INTR_TARGET(0) = 0
BBB_reset result -1: status 80 reset
usb_control_msg: request: 0x1, requesttype: 0x2, value 0x0 index 0x81 length 0x0
xhci_submit_control_msg: dev='dwc3@fe200000', udev=000000007deafde0, udev->dev='usb_mass_storage', portnr=1
req=1 (0x1), type=2 (0x2), value=0 (0x0), index=129
 
WARN halted endpoint, queueing URB anyway.
EP STATE RUNNING.
start_trb 000000007deaf080, start_cycle 1
req->requesttype = 2, req->request = 1,le16_to_cpu(req->value) = 0,le16_to_cpu(req->index) = 129,le16_to_cpu(req->length) = 0
length_field = 0, length = 0,xhci_td_remainder(length) = 0 , TRB_INTR_TARGET(0) = 0
XHCI control transfer timed out, aborting...
EP STATE RUNNING.
 
Unexpected XHCI event TRB, skipping... (7deab030 00000000 13000000 01008400)

.. Still figuring out what this means. I'm diving in the code right now. 

0 Kudos
Adventurer
Adventurer
544 Views
Registered: ‎09-28-2018

Re: Xilinx 2018.2: Uboot commands: ext4load from USB fails

I ve been in contact with the kind people at denx.de and they gave me following tips - remarks concerning the failing USB2 storage device. I'll try to reflect their comments as good as possible.

  • I'm using xilinx 2018.2 but there are some developments made with the XHCI (USB3) driver in the mainline Uboot repository. One can try these patches. 
    http://git.denx.de/?p=u-boot.git;a=history;f=drivers/usb/host/xhci.c
  • If the USB does not work properly in Linux either then it might have been a misconfiguration in the USB block which outh to be resolved in Vivado or the board design.
  • USB sticks are just problematic in combination with some USB hosts. For example, cheap clones of Kingston DTSE9H (USB ID 0951:1665) trigger misbehavior with DWC2 USB block. Linux solves this by repeatedly restarting the USB port in the background, until the stick catches up. U-Boot is single-threaded, so it cannot do that easily. So another USB device could do the trick.
  • Try with disabled caches. It is well possible the cache handling in this old U-Boot version is broken. If it's not enabled yet, enable CONFIG_CMD_CACHE , update U-Boot and then do "dcache off ; usb reset" and see whether this has any impact.
  • Look at the stability of the VBUS 

I pulled out an old USB analyzer : "Ellisys USB explorer 200" and it turned out the USB2 storage device I used got stuck at exactly the same time while unloading the data off the stick. The device received a subsequent ClearFeature command. I don't know much about the USB protocol but this command indicates something was wrong on the USB storage devices side. A new USB3 device did the job as it should be. 

There are two new variables using the USB3 device:

  • It was new, so no corrupted blocks just yet
  • It was an USB3 instead of a USB2 device.

Further test will show which of the 2 variables is the cause of the failure. Meanwhile, I've attached a picture shows the captured log and where it went wrong.

Poll5.png

 

Extra addition from the creators of UBoot : This is more likely to be an issue where there is just a mismatch between the specific USB stick and the controller or perhaps a controller driver problem.

0 Kudos
Observer bsisweng1
Observer
511 Views
Registered: ‎12-06-2018

Re: Xilinx 2018.2: Uboot commands: ext4load from USB fails

I'm having issues with migrating u-boot from petalinux 2018.3 to petalinux 2019.1. 

I'm able to successfully transfer data to/from a Kingston Data Traveler 2.0 USB stick with u-boot built from petalinux 2018.3.  With u-boot built from petalinux 2019.1, however, the first bulk read from USB mass memory completes with an error.  I'm seeing halted endpoint warnings the same as you are:

fatload usb 0 10000000 /BOOT.BIN
WARN halted endpoint, queueing URB anyway.
xhci_bulk_tx: XHCI bulk transfer timed out, aborting...
xhci_wait_for_event: Unexpected XHCI event TRB, skipping... (7ddd4ab0 00000000 13000000 01008401)
BUG at drivers/usb/host/xhci-ring.c:497/abort_td()!
BUG!
### ERROR ### Please RESET the board ###

In my case, the block count doesn't matter.  I always get a halted endpoint warning no matter how many blocks I attempt to transfer.  

I should point out that the "usb start" that precedes "fatload" is successful.  This means the USB enumeration is completing successfully.  The u-boot menu items "usb storage", "usb tree" and "usb info" all display valid information about the Kingston USB stick.    

I think u-boot built from petalinux 2018.3 is more robust.  Perhaps the issues you are seeing with u-boot 2018.2 were resolved in petalinux 2018.3 but were re-introduced in petalinux 2019.1.  

Some USB sticks do work.  My colleagues have been able to get around the issues with u-boot 2019.1 by using smaller-capacity USB sticks.

0 Kudos
Adventurer
Adventurer
487 Views
Registered: ‎09-28-2018

Re: Xilinx 2018.2: Uboot commands: ext4load from USB fails

@bsisweng1 

Sounds you have similar issues like mine. 

Interesting to see what your conclusions are, when you get passed this error. You can follow the tips offered by the Uboot creators which you can find in my previous post. 

Do you mean the stopping point of the USB transfers is always different?   When I introduces  #define DEBUG, the stick sometimes got past the fixed stopping point but I cant't recall which flow of events I performed to get past these errors. A subsequent reboot got the USB2 stick stuck just the same.  

That is why the kind people @ denx think this is a controller vs USB storage device mismatch especially with this cheap China ( yes, frankly, it is ) junk. 

 

Deville

0 Kudos
Observer bsisweng1
Observer
469 Views
Registered: ‎12-06-2018

Re: Xilinx 2018.2: Uboot commands: ext4load from USB fails

@deville 

In my case, the stopping point of the usb transfers is always the same.  It happens in function "usb_stor_read" in file "common/usb_storage.c".  There is a "do" loop in function "usb_stor_read" that calls function "usb_read_10" which performs the read from mass memory in the usb stick on behalf of the upper-level filesystem management code (in my case, the dos filesystem; in your case, the ext4 filesystem).

In my case, the first call to function "usb_read_10" always fails.  The filesystem software is attempting to read the master boot record on the USB stick which is stored at logical block address zero in mass memory on the usb stick.  usb mass storage devices use scsi protocol under the hood.  Accesses to the mass memory occur in three phases: command, data, status.  My issue is with the data phase which always fails on the first read to the mass memory to retrieve the master boot record from the usb stick.    

Moderator
Moderator
285 Views
Registered: ‎02-07-2018

Re: Xilinx 2018.2: Uboot commands: ext4load from USB fails

HI @deville @bsisweng1 

I just verified same on zcu102 board with 2018.2 &2019.1 SW, It is working properly. There is no issues.

I can load the images from USB to ddr using ext4load & fatload commands. below are the logs for your refernce.

U-Boot 2019.01 (Mar 17 2019 - 08:43:47 +0000)

Model: ZynqMP ZCU102 Rev1.0
Board: Xilinx ZynqMP
DRAM: 4 GiB
EL Level: EL2
Chip ID: zu9eg
MMC: mmc@ff170000: 0
Loading Environment from SPI Flash... SF: Detected n25q512a with page size 512 Bytes, erase size 128 KiB, total 128 MiB
OK
In: serial@ff000000
Out: serial@ff000000
Err: serial@ff000000
Model: ZynqMP ZCU102 Rev1.0
Board: Xilinx ZynqMP
Net: ZYNQ GEM: ff0e0000, phyaddr c, interface rgmii-id
eth0: ethernet@ff0e0000
Hit any key to stop autoboot: 0
Wrong Image Format for bootm command
ERROR: can't get kernel image!
ZynqMP> usb start
starting USB...
USB0: Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
ZynqMP> fatload usb 0 0x10000000 image.ub
11156492 bytes read in 293 ms (36.3 MiB/s)

ZynqMP> fatload usb 0 0x10000000 BOOT.BIN
13959296 bytes read in 373 ms (35.7 MiB/s)
ZynqMP> fatload usb 0 0x10000000 image.ub
11156492 bytes read in 288 ms (36.9 MiB/s)

ZynqMP> usb info
1: Hub, USB Revision 3.0
- U-Boot XHCI Host Controller
- Class: Hub
- PacketSize: 512 Configurations: 1
- Vendor: 0x0000 Product 0x0000 Version 1.0
Configuration: 1
- Interfaces: 1 Self Powered 0mA
Interface: 0
- Alternate Setting 0, Endpoints: 1
- Class Hub
- Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

2: Mass Storage, USB Revision 2.10
- SanDisk Ultra 4C530001170307111065
- Class: (from Interface) Mass Storage
- PacketSize: 64 Configurations: 1
- Vendor: 0x0781 Product 0x5590 Version 1.0
Configuration: 1
- Interfaces: 1 Bus Powered 224mA
Interface: 0
- Alternate Setting 0, Endpoints: 2
- Class Mass Storage, Transp. SCSI, Bulk only
- Endpoint 1 In Bulk MaxPacket 512
- Endpoint 2 Out Bulk MaxPacket 512

ZynqMP> usb storage
Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
Type: Removable Hard Disk
Capacity: 14663.6 MB = 14.3 GB (30031250 x 512)

ZynqMP> usb dev 0

Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
Type: Removable Hard Disk
Capacity: 14663.6 MB = 14.3 GB (30031250 x 512)
... is now current device
ZynqMP>

ZynqMP> usb read 0x8000 0 18

usb read: device 0 block # 0, count 24 ... 24 blocks read: OK
ZynqMP> usb read 0x8000 0 19

usb read: device 0 block # 0, count 25 ... 25 blocks read: OK

 

I would like to know what modifications you made to u-boot source code.

Are you verifiying with USB2.0 only mode or both USB2.0 & USB3.0 enabled in your design.

I have verified with prebuilt images, it has  both USB2.0 & USB3.0 enabled  in design by deafult.

 

Thanks & regards

Aravind

0 Kudos
Adventurer
Adventurer
279 Views
Registered: ‎09-28-2018

Re: Xilinx 2018.2: Uboot commands: ext4load from USB fails

Hi @aravindb 

Thanks for your intrest in this issue. 

I've left the source code of U-boot untouched except for the custom Uboot commands i've created.  It uses only standard commands like you've issued in your example above. 

As an attachtment I included the U-boot config file your you to investigate and if you like I also can deliver you the complete log (94 Mb zip) of the USB tracer which you can load up once you got the MS Windows software of the device running. You don't need the USB tracer itself for analysis. However, I didn't save the status of the .config file at the time and I continued my work on the ZynqUS EV platform so there's always a chance it has been altered since. 

 Deville

0 Kudos
Highlighted
Observer bsisweng1
Observer
260 Views
Registered: ‎12-06-2018

Re: Xilinx 2018.2: Uboot commands: ext4load from USB fails

Hi @aravindb 

As I mentioned in one of my earlier posts, we're having issues with migrating u-boot from petalinux 2018.3 to petalinux 2019.1.  petalinux 2018.3 produces a u-boot with no USB issues.  After migrating our petalinux 2018.3 project to 2019.1, fatload didn't work because of USB read failures.  Large capacity, multi-gigabyte USB sticks produce fatload failures when the USB stick is connected directly to the USB port on our ZynqMP processor board.    When the USB stick is connected to an old USB 1.1 hub hanging off the USB port on our ZynqMP processor board, fatload works.  When I change the hub to a USB 2.0 hub, fatload doesn't work once again because of USB read failures.    

We managed to find a couple of small-capacity, multi-megabyte (older) USB sticks that happen to work when connected directly to the USB port on our ZynqMP processor board.  .

I haven't modified the 2019.1 or 2018.3 u-boot source.  

In the petalinux u-boot configuration, I used the following settings for both 2019.1 and 2018.3:

1. Enabled usb device access commands

2. Used "xilinx_zynqmp_zcu106_revA_defconfig" as the u-boot configuration target. 

Only USB 2.0 is enabled in the Zynq configuration of our Vivado project.  Should we enable both USB 2.0 and 3.0 in our Vivado project?

We're using the same USB PHY on our ZynqMP  processor board as is used on the Xilinx ZCU106 processor board which is a USB 2.0 PHY  (i.e., Microchip USB3320).

 

 

 

 

 

Moderator
Moderator
239 Views
Registered: ‎02-07-2018

Re: Xilinx 2018.2: Uboot commands: ext4load from USB fails

HI @bsisweng1 @deville 

Thanks for clear explanation. What is the size of USB pendrive you are using to reproduce this issue.

I am going to connect USB 2.0 hub & try. I verified connecting USB3.0 pendrive directly.

In my design we have both USB3.0 along with USB2.0.

You can just try by enabling USB 3.0 also along with USB2.0 in PCW even though it is not presnt in PCB .

 

Thanks & regards

Aarvind

 

 

0 Kudos
Adventurer
Adventurer
230 Views
Registered: ‎09-28-2018

Re: Xilinx 2018.2: Uboot commands: ext4load from USB fails

@aravindb 

My USB2 stick is 16 GB.  

From my normal PC

[19456.642503] usb 1-5.3: New USB device found, idVendor=0951, idProduct=1607, bcdDevice= 1.00
[19456.642506] usb 1-5.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[19456.642507] usb 1-5.3: Product: DataTraveler 2.0
[19456.642509] usb 1-5.3: Manufacturer: Kingston
[19456.642510] usb 1-5.3: SerialNumber: 001372982D2AF97126370985

 

0 Kudos
Observer bsisweng1
Observer
198 Views
Registered: ‎12-06-2018

Re: Xilinx 2018.2: Uboot commands: ext4load from USB fails

@aravindb 

The capacity of my USB stick is 7.2 GB

ZynqMP> usb start
starting USB...
USB0: Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
ZynqMP> usb storage
Device 0: Vendor: Kingston Rev: PMAP Prod: DataTraveler 2.0
Type: Removable Hard Disk
Capacity: 7446.0 MB = 7.2 GB (15249408 x 512)
ZynqMP>

0 Kudos
Observer bsisweng1
Observer
166 Views
Registered: ‎12-06-2018

Re: Xilinx 2018.2: Uboot commands: ext4load from USB fails

@aravindb 

Unfortunately, we cannot add USB 3.0 to our zynq configuration because the gigabit transceiver interface on our ZynqMP processor board isn't hooked up.  We don't have a reference clock going to the PS_GTR block on the zynq because we weren't planning on using USB 3.0.  

We discovered this the hard way.  We revised our zynq pl by selecting USB 2.0 and USB 3.0 in the zynq configuration using Vivado.  When I tested the new build, the following error message was displayed in the console:

#SERDES initialization timed out

This error is caused by no reference clock going into the PS_GTR block.

 

0 Kudos