USB devices not detected (Orange Pi R1)

I am trying OpenWrt on an OrangePi R1 board with a Expansion board with two usb hubs.

Image file in the vendor site at http://www.orangepi.org/downloadresources/ is pretty outdated but when I use it, my USB Alfa (AWUS036NH) card get detected and create a wlan interface which works fine.

with the latest image (19.07.2) from openwrt download page (sun8i-h2-plus-orangepi-r1-ext4-sdcard.img.gz), anything I plug in to the USB is not getting detected. lsusb output is like this.

---Vendor image---
root@OpenWrt:~# lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 148f:3070 Ralink Technology, Corp. RT2870/RT3070 Wireless Adapter
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0bda:8152 Realtek Semiconductor Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

---OpenWrt Image---
root@OpenWrt:~# lsusb
Bus 003 Device 002: ID 0bda:8152 Realtek Semiconductor Corp. RTL8152 Fast Ethernet Adapter
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I have tried...

  1. going back on few versions on the images from OpenWrt download site includion version 18
  2. mimicking the usb packages installed in the vendor image to the OpenWrt image and rebooting the device

what should I do to get the usb port detecting the things that are plugged in to them in my Orange Pi R1? should this require a kernel modification?

See

So you can enable additional usb and rebuild image or try to recompile only dtb file:

dtc -I dtb -O dts -o r1.dts dtb

Then change status for additional ehci/ohci controolers from "disabled" to "okay" and compile dtb again:

dtc -I dts -O dtb -o dtb r1.dts
1 Like

Thanks for that, I have a build environment configured and ran a successful compile for the Orange Pi R1. Now I have two new problems.

  1. Device Tree is pretty new to me and I start looking up for it after the previous reply.
  • should I be using the binary generated by the build at ./package/feeds/packages/dtc for this?

  • I only found the following two paths with the name dtb in it but the header files in there are empty. Where should I be looking for the relevent device tree configurations for the board?

./build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-sunxi_cortexa7/linux-5.4.28/include/config/arm/atag/dtb
./build_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/linux-5.4.28/include/config/efi/armstub/dtb
  1. the build with the default configurations for the board (I have selected this correctly in menuconfig) compiles without errors but does not bring up the board. is there a way for me to get the .conf file used for the builds available in the download page?
Target System (Allwinner A1x/A20/A3x/R40)
Subtarget (Allwinner A20/A3x/R40)
Target Profile (Xunlong Orange Pi R1)

Will I have to move this question to developer section?

Let's do more simple method.

  1. Install last stable release from here
  2. Connect to internet and install dtc:
opkg update
opkg install dtc
  1. Mount boot partition:
mount /dev/mmcblk0p1 /mnt
  1. Backup original dtb-file and decompile it into dts-file:
cd /root
cp /mnt/dtb /root/orig.dtb
dtc -I dtb -O dts -o new.dts orig.dtb
  1. Open new.dts with editor (I use vi), find disabled usb controllers and enable its (change status from "disabled" to "okay"), e.g.:
                usb@01c1c000 {                                             
                        compatible = "allwinner,sun8i-h3-ehci\0generic-ehci";  
                        reg = <0x1c1c000 0x100>;                           
                        interrupts = <0x00 0x4c 0x04>;                                 
                        clocks = <0x02 0x23 0x02 0x27>;          
                        resets = <0x02 0x14 0x02 0x18>;
                        phys = <0x09 0x02>;                       
                        phy-names = "usb";             
                        status = "disabled";
                };

After enabling:

                usb@01c1c000 {                                             
                        compatible = "allwinner,sun8i-h3-ehci\0generic-ehci";  
                        reg = <0x1c1c000 0x100>;                           
                        interrupts = <0x00 0x4c 0x04>;                                 
                        clocks = <0x02 0x23 0x02 0x27>;          
                        resets = <0x02 0x14 0x02 0x18>;
                        phys = <0x09 0x02>;                       
                        phy-names = "usb";             
                        status = "okay";
                };

And so on for controllers usb@01c1c400 usb@01c1d000 usb@01c1d400.
6. Compile dts-file back to dtb-file and copy to boot partition:

dtc -I dts -O dtb -o new.dtb new.dts
cp new.dtb /mnt/dtb
  1. Umount boot partition and reboot:
umount /mnt
reboot

That's all :slight_smile:

Thank you very much. Works like a charm. I can work with this information and try to compile from the source with the GPIOs turned on.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.