Jump to content

Orange Pi Zero, dev kernel does not see expansion USB ports


Stanislav Sinyagin

Recommended Posts

Orange Pi Zero with the small expansion board (2x USB, audio out, mic, IR). Legacy 3.4.113-sun8i  kernel sees all USB hubs, and the USB ports on the expansion board work fine:

root@orangepizero:~# 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 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

With the nightly build, the number of root hubs is less, and also the expansion board USB ports give only power, but no USB signaling:

root@orangepizero:~# lsusb
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 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 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I guess it's the same story as with wifi driver...

Link to comment
Share on other sites

10 hours ago, Stanislav Sinyagin said:

I guess it's the same story as with wifi driver...

Care to elaborate on this 'story' a bit?

 

Regarding USB ports it's a decision made by upstream kernel maintainers to not enable anything that's not directly present on the board. We used a patch months ago that enabled the USB ports on all those small H2+/H3 boards but in the meantime Zador rearranged everything as DT overlays. So this is where you should look for (remember: Nightly images are for developers who know what they do and who want to help improve things)

Link to comment
Share on other sites

6 hours ago, tkaiser said:

Care to elaborate on this 'story' a bit?

I was referring to the fact that the vendor delivered a poorly documented piece of hardware with a binary module for Linux kernel. I thought it's the same issue here.

6 hours ago, tkaiser said:

Regarding USB ports it's a decision made by upstream kernel maintainers to not enable anything that's not directly present on the board. We used a patch months ago that enabled the USB ports on all those small H2+/H3 boards but in the meantime Zador rearranged everything as DT overlays. So this is where you should look for (remember: Nightly images are for developers who know what they do and who want to help improve things)

 

actually these expansion USB ports are kind of "on the board", if you look at this set. So far, it's the only enclosure available for OPI0, so people will assume that those expansion USB ports are in by default.

 

I am actually a software developer, and also contributed to a Linux driver with a patch back in 1997. Currently I'm evaluating OPI0 if it can fit into my projects as a low-cost network agent. For example, connect to OpenVPN and provide remote console access via USB-to-Serial. I already discovered that WiFi hardware is quite poor, and the connection is too shaky for an interactive session. But if I disable Wifi interface, it's quite a useful piece of hardware for its price. But of course, it would be nice to have all USB ports active :-)

 

Link to comment
Share on other sites

1 hour ago, Stanislav Sinyagin said:

actually these expansion USB ports are kind of "on the board"

It was discussed before, from kernel maintainers perspective this is a separate extension board, so it needs to be handled with a DT overlay.

 

And from our perspective mainline kernel for H3 boards is not ready for end users yet, and DT overlays related info is not final yet - so we may have a single overlay for the expansion board or separate overlays for audio and each USB host port (or both variants together), overlay names and activation mechanism may change too more than one time before any official images with mainline kernel are released (so kernel and/or u-boot upgrade may break due to these changes).

 

So until then there will be little or no help with dev kernel for H3 devices - we already have too much outdated info on the forums that can be easily found via search engines.

Link to comment
Share on other sites

Zador, tkaiser, thanks a lot, it helped adding

overlays=sun8i-h3-usbhost2 sun8i-h3-usbhost3

into /boot/armbianEnv.txt and rebooting. DISCLAIMER: the overlay names may change as the development goes on.

 

Of course I realize it's a development kernel, and I'm not going to use it for any production installations. But as I'm evaluating the platform in general, I prefer using the latest development software. Do you feel comfortable if I report any issues in the same format on this forum? It's in my habit to report bugs or thought-to-be-bugs :)

 

Link to comment
Share on other sites

On 6.3.2017 at 8:23 AM, Stanislav Sinyagin said:

is there a way to have an overlay that disables the WiFi chip completely, to save power?

Not that I know of but you could try sunxi-pio utility to disable power. Why would you want to solder something for a serial console? Isn't the debug pin header populated?

Link to comment
Share on other sites

1 minute ago, tkaiser said:

Why would you want to solder something for a serial console? Isn't the debug pin header populated?

I have an old Nokia USB cable that ends with 3 wires for the UART interface. I thought to solder a plug on them, but then I found a nice console cable for less than $2 on Aliexpress :)

 

I'll try playing with the power, thanks

Link to comment
Share on other sites

On 3/27/2017 at 0:42 AM, Stanislav Sinyagin said:

As now /boot/armbianEnv.txt contains the line "overlay_prefix=sun8i-h3", the string above does not work, and it needs to look like follows:


overlays=usbhost2 usbhost3

 

 

Did this change work for you ? Are you using the expansion board?

 

Just tried on fresh image ARMBIAN 5.32 user-built Ubuntu 16.04.3 LTS 4.11.12-sun8i but the board freezes when i insert a usb device and restart when i remove

Link to comment
Share on other sites

Be aware that OPi Zero NAS expansion board has 2 USB connectors, but only the one at the center is a real USB host.

The other USB connectors at left near the barrel power DC is a USB Input to allow connecting the USB Hub to Non-Zero boards with a Male-Male cable.

Plugging anything in this USB Input on a OPiZero is somehow shorting the whole hub which is already connected thru the pins header.

 

Link to comment
Share on other sites

20 minutes ago, martinayotte said:

Plugging anything in this USB Input on a OPiZero is somehow shorting the whole hub which is already connected thru the pins header.

 

Huh? Which hub?

 

There's some logic on the Expansion board and in the JMS578:

  • if there's no SATA device connected to JMS578 it's configured to not show up on the bus (consumption also lower, most probably since the SATA PHY is unpowered in this mode?)
  • if a (m)SATA device is connected JMS578 activates itself and shows up on the USB bus. The mSATA slot is usb2, SATA slot is usb3
  • but if an USB peripheral is connected to one of the 2 USB receptacles the respective JMS578 disappears from the bus and the externally connected USB device 'wins'. Left receptacles wins over mSATA, right one over SATA

Only mSATA slot populated with SSD, Ethernet dongle on right USB port:

root@orangepizeroplus2:~# lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 002: ID 0bda:8153 Realtek Semiconductor Corp. 
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 152d:0578 JMicron Technology Corp. / JMicron USA Technology Corp. 
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 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 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

Now external disk in JMS567 enclosure connected to left USB port. The onboard JMS578 with the SSD behind disappears since the external JMS567 takes over:

root@orangepizeroplus2:~# lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 002: ID 0bda:8153 Realtek Semiconductor Corp. 
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 002: ID 152d:3562 JMicron Technology Corp. / JMicron USA Technology Corp. 
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 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 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

Based on my understanding connecting such a Male-Male cable will only result in a direct connection between the other host and either usb2 or usb3 on the Zero. The respective JMS578 will disappear as soon as anything is connected to 'its' USB receptacle. Here's dmesg output at the end: http://sprunge.us/IIPS 

Link to comment
Share on other sites

2 minutes ago, tkaiser said:

Huh? Which hub?

Right ! Sorry for the wording, I mean the SATA JMS578 ...

 

3 minutes ago, tkaiser said:

Male-Male cable will only result in a direct connection

If something is plugged in this receptacle, it would not run correctly since both devices are connected on the same bus. The Male-Male is only when we wish to use expansion board on any other Non-Zero board.

Link to comment
Share on other sites

6 minutes ago, martinayotte said:

The Male-Male is only when we wish to use expansion board on any other Non-Zero board.

 

Ah, I start to understand. So in this mode then the NAS Expansion board creates a direct connection between the USB receptacle and the JMS578 (left <--> mSATA, right <--> SATA)?

Link to comment
Share on other sites

2 hours ago, martinayotte said:

Be aware that OPi Zero NAS expansion board has 2 USB connectors, but only the one at the center is a real USB host.

The other USB connectors at left near the barrel power DC is a USB Input to allow connecting the USB Hub to Non-Zero boards with a Male-Male cable.

Plugging anything in this USB Input on a OPiZero is somehow shorting the whole hub which is already connected thru the pins header.

 

Thank you for the very useful info. My issue seems to be power related (current/voltage drop)  I installed a large heat-sink on my board and had to use DuPont (less than 6cm) wires to use the usb/mic/sound expansion board (not the NAS board) , mounting it without the DuPont wires solved the problem (it however has no issue with the legacy kernel)

 

 

Link to comment
Share on other sites

I have been doing a lot of tests with that NAS expansion board (two into production environments and other two in laboratory).

The USB ports are shared with the SATA ports one to one.

The one next to the SATA port has the same bus as that port.  The other one is for the mSATA connector.  When whatever USB device is connected, the corresponding SATA device will disappear (tested with both, mSATA and SATA devices).

 

If no SATA device is connected, it works as a standard USB hub.  And if both SATA are connected (if those devices are not very power hungry and the machine can deal with that), no USB port "must" be used.

 

In fact, that expansion is a little dangerous to use ;-) ... if I attach SATA devices, I will hide physically the corresponding USB ports if I don't like to corrupt my data or being out of service.

 

What I still don't know is how to use the microUSB in the SBC when the expansion it is in place, but that is another thread discussion.

Link to comment
Share on other sites

7 hours ago, malvcr said:

If no SATA device is connected, it works as a standard USB hub

Huh? There is no USB hub on the Expansion board, there's just some logic to route USB ports to either host or SATA ports. It seems you missed another option to use this Expansion board: without an OPi Zero connected to the GPIO header. IMO it's better to collect all we know at a single location: https://forum.armbian.com/index.php?/topic/3317-orange-pi-zero-nas-expansion-board-with-sata-msata/&do=findComment&comment=39250

 

Link to comment
Share on other sites

My mistake ... it really extends the USB ports in the SBC ... just it "looks" as a HUB.  There is also something else I realized today with the board, I will corroborate "without it" to share in the forum.

Let me review my comment and to check how the other thread is going, to complement the data there.

Link to comment
Share on other sites

I realize this thread is quite old but I'm not finding the answer on any of my searches already - please redirect me if I'm wrong:

 

Is it possible to use the pair of USB header pins already present on the OPi Zero board without connecting the expansion board?  I.E. can I connect a USB webcam to the pins and have it work?  From what I've found so far, I think this should be possible but I'm not sure and would rather not fry my board just on a whim. . .

 

Thank you

Link to comment
Share on other sites

29 minutes ago, Chris White said:

From what I've found so far, I think this should be possible but I'm not sure and would rather not fry my board just on a whim. . .


Yes, you can. It works.

Link to comment
Share on other sites

On 2/7/2018 at 11:37 AM, Igor said:


Yes, you can. It works.

Thank you, I should probably update you that I was successful in using the expansion pins to hookup a camera to my OctoPrint controller running on my OPi Zero.  It works great and keeps the board size very small vs having to use the expansion card.

Link to comment
Share on other sites

I am using the 4.15.0-rc9 DEV kernel for my Orange Pi Zero and there are no DTB overlay files like sun8i-h3-usbhost2.dtbo or sun8i-h3-usbhost3.dtbo.

There is no "overlay" sub directory in /boot/dtb. I only have an empty "/boot/overlay-user" directory.

The overlay files are already included in the "/boot/armbianEnv.txt" file because this file contains the following two lines:

overlay_prefix=sun8i-h3
overlays=usbhost2 usbhost3

 

What is the problem? Where can I get the missing files?

Thanks in advance.

Link to comment
Share on other sites

57 minutes ago, anku said:

 

What is the problem? Where can I get the missing files?


Patches to support this function are only available in the 4.14.y NEXT. They are not yet in the development branches and it's not a simple copy/paste job.

Link to comment
Share on other sites

@Igor: Thanks for the very fast answer. Does that mean that I have to wait until the overlay files exist for this dev kernel? Is this already planned? When can I expect a solution?

Link to comment
Share on other sites

8 hours ago, anku said:

@Igor: Thanks for the very fast answer. Does that mean that I have to wait until the overlay files exist for this dev kernel? Is this already planned? When can I expect a solution?


When it is done is done. Armbian is not a professional service and we have no particular interest nor resources to deal with this function. A project is open and if this is your pain, you are welcome to join and try to move patches from NEXT to DEVelopment "today". 


Next kernel is planned when upstream 4.17.y - 4.18.y changes in the area of particular interests are significant enough to move forward. Anything else is unpaid education or throwing resources straight into the trash bin.

Perhaps 2-3 months?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines