dspsandbox / Pynq-Cora-Z7-07S

2 stars 2 forks source link

USB host not working #1

Open matangk opened 3 years ago

matangk commented 3 years ago

Hi, Thanks for the effort to put this manual/image together. I just downloaded and installed the image on my Cora z7. Jupiter notebook works nicely, but the USB A seems to be non-functional. I looked in the base design Vivado project and it seems to be connected. Any hint why that might be? Best,

dspsandbox commented 3 years ago

Hi, I am glad that the Pynq image works for you. Regarding your questions:

I hope this helps :)

Cheers, Pau

matangk commented 3 years ago

Hi, Yes, I noticed that the USB is connected through the PS. No reason for it not to work. It's not the power supply. I tried with both PC and external supply and no-go. In my experience there's usually no problem in working with PC power for low-power devices attached to the host (e.g. Arduino). The min. 100mA from a USB socket is plenty.

I did solve this issue by rebuilding PYNQ using your git repo project (great work by the way). I do have some limited experience with installing Vivado and Petalinux.

Eventually, what solved the issue is one of two things, not sure which:

  1. I built PYNQ 2.5.1, but still used the board agnostic image and tarball of 2.5.
  2. I added another config file: system-user.dtsi in the following location (similar to the example pre-built boards): ./Pynq-Cora-Z7-07S/petalinux_bsp/meta-user/recipes-bsp/device-tree/files/system-user.dtsi

Its content is meant to take care of ethernet and USB:

/include/ "system-conf.dtsi"
/ {
    model = "Zynq Cora Z7 Development Board";
    compatible = "digilent,zynq-coraz7", "xlnx,zynq-7000";

    usb_phy0: phy0@e0002000 {
        compatible = "ulpi-phy";
        #phy-cells = <0>;
        reg = <0xe0002000 0x1000>;
        view-port = <0x0170>;
        drv-vbus;
    };

};

&gem0 {
    phy-handle = <&ethernet_phy>;
    /*phy-reset-gpio = <&gpio0 GPIO_ACTIVE_LOW>;
    phy-reset-active-low;   
    phy-reset-duration = <10>;  */
    ethernet_phy: ethernet-phy@1 { /* rtl8211e-vl */
            reg = <1>;
        device_type = "ethernet-phy";
    };
};
&usb0 { 
    dr_mode = "host";
    usb-phy = <&usb_phy0>;
};

I saw some forum remark that said it solved their issue, so I took it from Digilent's Petalinux example here: https://github.com/Digilent/Petalinux-Cora-Z7-07S/tree/master/Cora-Z7-07S/project-spec/meta-user/recipes-bsp/device-tree/files

You're welcome to try it and tell me if you see any difference. Anyway, as far as it looks like problem solved! Cheers, Matan

dspsandbox commented 3 years ago

Hi Matan, thanks for sharing your findings. I believe that changing the device-tree (.dtsi) to include the configuration for USB0 was the key. I will definitely try the same approach on my end and see if I can also get USB0 to work. Best regards, Pau