Jump to content
  • 0

Arty Z7 USB


jacobfeder

Question

Hi, I'm trying to use a USB wifi dongle on the Arty Z7 (Z020). I followed instructions here:

http://www.wiki.xilinx.com/Zynq+Linux+USB+Device+Driver

as well as trying many other driver combinations (I also tried enabling host mode only). Still, I'm not able to detect any connected USB devices (nothing happens in lsusb or dmesg when devices are connected / disconnected). In U-boot I am able to detect usb devices using "usb start" and "usb info".

Any ideas?

 

Thanks

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

What about USB Flash drives, do those work in Linux? The Wifi dongles require building in some drivers and adding firmware images to the rootfs, so this will help indicate if the problem is with your device tree config.

Also, have you tried using this project? 

https://github.com/Digilent/Petalinux-Arty-Z7-20

That might be an easier starting point for you because the USB host functionality is validated already. I can also help you build in the needed drivers and firmware.

Link to comment
Share on other sites

Thanks for the reply. USB flash drives also do not work. My intuition is that the problem has to do with Petalinux trying to make it function as device / host / OTG rather than host only. I have tried disabling the OTG / device drivers in the kernel config but that didn't do it. I will compare the github project to my own and see if I can find any significant differences.

 

Thanks again!

Jacob

Link to comment
Share on other sites

Ok, I gave this a try and still wasn't able to get it working. I tried adding the following to "project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi" which were present in the github petalinux project that you linked.

/include/ "system-conf.dtsi"
/ {
    usb_phy0: usb_phy@0 {
        compatible = "ulpi-phy";
        #phy-cells = <0>;
        reg = <0xe0002000 0x1000>;
        view-port = <0x0170>;
        drv-vbus;
    };
};

&usb0 {    
    usb-phy = <&usb_phy0>;
    dr_mode = "host";
    /delete-property/ usb-reset;
};

I checked the menuconfig files but there didn't seem to be any significant differences relating to USB although there were many changes (just due to using different kernel versions).

Any other ideas? I'm sort of at a loss for how to debug this.

 

Thanks,

Jacob

Link to comment
Share on other sites

Actually this did fix the USB bus .... :) I made a mistake including the file into my project. If you add those lines to system-user.dtsi the USB system works.

 

However, now I am having a problem getting the wifi driver working. The device is a Realtek RTL8188CUS. I included the following drivers with petalinux-config -c kernel:

- Networking support -> Wireless -> cfg80211

- Networking support -> Wireless -> Generic IEEE 802.11 Networking Stack

- Device Drivers -> Network device support -> Wireless LAN -> Realtek tflwifi family of devices -> Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter

- Device Drivers -> Network device support -> Wireless LAN -> RTL8723AU/RTL8188[CR]U/RTL819[12]CU (mac80211) support

- Device Drivers -> Network device support -> Wireless LAN -> Include support for untested Realtek 8xxx USB devices (EXPERIMENTAL)

 

After booting lsusb reports:

Bus 001 Device 002: ID 7392:7811

 

Which is the device. However, the driver doesn't appear to be loading properly:

root@default_linux:~# dmesg | grep usb
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
usbcore: registered new interface driver rtl8192cu
usbcore: registered new interface driver rtl8xxxu
usbcore: registered new interface driver usb-storage
chipidea-usb2 e0002000.usb: e0002000.usb supply vbus not found, using dummy regulator
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
usb 1-1: new high-speed USB device number 2 using ci_hdrc
rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1
usb 1-1: Direct firmware load for rtlwifi/rtl8192cufw_TMSC.bin failed with error -2
usb 1-1: Direct firmware load for rtlwifi/rtl8192cufw.bin failed with error -2

 

If I don't include

- Device Drivers -> Network device support -> Wireless LAN -> Include support for untested Realtek 8xxx USB devices (EXPERIMENTAL)

I get:

root@default_linux:~# dmesg | grep usb
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
usbcore: registered new interface driver rtl8xxxu
usbcore: registered new interface driver usb-storage
chipidea-usb2 e0002000.usb: e0002000.usb supply vbus not found, using dummy regulator
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
usb 1-1: new high-speed USB device number 2 using ci_hdrc

 

Any ideas?

 

Thanks,

Jacob

Link to comment
Share on other sites

@jacobfeder 

USB wifi drivers tend to require there to be firmware blobs installed into your rootfs at /lib/firmware. The drivers use these blobs to configure the proprietary SoC's in the wifi dongle. In your case, you need "/lib/firmware/rtlwifi/rtl8192cufw_TMSC.bin" and/or "/lib/firmware/rtlwifi/rtl8192cufw.bin" to be present.

You can find these files in the linux-firmware package, which can be installed from standard linux distros using apt-get, dnf, yum, etc., and then simply copy them to where they need to be on your rootfs. If you are using petalinux, you could build a simple app that copies the files into the rootfs during the build process, which might be most convenient in the long run. A third option is to find a yocto recipe out there for linux-firmware and just point your project towards it (UG1144 describes how to do this). 

Link to comment
Share on other sites

Thanks!! This did it (firmware files were already present in my host machine's /lib/firmware). I also had to enable wpa-supplicant and wpa-supplicant-cli in the rootfs in order to connect to the wireless network.

 

Thanks again.

 

Cheers,

Jacob

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...