Jump to content

Working USB OTG on NanoPi Neo Core2 LTS and NanoPi Neo Air


humanoid2050

Recommended Posts

I've got a NanoPi Neo Core 2 and a NanoPi Neo Air. It bothered me that the USB OTG did not function in host mode. Turns out, the included Armbian .dtb's don't have the parts necessary to define the regulator which pushes power back to a client device when the board needs to run in OTG host mode. You can see the regulator on page 8 of the schematic

 

http://wiki.friendlyarm.com/wiki/images/6/6b/NanoPi_NEO_Core2-V1.0_1707.pdf

 

I found an upstream patch at

 

https://patchwork.kernel.org/patch/9921097/

 

which defined the missing parts for a Neo Plus 2. I put the relevant parts into an overlay dts file (attached) that can be loaded with

 

sudo armbian-add-overlay otg.dts

 

I've tested this on both of my devices. I assume it should work on other devices with the same wiring.

 

One quirk I didn't figure out though... online sources all used "GPIO_ACTIVE_HIGH" as a kind of defined value, but the version of 'dtc' included with Armbian chokes on it. So instead I just in the equivalent numeric value.

otg.dts

Link to comment
Share on other sites

11 hours ago, humanoid2050 said:

One quirk I didn't figure out though... online sources all used "GPIO_ACTIVE_HIGH" as a kind of defined value, but the version of 'dtc' included with Armbian chokes on it. So instead I just in the equivalent numeric value.

The reason is when compiling Main DT, the compiler has access to kernel header, but when compiling overlays, you can't include those headers ...

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

 

Link to comment
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...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines