Jump to content
  • 0

Zybo Host USB "Device offlined" ...


debugasm

Question

Hi,

I want to use the "USB OTG" available on Zybo development board. With "USB OTG" in "Host Mode" I connect an USB pen drive (FAT32) and reading a file at fixed rate (about 5Mbit/s) for streaming data to logical part (PL).

With default setup of Zybo that boot from QSPI I have made some test, without success.

I have used an "Consumer USB pen drive", of 8 GByte, formatted with FAT32 and preload "largefile" with size of 1Gbyte.

(1) Follow user guide of Zybo

When acting as an embedded host, the USB A connector (J10) should be used to 
connect to a USB peripheral device, and JP1 should be shorted

JP1 is shorted with jumper

While in host mode, the ZYBO is technically an "embedded host", because it does 
not provide the required 150 μF of capacitance on VBUS required to qualify as a 
general purpose host. It is possible to modify the ZYBO so that it complies with 
the general purpose USB host requirements by loading C64 with a 150 μF capacitor 
and shorting JP2. Only those experienced at soldering small components on PCBs 
should attempt this rework. Many USB peripheral devices will work just fine 
without loading C64. Whether the ZYBO is configured as an embedded host or a 
general purpose host, it can provide 500 mA on the 5V VBUS line.

I have load C64 with ceramic 150uF/6.3V and shorting JP2 for "USB host"

I have :

- JP1 is shorted with jumper

- Load C64 with ceramic 150uF/6.3V and shorting JP2 for "USB host"

(2) After insert USB pen drive (FAT32 8 GByte)

zynq> usb 1-1: new high-speed USB device number 2 using xusbps-ehci
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi0 : usb-storage 1-1:1.0
scsi 0:0:0:0: Direct-Access              USB DISK         1100 PQ: 0 ANSI: 4
sd 0:0:0:0: [sda] 15730688 512-byte logical blocks: (8.05 GB/7.50 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: Attached scsi generic sg0 type 0
sd 0:0:0:0: [sda] No Caching mode page present
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] No Caching mode page present
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 0:0:0:0: [sda] No Caching mode page present
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI removable disk

Zybo recognizes USB pen drive without problems

(3) Mount USB pen drive

zynq> mkdir /mnt/pendrive

zynq> mount -w -t vfat /dev/sda1 /mnt/pendrive

zynq> ls /mnt/pendrive -l
total 1048576
-rwxr-xr-x    1 root     0        1073741824 Apr 28  2016 largefile

(4) Test read speed (file of 1 GByte is present on USB pen drive "largefile")

zynq> dd if=/mnt/pendrive/largefile of=/dev/null bs=8k

(5) After few seconds USB pen drive disconnects ...

usb 1-1: USB disconnect, device number 2
sd 0:0:0:0: Device offlined - not ready after error recovery
dd: /mnt/pendrive/largefile: Input/output errorsd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]

Result: hostbyte=0x05 driverbyte=0x00
sd 0:0:0:0: [sda] CDB:
zynq> cdb[0]=0x28: 28 00 00 20 8d 17 00 00 10 00
end_request: I/O error, dev sda, sector 2133271
sd 0:0:0:0: rejecting I/O to offline device
sd 0:0:0:0: [sda] killing request
sd 0:0:0:0: rejecting I/O to offline device
sd 0:0:0:0: rejecting I/O to offline device
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]
Result: hostbyte=0x01 driverbyte=0x00
sd 0:0:0:0: [sda] CDB:
cdb[0]=0x28: 28 00 00 20 8d 27 00 00 f0 00
end_request: I/O error, dev sda, sector 2133287
usb 1-1: new high-speed USB device number 3 using xusbps-ehci
usb 1-1: device descriptor read/64, error -110
usb 1-1: device descriptor read/64, error -110
usb 1-1: new high-speed USB device number 4 using xusbps-ehci
usb 1-1: device descriptor read/64, error -110

zynq> usb 1-1: device descriptor read/64, error -110
usb 1-1: new high-speed USB device number 5 using xusbps-ehci
usb 1-1: device not accepting address 5, error -110
usb 1-1: new high-speed USB device number 6 using xusbps-ehci

The USB pen drive becomes unresponsive

What might be the problem ?

It never occurred to anyone ?

Thanks very much.

debugasm

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

Have you tried with another USB pen drive? As a first guess, it could be indeed the insufficient capacitance at fault, if the pen drive has large load variations under stress. However, this should have been solved by the cap you loaded. Is there some other debug log of the USB controller we could look at?

If you scope VBUS there should be no large voltage drops when under stress with the large cap loaded. The device lock-up might be due to something else.

Link to comment
Share on other sites

51 minutes ago, elodg said:

Have you tried with another USB pen drive?

Yes, I have tried three other pen drive, unfortunately the same brand, but i want try with other brands.

51 minutes ago, elodg said:

Is there some other debug log of the USB controller we could look at?

There are not yet expert enough to answer this question. Maybe someone can help us.

52 minutes ago, elodg said:

The device lock-up might be due to something else.

While doing other tests I noticed the strangest thing. Wanting to keep the console "PROG UART" connected, this has always been active for all of my tests by chance I disconnected and I started an SSH terminal shell.

With SSH terminal USB read test working without problem:

dd if=/media/pendrive/largefile of=/dev/null bs=8k
131072+0 record dentro
131072+0 record fuori
1073741824 byte (1,1 GB) copiati, 42,4746 s, 25,3 MB/s

dd if=/media/pendrive/smallfile of=/dev/null bs=8k
8192+0 record dentro
8192+0 record fuori
67108864 byte (67 MB) copiati, 2,75659 s, 24,3 MB/s

With SSH terminal USB write test working without problem (very low speed on FAT32):

dd if=/dev/zero of=/media/pendrive/testwritefile bs=8k count=1000
1000+0 record dentro
1000+0 record fuori
8192000 byte (8,2 MB) copiati, 64,863 s, 126 kB/s

I tried to reconnect the port "USB PROG" and open connection on serial terminal. The test is it make on SSH terminal and error get from Serial termina:

SSH Terminal:

dd if=/media/pendrive/largefile of=/dev/null bs=8k
dd: errore leggendo "/media/pendrive/largefile": Errore di input/output
56574+0 record dentro
56574+0 record fuori
463454208 byte (463 MB) copiati, 49,1486 s, 9,4 MB/s

Serial Terminal:

usb 1-1: USB disconnect, device number 4
sd 2:0:0:0: [sda]
Result: hostbyte=0x01 driverbyte=0x00
sd 2:0:0:0: [sda] CDB:
cdb[0]=0x28: 28 00 00 11 27 bf 00 00 f0 00
blk_update_request: I/O error, dev sda, sector 1124287
sd 2:0:0:0: [sda]
Result: hostbyte=0x01 driverbyte=0x00
sd 2:0:0:0: [sda] CDB:
cdb[0]=0x28: 28 00 00 11 28 af 00 00 10 00
blk_update_request: I/O error, dev sda, sector 1124527
usb 1-1: new high-speed USB device number 5 using zynq-ehci
usb 1-1: device descriptor read/64, error -110
usb 1-1: device descriptor read/64, error -110
usb 1-1: new high-speed USB device number 6 using zynq-ehci
usb 1-1: device descriptor read/64, error -110
usb 1-1: device descriptor read/64, error -110
usb 1-1: new high-speed USB device number 7 using zynq-ehci
usb 1-1: device not accepting address 7, error -110
usb 1-1: new high-speed USB device number 8 using zynq-ehci
usb 1-1: device not accepting address 8, error -110
usb usb1-port1: unable to enumerate USB device
usb 1-1: new high-speed USB device number 9 using zynq-ehci
FAT-fs (sda1): unable to read boot sector to mark fs as dirty
usb 1-1: device descriptor read/64, error -110

Someone can think of something ?

I am even more puzzled.

debugasm

Link to comment
Share on other sites

A couple of things:

First, are you setting the power jumper to WALL? This is JP7 in the upper left corner of the board. Even if you have a Wall adapter plugged in, the board will only use that as the power source if JP7 is set to "WALL".

If that doesn't answer it, then maybe this is a problem with the version of linux we ship loaded on the ZYBO. If you have a microSD card, then you can just try using the new prebuilt linux image that ships with our ZYBO petalinux BSP. You can download the Petalinux BSP here:

https://github.com/Digilent/petalinux-bsps

After you download it, copy these two files to a FAT32 formatted microSD card:

petalinux-bsps/projects/Digilent-Zybo-Linux-BD-v2015.4/pre-built/linux/images/BOOT.BIN

petalinux-bsps/projects/Digilent-Zybo-Linux-BD-v2015.4/pre-built/linux/images/image.ub

These files must be placed in the base directory of the microSD card and the FAT32 partition must be the first partition on the microSD card. After this is done, eject the microSD card from your computer, insert it into the ZYBO, set the mode jumper to "SD", and power the board on. You should see it boot into Linux. More info on this linux image can be found here: 

https://github.com/Digilent/petalinux-bsps/wiki/Quick-start-guide

 

Link to comment
Share on other sites

Sorry for long delay.

On 4/5/2016 at 2:04 AM, sbobrowicz said:

A couple of things:

First, are you setting the power jumper to WALL? This is JP7 in the upper left corner of the board. Even if you have a Wall adapter plugged in, the board will only use that as the power source if JP7 is set to "WALL".

Yes, I use a wall adapter with Jumper JP7 configured properly on position : "WALL"

On 4/5/2016 at 2:04 AM, sbobrowicz said:

If that doesn't answer it, then maybe this is a problem with the version of linux we ship loaded on the ZYBO. If you have a microSD card, then you can just try using the new prebuilt linux image that ships with our ZYBO petalinux BSP. You can download the Petalinux BSP here:

https://github.com/Digilent/petalinux-bsps

After you download it, copy these two files to a FAT32 formatted microSD card:

petalinux-bsps/projects/Digilent-Zybo-Linux-BD-v2015.4/pre-built/linux/images/BOOT.BIN

petalinux-bsps/projects/Digilent-Zybo-Linux-BD-v2015.4/pre-built/linux/images/image.ub

These files must be placed in the base directory of the microSD card and the FAT32 partition must be the first partition on the microSD card. After this is done, eject the microSD card from your computer, insert it into the ZYBO, set the mode jumper to "SD", and power the board on. You should see it boot into Linux. More info on this linux image can be found here: 

https://github.com/Digilent/petalinux-bsps/wiki/Quick-start-guide

I have follow your suggestione but the problem unfortunately with these files it is worsened.

After connecting the serial port "PROG/USB" :

Built with PetaLinux v2015.4 (Yocto 1.8) Digilent-Zybo-Linux-BD-v2015_4 /dev/ttyPS0
Digilent-Zybo-Linux-BD-v2015_4 login:

I logged on with "user:root" and "password:root"

login[1049]: root login on 'ttyPS0'
root@Digilent-Zybo-Linux-BD-v2015_4:~#

I configured the network interface to access :

eth0      Link encap:Ethernet  HWaddr 00:1E:C0:DD:BB:09
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1447 errors:0 dropped:64 overruns:0 frame:0
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:103454 (101.0 KiB)  TX bytes:21204 (20.7 KiB)
          Interrupt:147 Base address:0xb000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Change IP address :

ifconfig eth0 192.168.1.198 netmask 255.255.255.0 broadcast 192.168.1.255

eth0      Link encap:Ethernet  HWaddr 00:1E:C0:DD:BB:09
          inet addr:192.168.1.198  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2886 errors:0 dropped:248 overruns:0 frame:0
          TX packets:219 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:199417 (194.7 KiB)  TX bytes:74898 (73.1 KiB)
          Interrupt:147 Base address:0xb000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1088 (1.0 KiB)  TX bytes:1088 (1.0 KiB)

Now I have disconnecting the serial port "PROG/USB" and switch to Telnet (port 23, SSH is not available)

telnet 192.168.1.198

root@Digilent-Zybo-Linux-BD-v2015_4:~#

Insert USB drive :

usb 1-1: new high-speed USB device number 2 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1:1.0
usb 1-1: USB disconnect, device number 2
usb 1-1: new high-speed USB device number 3 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host1: usb-storage 1-1:1.0
random: nonblocking pool is initialized
usb 1-1: USB disconnect, device number 3
usb 1-1: new high-speed USB device number 4 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host2: usb-storage 1-1:1.0
usb 1-1: USB disconnect, device number 4
usb 1-1: new high-speed USB device number 5 using ci_hdrc
usb 1-1: new high-speed USB device number 6 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host3: usb-storage 1-1:1.0
usb 1-1: USB disconnect, device number 6
usb 1-1: new high-speed USB device number 7 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host4: usb-storage 1-1:1.0
usb 1-1: USB disconnect, device number 7
usb 1-1: new high-speed USB device number 8 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host5: usb-storage 1-1:1.0
usb 1-1: USB disconnect, device number 8
usb 1-1: new high-speed USB device number 9 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host6: usb-storage 1-1:1.0
usb 1-1: USB disconnect, device number 9
usb 1-1: new high-speed USB device number 10 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host7: usb-storage 1-1:1.0

Change USB pen drive with Kingston :

usb 1-1: new high-speed USB device number 12 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host9: usb-storage 1-1:1.0
scsi 9:0:0:0: Direct-Access     Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
sd 9:0:0:0: Attached scsi generic sg0 type 0
sd 9:0:0:0: [sda] 15138816 512-byte logical blocks: (7.75 GB/7.21 GiB)
sd 9:0:0:0: [sda] Write Protect is off
sd 9:0:0:0: [sda] Mode Sense: 45 00 00 00
sd 9:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
usb 1-1: USB disconnect, device number 12
sd 9:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=0x01 driverbyte=0x00
sd 9:0:0:0: [sda] Sense not available.
sda: detected capacity change from 7751073792 to 0
sd 9:0:0:0: [sda] Attached SCSI removable disk
usb 1-1: new high-speed USB device number 13 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host10: usb-storage 1-1:1.0
scsi 10:0:0:0: Direct-Access     Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
sd 10:0:0:0: [sda] 15138816 512-byte logical blocks: (7.75 GB/7.21 GiB)
sd 10:0:0:0: Attached scsi generic sg0 type 0
sd 10:0:0:0: [sda] Write Protect is off
sd 10:0:0:0: [sda] Mode Sense: 45 00 00 00
sd 10:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
usb 1-1: USB disconnect, device number 13
sd 10:0:0:0: [sda] UNKNOWN(0x2003) Result: hostbyte=0x01 driverbyte=0x00
sd 10:0:0:0: [sda] CDB: opcode=0x28 28 00 00 00 00 00 00 00 08 00
blk_update_request: I/O error, dev sda, sector 0
Buffer I/O error on dev sda, logical block 0, async page read
 sda: unable to read partition table
sd 10:0:0:0: [sda] Attached SCSI removable disk
usb 1-1: new high-speed USB device number 14 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host11: usb-storage 1-1:1.0
usb 1-1: USB disconnect, device number 14
usb 1-1: new high-speed USB device number 15 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host12: usb-storage 1-1:1.0
scsi 12:0:0:0: Direct-Access     Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
sd 12:0:0:0: [sda] 15138816 512-byte logical blocks: (7.75 GB/7.21 GiB)
sd 12:0:0:0: Attached scsi generic sg0 type 0
sd 12:0:0:0: [sda] Write Protect is off
sd 12:0:0:0: [sda] Mode Sense: 45 00 00 00
sd 12:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1
sd 12:0:0:0: [sda] Attached SCSI removable disk

Change USB pen drive with other Kingston :

usb 1-1: new high-speed USB device number 16 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host13: usb-storage 1-1:1.0
usb 1-1: USB disconnect, device number 16
usb 1-1: new high-speed USB device number 17 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host14: usb-storage 1-1:1.0
scsi 14:0:0:0: Direct-Access     Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
sd 14:0:0:0: Attached scsi generic sg0 type 0
usb 1-1: USB disconnect, device number 17
sd 14:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=0x01 driverbyte=0x00
sd 14:0:0:0: [sda] Sense not available.
sd 14:0:0:0: [sda] Write Protect is off
sd 14:0:0:0: [sda] Mode Sense: 80 fe 4d dd
sd 14:0:0:0: [sda] No Caching mode page found
sd 14:0:0:0: [sda] Assuming drive cache: write through
sd 14:0:0:0: [sda] Attached SCSI removable disk
usb 1-1: new high-speed USB device number 18 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host15: usb-storage 1-1:1.0
usb 1-1: USB disconnect, device number 18
usb 1-1: new high-speed USB device number 19 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host16: usb-storage 1-1:1.0
usb 1-1: USB disconnect, device number 19
usb 1-1: new high-speed USB device number 20 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host17: usb-storage 1-1:1.0
scsi 17:0:0:0: Direct-Access     Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
sd 17:0:0:0: Attached scsi generic sg0 type 0

Unfortunately, with this "BSP Petalinux" I was not able to use any of my "USB pend drive" available.

I returned to my custom kernel and everything works (if I keep disconnected from the PC the Zybo PROG/USB serial port)

debugasm

Link to comment
Share on other sites

It seems like this is a hardware issue on your board, not with the software.

It is possible the problem lies with the capacitor used on C64. Can you try un-shorting JP2 and running the petalinux design again? This will effectively disconnect C64. Your USB thumbdrives should still work in this case, I have tested many thumb drives and they all worked without having C64 loaded.

Scoping the VBUS rail (at JP2 or C64 if JP2 is shorted) would also be a valuable test, as Elod mentioned.

Link to comment
Share on other sites

Hi sbobrowicz,

thanks for your advice

9 hours ago, sbobrowicz said:

It seems like this is a hardware issue on your board, not with the software.

It is possible the problem lies with the capacitor used on C64. Can you try un-shorting JP2 and running the petalinux design again? This will effectively disconnect C64. Your USB thumbdrives should still work in this case, I have tested many thumb drives and they all worked without having C64 loaded.

Scoping the VBUS rail (at JP2 or C64 if JP2 is shorted) would also be a valuable test, as Elod mentioned.

I'll try to make measurements and tests on hardware, but these are the result with my custom kernel.

After insert one of my Usb Pen Drive :

usb 1-1: new high-speed USB device number 2 using zynq-ehci
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1:1.0
scsi 0:0:0:0: Direct-Access              USB DISK         1100 PQ: 0 ANSI: 4
sd 0:0:0:0: Attached scsi generic sg0 type 0
sd 0:0:0:0: [sda] 15730688 512-byte logical blocks: (8.05 GB/7.50 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
sd 0:0:0:0: [sda] No Caching mode page found
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 0:0:0:0: [sda] Attached SCSI removable disk

Now I mount partition:

mkdir /media/pendrive 

mount -w -t vfat /dev/sda1 /media/pendrive 

ls -l /media/pendrive 

totale 1114112
-rwxr-xr-x 1 root root 1073741824 mag 10 19:42 largefile
-rwxr-xr-x 1 root root   67108864 mag 10 19:42 smallfile

And read test transfer speed :

dd if=/media/pendrive/smallfile of=/dev/null bs=8k
8192+0 record dentro
8192+0 record fuori
67108864 byte (67 MB) copiati, 2,72241 s, 24,7 MB/s

dd if=/media/pendrive/largefile of=/dev/null bs=8k
131072+0 record dentro
131072+0 record fuori
1073741824 byte (1,1 GB) copiati, 43,7348 s, 24,6 MB/s

And write test transfer speed :

dd if=/dev/zero of=/media/pendrive/test_write bs=8k count=8192
8192+0 record dentro
8192+0 record fuori
67108864 byte (67 MB) copiati, 1,08801 s, 61,7 MB/s

I believe that the hardware has nothing.

debugasm

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...