Jump to content

Banana Pi USB OTG


pspcoelho

Recommended Posts

Hi Paolo,

 

First of all thanks for the help.
The USB port is enabled by default because i use it regularly for a keyboard and mouse.

 

Here the original (not modified) dts file if anyone can help me.

 

Paolo

 

 

For removing the error about 'usb0_id_detect' you have to remove:

* whole section usb0_id_detect_pin@0 { ... };

* following lines: pinctrl-0 = <0x2c>; usb0_id_det-gpio = <0x25 0x7 0x4 0x0>; from phy@01c13400 { ... }; section

* and: pinctrl-0 = <0x0>; usb0_id_det-gpio = <0x0>; from second phy@01c13400 { ... }; section

 

For setting of USB OTG in host only mode you have to change:

* dr_mode = "otg"; to dr_mode = "host"; in usb@01c13000 { ... }; section

 

USB OTH has to work in otg mode but it does not for me on Lime2-eMMC.
 

You also have to verify that required modules are enabled in Kernel and loaded as described here:

What I have done so far, is build the kernel using sunxi_defconfig and
enabled USB_MUSB_SUNXI with its dependancies (musb isn't enabled there
by default): USB_SUPPORT [=y] && USB_MUSB_HDRC [=y] && ARCH_SUNXI [=y]
&& NOP_USB_XCEIV [=y] && PHY_SUN4I_USB [=y] && EXTCON [=y] &&
GENERIC_PHY [=y]  Selects: SUNXI_SRAM [=y] 

Unfortunately, working with converted dtb to dts file is not good idea. The better way is to build your own Armbian image controlling the staff with corresponding patches.

 

Best regards

Chris

Link to comment
Share on other sites

Few months ago I made an utility for easy switching between otg and host mode and it should be part of the build:

sunxi-musb 
OTG / HOST changer for DTB v1.0

sunxi-musb filename.dtb otg | host

Usage example: sunxi-musb sun4i-a10-mini-xplus.dtb otg

If not, it's here.

Link to comment
Share on other sites

I've now made this change (set 'otg' to 'host' and removed the pinctrl lines) to my lime2 dts so I can have the extra USB port available, and am doing it as part of my custom image build.

 

But given it's been a little while and a few kernel versions later, I was wondering whether there was any news on whether OTG mode works?

Link to comment
Share on other sites

Hi Neomanic,

I've now made this change (set 'otg' to 'host' and removed the pinctrl lines) to my lime2 dts so I can have the extra USB port available, and am doing it as part of my custom image build.

 

But given it's been a little while and a few kernel versions later, I was wondering whether there was any news on whether OTG mode works?

I am using OTG in host mode for a long time and have other problem.

 

When my STM32-H405 board is connected as CDC device and communication (~160 kbps from H405 to Lime2) is started for a long periods of time (5-10 hours) without apparent reason device is disconnected but continue to be visible by 'lsusb' command. The only way to revert to working state is by rebooting the system.

 

A few months ago (earlier Kernel version) this problems have been happened much more frequently - after 1-2 hours. My investigation shown that some changes to musb driver have made the things better but did not solve the issue.

 

That is why I have decided to use USB Host ports for critical communications and USB OTG for optional once.

 

Best regards

Chris

Link to comment
Share on other sites

Apparently host mode of the BananaPi OTG USB port is not stable, or it is not stable with kernel 4.8.4

I have run fine DVB-T usb key in that port for a long while, then after the update to 4.8.4, what happens is that the USB DVB-T is detected and initialized fine, but the key doesn't just work, no stream nor valid info are received. And if I disconnect it while the system is running, I get 100% of the time a kernel panic.

This happens with two different DVB-T keys

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