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: 
Highlighted
10,440 Views
Registered: ‎01-26-2016

Cannot start USB mass storage device on PetaLinux 2015.4

Jump to solution

I followed the instructions on http://www.wiki.xilinx.com/Zynq+Linux+USB+Device+Driver to configure the kernel, and set the device tree to "peripheral" mode. I built the image.ub, and boot it on my custom hardware.

 

Kernel initialization shows that the USB ULPI PHY can be properly detected.


ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

ehci-pci: EHCI PCI platform driver

usbcore: registered new interface driver usb-storage

ULPI transceiver vendor/product ID 0x0424/0x0007

Found SMSC USB3320 ULPI transceiver.

ULPI integrity check: passed.


 

 

After logging in, I follow the instructions under "Testing -> Device Mode -> Mass storage Gadget" to try to configure the USB as a USB peripheral mass storage device. I get the following:


petalinux-7814-10g login: root

Password:

login[892]: root login on 'ttyPS0'

root@petalinux-7814-10g:~# cd /lib/modules/4.0.0-xilinx/kernel/fs/configfs/

root@petalinux-7814-10g:/lib/modules/4.0.0-xilinx/kernel/fs/configfs# insmod configfs.ko

root@petalinux-7814-10g:/lib/modules/4.0.0-xilinx/kernel/fs/configfs# cd ../../drivers/usb/gadget/

root@petalinux-7814-10g:/lib/modules/4.0.0-xilinx/kernel/drivers/usb/gadget# insmod libcomposite.ko

root@petalinux-7814-10g:/lib/modules/4.0.0-xilinx/kernel/drivers/usb/gadget# cd function/

root@petalinux-7814-10g:/lib/modules/4.0.0-xilinx/kernel/drivers/usb/gadget/function# insmod usb_f_mass_storage.ko

root@petalinux-7814-10g:/lib/modules/4.0.0-xilinx/kernel/drivers/usb/gadget/function# dd if=/dev/zero of=/tmp/mydev count=10 bs=1M

10+0 records in

10+0 records out

root@petalinux-7814-10g:/lib/modules/4.0.0-xilinx/kernel/drivers/usb/gadget/function# mount -t configfs none /sys/kernel/config

root@petalinux-7814-10g:/lib/modules/4.0.0-xilinx/kernel/drivers/usb/gadget/function# cd /sys/kernel/config/usb_gadget

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# mkdir g1

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# echo "64" > bMaxPacketSize0

-sh: can't create bMaxPacketSize0: Permission denied

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# echo "0x200" > bcdUSB

-sh: can't create bcdUSB: Permission denied

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# echo "0x100" > bcdDevice

-sh: can't create bcdDevice: Permission denied

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# echo "0x03FD" > idVendor

-sh: can't create idVendor: Permission denied

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# echo "0x0500" > idProduct

-sh: can't create idProduct: Permission denied

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# mkdir functions/mass_storage.ms0

mkdir: can't create directory 'functions/mass_storage.ms0': No such file or directory

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# mkdir configs/c1.1

mkdir: can't create directory 'configs/c1.1': No such file or directory

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# echo /tmp/mydev > functions/mass_storage.ms0/lun.0/file

-sh: can't create functions/mass_storage.ms0/lun.0/file: nonexistent directory

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# echo 1 > functions/mass_storage.ms0/lun.0/removable

-sh: can't create functions/mass_storage.ms0/lun.0/removable: nonexistent directory

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# ln -s functions/mass_storage.ms0 configs/c1.1/

ln: configs/c1.1/: No such file or directory

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# echo "ci_hdrc.0" > UDC

-sh: can't create UDC: Permission denied


 

 

To try to debug, I tried to build a PetaLinux 2015.4 image.ub using the ZC702 BSP downloaded from http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools/2015-4.html. The default BSP config met the requirements specified in http://www.wiki.xilinx.com/Zynq+Linux+USB+Device+Driver. When I built image.ub, and ran on my ZC702 eval board, the kernel hangs after displaying at “zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xf0080000”. The image.ub that came with the eval board did not have the usb_f_mass_storage.ko module.

 

I would like to run the USB mass storage device on either my custom board or the ZC702, and have it be able to be recognized as a USB mass storage device on my PC.

 

Does anyone know what I am doing wrong?

 

Does anyone have a ZC702 image.ub that can run the USB mass storage device?

 

Is there an PetaLinux 2015.4 image.ub I can use on my ZC702 that will run the USB mass storage device

 

0 Kudos
1 Solution

Accepted Solutions
Explorer
Explorer
1,603 Views
Registered: ‎07-05-2017

Re: Cannot start USB mass storage device on PetaLinux 2015.4

Jump to solution

After

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# mkdir g1

you need to :

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# cd g1

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget/g1#

 

Then Continue ...

0 Kudos
3 Replies
Participant engsci
Participant
5,269 Views
Registered: ‎04-22-2016

Re: Cannot start USB mass storage device on PetaLinux 2015.4

Jump to solution

Did you find an answer to your problem eventually?

0 Kudos
5,259 Views
Registered: ‎01-26-2016

Re: Cannot start USB mass storage device on PetaLinux 2015.4

Jump to solution

There were a lot of typos in the Xilinx supplied documentation. I fed back a list of those typos. I have not checked to see if the docs have been updated.

0 Kudos
Explorer
Explorer
1,604 Views
Registered: ‎07-05-2017

Re: Cannot start USB mass storage device on PetaLinux 2015.4

Jump to solution

After

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# mkdir g1

you need to :

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget# cd g1

root@petalinux-7814-10g:/sys/kernel/config/usb_gadget/g1#

 

Then Continue ...

0 Kudos