USB storage not being detected

Hi.
i am using openwrt on a hlk-7628n device. I want to use a usb pendrive for additional storage, and have been following this.
However i am coming across an interesting problem:

root@OpenWrt:/# lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=, Driver=hub/4p, 480M
        |__ Port 1: Dev 3, If 0, Class=, Driver=, 12M

in this case the tutorial says that the pendrive being plugged in is being recognized, but there is no driver - i do not think this is the case, because i have the drivers:

root@OpenWrt:/# opkg install kmod-usb-storage
Package kmod-usb-storage (5.10.176-1) installed in root is up to date.
root@OpenWrt:/# opkg list-installed | grep usb
kmod-usb-core - 5.10.176-1
kmod-usb-ehci - 5.10.176-1
kmod-usb-ohci - 5.10.176-1
kmod-usb-storage - 5.10.176-1
kmod-usb-storage-extras - 5.10.176-1
kmod-usb-storage-uas - 5.10.176-1
kmod-usb-uhci - 5.10.176-1
kmod-usb-xhci-hcd - 5.10.176-1
kmod-usb2 - 5.10.176-1
kmod-usb2-pci - 5.10.176-1
kmod-usb3 - 5.10.176-1
libusb-1.0-0 - 1.0.24-5
usbutils - 014-1
root@OpenWrt:/# 

here is some dmesg output that might be relevant:

root@OpenWrt:/# dmesg | grep usb
[    4.562835] usbcore: registered new interface driver usbfs
[    4.573884] usbcore: registered new interface driver hub
[    4.584518] usbcore: registered new device driver usb
[    4.677705] phy phy-10120000.usbphy.0: remote usb device wakeup disabled
[    4.690995] phy phy-10120000.usbphy.0: UTMI 16bit 30MHz
[    5.022700] usbcore: registered new interface driver usb-storage
[    5.038883] usbcore: registered new interface driver uas
[    5.097820] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    6.747626] usb 1-1.1: new full-speed USB device number 3 using ehci-platform
[   17.953420] usbcore: registered new interface driver ums-alauda
[   17.988982] usbcore: registered new interface driver ums-cypress
[   18.019107] usbcore: registered new interface driver ums-datafab
[   18.048996] usbcore: registered new interface driver ums-freecom
[   18.079069] usbcore: registered new interface driver ums-isd200
[   18.109187] usbcore: registered new interface driver ums-jumpshot
[   18.139054] usbcore: registered new interface driver ums-karma
[   18.169465] usbcore: registered new interface driver ums-sddr09
[   18.215857] usbcore: registered new interface driver ums-sddr55
[   18.232034] usbcore: registered new interface driver ums-usbat
root@OpenWrt:/# 

if anyone has ideas on how i could get the pendrive to show up on lsblk, i would appreciate them.

Thanks and have a nice day :slight_smile:

edit: i think this comment might contain additional important information, so i will link it here

You don't just need the USB hardware drivers, but also the requires filesystem modules (vfat or exfat).

i already had these two:

root@OpenWrt:/# opkg list-installed | grep vfat
kmod-fs-vfat - 5.10.176-1
root@OpenWrt:/# opkg list-installed | grep ext4
kmod-fs-ext4 - 5.10.176-1
root@OpenWrt:/# 

is this what You had in mind?
also some additional (maybe useful?) info is that no matter if i plug in the usb pendrive or not, the output of dmesg/lsusb -t remains the same :confused:

There's no /dev/sd? being created/logged when you insert the pendrive ?

precisely. And i have tried multiple different pendrives that get detected on my host pc just fine, so its not a faulty pendrive

You also need the scsi drivers. whatever supplies sd_mod.ko & load it. I assume either kmod-scsi-cdrom or kmod-scsi-core.

Have a look at https://openwrt.org/docs/techref/block_mount too.
But probably not needed in your case though.

Try another USB port, too.

1 Like

i have those:

root@OpenWrt:/# opkg list-installed | grep scsi
kmod-scsi-core - 5.10.176-1
root@OpenWrt:/# 

Yes, but is sd_mod being loaded?

Did you reboot post package installs?

i think so:

root@OpenWrt:/# insmod sd_mod
module is already loaded - sd_mod
root@OpenWrt:/# lsmod | grep -F "sd_mod"
scsi_mod               93803  4 ums_cypress,uas,usb_storage,sd_mod
sd_mod                 30311  0 
root@OpenWrt:/# 

yes, i did reboot after installing the packages

2 Likes

what worries me the most is that no matter what pendrive is plugged into which port (there are 2 available) lsusb -t and dmesg output remains the same.

i was thinking that maybe the .dts file that is used to build the image is maybe not defined properly for the device that i have? Because when i check with fdtdump /sys/firmware/fdt, there doesnt seem to be much of anything related to usb (simple ctrl f and check for "usb" on the fdtdump output), only this:

usbphy@10120000 {
        compatible = "mediatek,mt7628-usbphy", "mediatek,mt7620-usbphy";
        reg = <0x10120000 0x00001000>;
        #phy-cells = <0x00000000>;
        ralink,sysctl = <0x0000000d>;
        resets = <0x00000001 0x00000016 0x00000001 0x00000019>;
        reset-names = "host", "device";
        clocks = <0x0000000e 0x00000016 0x0000000e 0x00000019>;
        clock-names = "host", "device";
        status = "okay";
        phandle = <0x00000010>;
    };

and those two:

    ehci@101c0000 {
        #address-cells = <0x00000001>;
        #size-cells = <0x00000000>;
        compatible = "generic-ehci";
        reg = <0x101c0000 0x00001000>;
        phys = <0x00000010>;
        phy-names = "usb";
        interrupt-parent = <0x00000002>;
        interrupts = <0x00000012>;
        status = "okay";
        port@1 {
            reg = <0x00000001>;
            #trigger-source-cells = <0x00000000>;
        };
    };
    ohci@101c1000 {
        #address-cells = <0x00000001>;
        #size-cells = <0x00000000>;
        compatible = "generic-ohci";
        reg = <0x101c1000 0x00001000>;
        phys = <0x00000010>;
        phy-names = "usb";
        interrupt-parent = <0x00000002>;
        interrupts = <0x00000012>;
        status = "okay";
        port@1 {
            reg = <0x00000001>;
            #trigger-source-cells = <0x00000000>;
        };
    };

Just a shot in the blue sky: do the USB ports deliver enough power?

2 Likes

hmm maybe??? how would i go about checking that? some multimeter?

That's why you were told to try other ports...

Something like this

1 Like

the usb port wasnt getting power all along. I had to edit the dts file in openwrt repo, then build a new image so that the pins that supply power to the usb port actually work.

2 Likes

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