OpenWrt/LEDE Project

  • Status Assigned
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Kernel
  • Assigned To
    Koen Vandeputte
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version openwrt-18.06
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Tim Kent - 13.05.2019
Last edited by Koen Vandeputte - 17.06.2019

FS#2279 - USB not working on MikroTik RB2011UAS-2HnD

Hi,

I’m not able to get USB to do anything on my MikroTik RB2011UAS-2HnD.

I have tried both the latest snapshot (OpenWrt SNAPSHOT r9987-655fff1571) and 18.06.2, both have the same issue. I have also asked a friend to test his RB2011 on 18.06.1 and we both had the same outcome.

Nothing about the USB controller is mentioned in the kernel log at bootup or when devices are added/removed.

The contents of /sys/kernel/debug/usb/devices is completely blank.

I’ve added the kernel bootup messages to this forum post:
https://forum.openwrt.org/t/usb-not-working-on-mikrotik-rb2011uas-2hnd/36585

Thank you for OpenWrt! :)

Project Manager
Koen Vandeputte commented on 21.05.2019 20:54

I'll take a look at it, but without any promises :)

Tim Kent commented on 03.06.2019 04:27

Thanks Koen, let me know how I can help!

Cheers

Project Manager
Petr Štetiar commented on 05.06.2019 10:30

Probably some GPIO pin needs to be enabled in order to provide 5V power to the USB port?

Project Manager
Koen Vandeputte commented on 05.06.2019 11:44

According to the MikroTik website, the port is meant to function in host mode.
I just checked it a few moments ago and my USB stick gets powered.

Project Manager
Koen Vandeputte commented on 05.06.2019 12:02

Here is the full bootlog with my USB stick attached. (master branch)

https://pastebin.com/Svf5p7mK

Interesting part:
[ 14.458838] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 14.475306] SCSI subsystem initialized
[ 14.484328] ehci-platform: EHCI generic platform driver
[ 14.489873] ehci-platform ehci-platform: EHCI Host Controller
[ 14.495864] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[ 14.506145] ehci-platform ehci-platform: TX-TX IDP fix enabled
[ 14.512183] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[ 14.545082] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[ 14.552388] hub 1-0:1.0: USB hub found
[ 14.556694] hub 1-0:1.0: 1 port detected
[ 14.565559] usbcore: registered new interface driver usb-storage
[ 14.925078] usb 1-1: new high-speed USB device number 2 using ehci-platform
[ 15.134234] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 15.141512] scsi host0: usb-storage 1-1:1.0
[ 15.776680] eth0: link up (1000Mbps/Full duplex)
[ 16.176026] scsi 0:0:0:0: Direct-Access SanDisk Cruzer 8.02 PQ: 0 ANSI: 0 CCS
[ 16.187356] sd 0:0:0:0: [sda] 7856127 512-byte logical blocks: (4.02 GB/3.75 GiB)
[ 16.195649] sd 0:0:0:0: [sda] Write Protect is off
[ 16.201054] sd 0:0:0:0: [sda] No Caching mode page found
[ 16.206609] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 16.264584] GPT:Primary header thinks Alt. header is not at the end of the disk.
[ 16.272282] GPT:1023999 != 7856126
[ 16.275805] GPT:Alternate GPT header not at the end of the disk.
[ 16.282024] GPT:1023999 != 7856126
[ 16.285543] GPT: Use GNU Parted to correct GPT errors.
[ 16.290946] sda: sda1 sda2
[ 16.297684] sd 0:0:0:0: [sda] Attached SCSI removable disk

So physically, it all looks OK.
This is on a custom build, i'll try using a plain openwrt installation after this.

Project Manager
Koen Vandeputte commented on 05.06.2019 12:50

Hi Tim,

I tested this on a plain OpenWRT installation (master branch) and the
USB port works as intended.

Could you kindly elaborate a bit on which device you are connecting to it?

The port (although it's micro-usb port) is intended to work in host mode,
meaning that you can use a micro-usb to USB-A cable and eg. attach a USB stick to it.

In case you want to connect the RB2011 to your computer or such you would need to make
a custom build and replace the standard USB behavior to DWC functionality.

Please let us know so we can conclude this ticket.

Appreciated,

Koen

Tim Kent commented on 05.06.2019 23:49

Hi Koen,

Thanks very much for your time on this. I'm using the MikroTik supplied USB OTG cable and I'm connecting this device to it:
https://www.adafruit.com/product/954 (USB to TTL Serial Cable, uses the cp210x driver)

I can try with another device, although I suspect it will not work as I don't get the relevant "ehci-platform" lines in my boot log like you do.

My router must be older than yours, it reports itself as a RouterBOARD 2011UAS-2HnD with AR9344 rev 2. I seem to recall in the code it has a case statement looking at the device strings (2011UAS-2HnD etc) and doing different initialisation for each. I was going to look at this next.

You can see my full boot log here:
https://forum.openwrt.org/t/usb-not-working-on-mikrotik-rb2011uas-2hnd/36585/4

Cheers

Project Manager
Koen Vandeputte commented on 06.06.2019 09:15

Hi Tim,

Thanks for the details!
The reason for checking with a USB stick is mainly to see if the port supplies power.
Using a stick with a LED indicator is very useful here.

I've checked the machtypes and init code for master and 18.06 branches, and your model should load load the USB init code path.

Project Manager
Koen Vandeputte commented on 06.06.2019 12:33

Tim,

As discussed on chat.
I found 2 of those devices, same like you have I think (at least de model in the bootstrings is identical)

Booting with a USB stick attached seems to work.

Full bootlog: https://pastebin.com/raw/Gb8jREZU

Regards,

Koen

Tim Kent commented on 16.06.2019 04:54

Hi Koen,

I have tried several USB devices now but have the same outcome, I would have assumed this is a hardware problem if it weren't for the fact my friend's RB2011 does the same thing!

Is it too much trouble for you to boot either 18.06.1 or 18.06.2 and ensure you get the same outcome?

Alternatively do you know of any potential changes between my snapshot of r9987-655fff1571 and the one you booted that may have an effect?

Are you using the MikroTik supplied USB OTG cable also?

Cheers!

Tim Kent commented on 16.06.2019 06:12

Instead I decided to update to latest snapshot (r10231-1fd900ddc2), and I can confirm USB is now working fine! :)

Sun Jun 16 16:09:24 2019 kern.info kernel: [  739.168507] cp210x 1-1:1.0: cp210x converter detected
Sun Jun 16 16:09:25 2019 kern.info kernel: [  739.250473] usb 1-1: cp210x converter now attached to ttyUSB0

Thanks again for your help!

Project Manager
Koen Vandeputte commented on 17.06.2019 22:12

Hi Tim,

Thanks for letting me know!
I'll check it on 18.06 when I have some time.

Enjoy your USB :)

Regards

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing