element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Avnet Boards General Microzed USB configuration for petalinux 2018
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 10 replies
  • Answers 1 answer
  • Subscribers 343 subscribers
  • Views 3296 views
  • Users 0 members are here
  • iiot
  • microzed
  • industrial_iot
  • petalinux
  • usb
  • microzed_iiot
  • zynq-7000 soc
Related

Microzed USB configuration for petalinux 2018

maldata
maldata over 6 years ago

Hi all,

 

I can see many discussions in the forums about getting USB host-mode working on a Microzed (Zynq 7020). In particular, here's a selection of links that I've already read:

 

  • http://zedboard.org/content/usb-host-microzed-petalinux-20172
  • http://zedboard.org/zh-hant/node/8651
  • https://forums.xilinx.com/t5/Embedded-Processor-System-Design/Cannot-get-USB-to-work-on-microzed-7010-with-arch-linux-using/td-p/652816
  • http://zedboard.org/content/access-usb-microzed-board
  • https://forums.xilinx.com/t5/Embedded-Linux/Petalinux-2015-2-1-usb-not-working/td-p/654349
  • https://forums.xilinx.com/t5/Embedded-Linux/USB-works-in-device-mode-but-not-in-host-mode/td-p/679097

 

I've spent a lot of time googling, but have so far not been successful. I'm using Petalinux 2018 and the Zedboard metadata layers to build the image. I added a device tree layer similar to what is presented here: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842272/Zynq+Linux+USB+Device+Driver

 

By itself, that doesn't work. No USB bus is available. However, I changed the bus's "compatible" property and moved "drv-vbus" from the phy to the bus itself, so now I have

 

/ {

    usb_phy0: phy0 {

        compatible = "usb-nop-xceiv";

        #phy-cells = <0>;

        reg = <0xe0002000 0x1000>;

        view-port = <0x170>;

    };

};

 

&usb0 {

    dr_mode = "host";

    usb-phy = <&usb_phy0>;

    drv-vbus;

};

 

When I use this device tree, the USB bus appears to be available:

 

# lsusb

Bus 001 Device 001: ID 1d6b:0002

# dmesg | grep -i usb

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

usb_phy_generic e0002000.phy0: e0002000.phy0 supply vcc not found, using dummy regulator

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

usbcore: registered new interface driver usb-storage

chipidea-usb2 e0002000.usb: e0002000.usb supply vbus not found, using dummy regulator

ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1

ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00

hub 1-0:1.0: USB hub found

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

 

However, the board still does not recognize any USB devices plugged into it. If I plug in a USB flash drive, for example, the LED on the drive does light up, but nothing new is available in lsusb, no new messages appear in dmesg, and no new block device appears in /dev.

 

I've tried everything in the links above, I've tried different USB devices, I've tried a powered USB hub, and all I can figure is that there's still some device between the OS and the port that isn't configured correctly. In particular, I'd like to know more about the following:

 

  • Is there a requirement to toggle the reset on the USB3320 chip after power comes up? I have seen some mention of this in similar posts.
    • Sometimes this is handled by the first-stage bootloader. Can AVnet confirm?
    • If not the first-stage bootloader, does this need to be done some other way?
  • Does USB need to be enabled by setting a GPIO? If so, which GPIO?
  • In older versions of the linux kernel/device tree, a USB PHY configuration was not needed. Now, a PHY element must be added to the device tree in order for the system to recognize the USB root hub. This is not done in the stock Zynq-7000 metadata.
    • Can you confirm that usb-nop-xceiv is appropriate for this PHY?
    • Does the PHY require configuration of clocks or regulators in order to function correctly?
  • When USB devices are inserted, the kernel does not fire uevents. Is there any configuration beyond default that is needed to enable this, or is there a hardware/device tree configuration issue blocking this?
    • In the current configuration, the EHCI is correctly detected
    • Is there any kernel configuration required to ensure that hub IRQs are handled correctly?
    • Is there any kernel configuration required to ensure that hub events are handled correctly?

 

Has anyone managed to get this working on a Microzed, and if so, can you share your method?

 

Thanks!

  • Sign in to reply
  • Cancel
Parents
  • zedhed
    0 zedhed over 6 years ago

    Hi Mark,

     

    I see you have a lot of rather complex questions you are asking about USB which is something that appears to have not yet been demonstrated to work on your end with your MicroZed  Let's try to simplify this a bit and start from something that is known to work and then perhaps you can spiral out from there changing one variable at a time to see what works and what step breaks things.  At a minimum, this approach should at least tell us that you have good hardware you are working with.

     

    On my desk I have a MicroZed 7020 plugged into an FMC Carrier and powered off a 6-pin 12V power supply.  I am booting from bootable files that come from the pre-built PetaLinux image found withing the 2018.2 BSP from the MicroZed resource page here:

     

    MicroZed

     

    On that page, there is a section labeled PetaLinux Board Support Packages where I found this file:

     

    mz7020_fmccc_2018_2_0.zip

     

    You can unpack the archive and use this PetaLinux BSP according to Xilinx UG1144 to create new PetaLinux projects that are already targeted to MicroZed hardware:

     

    https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_2/ug1144-petalinux-tools-reference-guide.pdf

     

    Without needing to build a new PetaLinux 2018.2 project, you can simply use the pre-built files found in the /pre-built/linux/images/ folder and copy them to an SD card and boot MicroZed using SD card boot mode.

     

    When I tried this on my end, I was able to enumerate a USB thumb drive that was formatted with FAT32, mount the drive, write to a test file, unmount the drive, remount the drive, and read the contents of the test file back as seen here:

     

    3302.contentimage_192676.png

    My suggestion is to try to replicate this on your end and rule out any bad hardware.  Keep in mind that if you do not have MicroZed plugged into a carrier board and it is only being powered off the USB-UART port, then there may not be sufficient power supplied to the USB Host port (from your PC) and this can cause strange behaviors like the LED blinking on an attached USB thumb drive but the drive is not enumerated.

     

    Once you get the USB working, you can look through the BSP settings and see what sort of device tree entries are being used for our MicroZed targets for PetaLinux 2018.2 tools.

     

    I have a few follow-up questions for you.  It sounds like you are working on a new design, are you working with a local Avnet FAE on your new design?

     

    Best Regards,

     

    -Kevin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • maldata
    0 maldata over 6 years ago in reply to zedhed

    Actually, the kernel configuration is also virtually identical to the sample. Still nothing. Root hub exists, but devices are not detected when attached.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jafoste4
    0 jafoste4 over 6 years ago in reply to maldata

    Hi Mark,

     

    Is there an issue with starting from the known good working BSP we provide and adding in what you need for your end application?

     

    -Josh

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • jafoste4
    0 jafoste4 over 6 years ago in reply to maldata

    Hi Mark,

     

    Is there an issue with starting from the known good working BSP we provide and adding in what you need for your end application?

     

    -Josh

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube