3 3
aElmecker

Tinkerboard: Use MicroUSB to connect USB-Hub

Recommended Posts

Hello!

 

I would like to know if it is possible to use the microUSB-Connector for connecting a USB device (a 7-port USB hub in my case)?

My Tinkerboard is powered through the GPIO pins, so i don't use the microUSB for power input.

 

Is it even possible from the hardware architecture of the board?

 

Do i need some extra kernel packages and/or USB OTG to make it work?

 

 

Thanks in advance,

aElmecker

Share this post


Link to post
Share on other sites
9 hours ago, TonyMac32 said:

I have not personally gotten the OTG to work in the Linux kernel, although it should as UMS works with U-boot.

So i guess the Tinkerboard S is more likely to work rather than the Tinkerboard.

 

Maybe if i get the Tinkerboard to work as an USB-Gadget first and then try to switch it to host mode.

Share this post


Link to post
Share on other sites

Looking at the device tree, the OTG port is explicitly enabled and configured in "otg" mode, so there is a hint that could possibly work but it is not an evidence.

You may try to decompile the device tree, find this section:

usb@ff580000 {
                compatible = "rockchip,rk3288-usb", "rockchip,rk3066-usb", "snps,dwc2";
                reg = <0x0 0xff580000 0x0 0x40000>;
                interrupts = <0x0 0x17 0x4>;
                clocks = <0x7 0x1c1>;
                clock-names = "otg";
                dr_mode = "otg"; // Change this to "host"
                g-np-tx-fifo-size = <0x10>;
                g-rx-fifo-size = <0x113>;
                g-tx-fifo-size = <0x100 0x80 0x80 0x40 0x40 0x20>;
                phys = <0x40>;
                phy-names = "usb2-phy";
                status = "okay";
        };

and change dr_mode into "host". Then recompile the device tree and try again.

Maybe the mode can be changed at runtime, but I'm not aware of any way to do it.

Share this post


Link to post
Share on other sites
17 hours ago, TonyMac32 said:

My understanding is either should work, but I haven't spent any real time on it.

Yeah both can transfer data with the microUSB connector.

I used an android os to test and on both Tinkerboard/S mass storage works like on any phone.

 

But as soon as i tried my OTG cable the system froze.

I found a post on the tinkerboard forum about this and they said the OVP/UVP is the problem if the tinkerboard needs to support the usb device with 5V.

(My USB Hub has an external power source and does not need power from the tinkerboard)

Here's the link to the thread: https://tinkerboarding.co.uk/forum/archive/index.php/thread-1258-1.html

 

16 hours ago, jock said:

change dr_mode into "host". Then recompile the device tree and try again.

I set the dr_mode of both the ff58 and ff54 to "host".

root@tinkerboard:~# cat /sys/bus/usb/devices/usb1/of_node/dr_mode 
host

But shouldn't dr_mode = "otg" work, because it switches automatically to slave or master depending on the cable you insert?

 

16 hours ago, jock said:

Maybe the mode can be changed at runtime, but I'm not aware of any way to do it.

I'm ok with it if the mode is fixed, at least for my purpose.

Share this post


Link to post
Share on other sites
7 hours ago, aElmecker said:

But shouldn't dr_mode = "otg" work, because it switches automatically to slave or master depending on the cable you insert?

It should, but I don't know if there are all the bits in the drivers and if there's something needed to do in userspace (like udev rules, usb mode switching, ...).

I don't own a Tinkerboard but a device based on rk3288. The OTG port comes out directly from the SoC and dr_mode="host" works flawlessy on my device

Share this post


Link to post
Share on other sites
On 9/6/2019 at 4:06 PM, jock said:

The OTG port comes out directly from the SoC and dr_mode="host" works flawlessy on my device

Which device are you using?

 

I changed the mode in the device tree, but nothing is happening...

I used both the latest legacy and mainline kernel image download for the tinkerboard.

 

This is the cable i use: https://www.amazon.de/UGREEN-Kabel-Micro-Adapter-Schwarz/dp/B00LN3LQKQ/ref=asc_df_B00LN3LQKQ/?tag=googshopde-21&linkCode=df0&hvadid=309939621091&hvpos=1o1&hvnetw=g&hvrand=16210341296222698212&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=1030894&hvtargid=pla-440034358719&psc=1&th=1&psc=1&tag=&ref=&adgrpid=65374344927&hvpone=&hvptwo=&hvadid=309939621091&hvpos=1o1&hvnetw=g&hvrand=16210341296222698212&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=1030894&hvtargid=pla-440034358719

Which one do you use?

Share this post


Link to post
Share on other sites
22 hours ago, aElmecker said:

Which device are you using?

a tv box (xt-q8l-v10)

 

22 hours ago, aElmecker said:

Mostly the same as yours, but I tried different OTG adapters and all worked fine.

BTW, mine was just a suggestion to play with, as long as I don't have a tinkerboard to test by myself it's not the real solution.

Do the OTG port can be used as a HOST port with official OS?

Share this post


Link to post
Share on other sites
1 hour ago, jock said:

Do the OTG port can be used as a HOST port with official OS?

I changed the mode to HOST on the TinkerOS, but without success.

 

I started a thread in the Tinkerboard Forum to discuss this topic on there.

 

1 hour ago, TonyMac32 said:

The u-boot source code should be able to help, I remember a regulator being involved.

I'll take a look at it, but I'm not to familiar with this kind of stuff, I would say...

 

What should the regulator do or what is it good for?

Share this post


Link to post
Share on other sites

I still can't figure out to make USB OTG to work.

 

Anything new on this topic?

I can understand that USB OTG isn't a high-demand feature.

 

If you guys have any new input/ideas, that would be highly appreciated.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
3 3