Jump to content
  • 0

USB 2.0 OTG on Zybo Z7


mbritton

Question

Hello:

 

I would like to operate a Zybo z7-20 board as a USB gadget device and communicate via a linux gadget driver from a host computer running Ubuntu 20.04.  From the zybo reference manual:

 

9 USB Host/OTG

The Zybo Z7 implements one of the two available PS USB OTG interfaces on the Zynq device. A Microchip USB3320 USB 2.0 Transceiver Chip with an 8-bit ULPI interface is used as the PHY. The PHY features a complete HS-USB Physical Front-End supporting speeds of up to 480Mbs. The PHY is connected to MIO Bank 1/501, which is powered at 1.8V. The usb0 peripheral is used on the PS, connected through MIO[28-39]. The USB OTG interface can act as an embedded host or a peripheral device. The USB mode is controlled from software by manipulating the USB0 peripheral controller in the Zynq PS. When acting as a peripheral, the USB Micro AB connector (J10) should be used to connect to a USB host device, and JP1 and JP2 should not be shorted.

 

I compiled the petalinux kernel and root filesystem using default settings for USB support, transferred these to the board via microSD, connected J10 to the host PC via a USB cable, and powered the board. 

On the petalinux side, I expected to see an entry in /dev like /dev/ttyUSB0 that indicates the USB2.0 is available.  Attached is a screenshot of the /dev directory.  There's an entry /dev/ttyPS0, which I think associates to the jtag port.

On the ubuntu side, I expected lsusb to indicate a bus/device pair associated with the zybo board.   Attached is a screenshot of the output of lsusb on the ubuntu machine.  The FTDI entry is present only when the zybo board is powered, but I'm uncertain as to whether this entry is associated with the jtab port.

The third screenshot displays output of lsmod and `modprobe -l | grep -i usb` on the petalinux side.  I think the presence of gadget drivers should indicate that the usb driver is present in the kernel.

I'm confused about how to proceed:  have I correctly compiled USB gadget support into the petalinux kernel, and if so why don't I see a /dev entry on the petalinux side and a bus/device enumeration on the ubuntu side?  Or am I simply misinterpreting the output attached below?

 

Many thanks
Matthew

 

 

petalinuxDevDir.png

ubuntulsusb.png

petalinuxLsusbModprobe.png

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

JColvin:


Thank you for your note.

I neglected to mention in my original email that I'm trying to obtain the ethernet gadget driver.  I made a little more progress by following instructions for the ethernet gadget driver here:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/2046001302/Building+Linux+usb+device+drivers+with+2021.1

 

I followed the 2021.1 recipe, but am using petalinux 2022.1 in my compilation. 

- The first attachment shows usb-related additions to the bsp.cfg file. 

- The second attachment shows additions to the system-user.dtsi file. 

- The third and fourth attachments show the output from the 'petalinux-build -c kernel' invocation.  The most important output I see is the message "Label or path dwc3_0 not found".

 

Many thanks

Matthew

 

 

 

 

 

bspCfg.png

systemUserDtsi.png

petalinuxBuildKernel.png

petalinuxBuildKernel2.png

Link to comment
Share on other sites

  • 0

Trying once more...

 

Added the ethernet gadget device tree entry from this site to provide a definition for dwc3_0:

 

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841729/Zynq+Ultrascale+MPSOC+Linux+USB+device+driver#ZynqUltrascaleMPSOCLinuxUSBdevicedriver-EthernetGadget

 

Attached screenshots show system-user.dtsi and the resulting syntax error from petalinux-build -c kernel.

 

Many thanks

Matthew

systemUserDtsiV2.png

petalinuxBuildKernel2.png

Link to comment
Share on other sites

  • 0

@mbritton HI

quick check: Have you place the host jumper near the usb port on the board?

In your second attempt you have a syntax error in your device tree(system-user.dtsi). You can find the exact issue in petalinux lol, not visible in image you attached(in a previous text line maybe)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...