Jump to content

Nanopi Neo Air and WiringNP


digitalsuper8

Recommended Posts

I believe it has to do with the Armbian Kernel where there may be no model name specified? Like H3 or something? The file /proc/cpuinfo, which is a virtual file and I believe its contents are determined by what is in the kernel, doesn't give any model name and gpio is looking for a model name.

So gpio readall fails:

 

$ gpio -v readall

 

gives:


gpio version: 2.20
Copyright (c) 2012-2014 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Your NanoPi has an unknown model type. Please report this to
    support@friendlyarm.com
with a copy of your /proc/cpuinfo if possible

 

Link to comment
Share on other sites

It is opening /proc/cpuinfo there : https://github.com/WiringPi/WiringPi/blob/master/wiringPi/wiringPi.c#L698

Then it is checking if it is an Raspberry there : https://github.com/WiringPi/WiringPi/blob/master/wiringPi/wiringPi.c#L723

You need to tweak that port, either by skipping it or provide check for H3 SoC.

 

Anyway, maybe someone already done that by forking this original WiringPi to make it compatible with NanoPiNeoAir ...

 

Link to comment
Share on other sites

I had the same issue with wiringNP on nanoPi NEO. The issue was resolved by adding a line to the file "boardtype_friendlyelec.c" in the array "BoardHardwareInfo gAllBoardHardwareInfo[]"

 

The line added is:

{"sun8i", 0, NanoPi_NEO, "NanoPi-NEO-Armbian", "-1(-1)"},

 

The critical parameter is the -1(-1), which is the board type reported by the kernel for this board.

 

I have not carried our thorough testing, but the gpio readall reports properly and I am able to toggle outputs and read inputs correctly using the gpio command.

Link to comment
Share on other sites

There is 2 Repository.

 

https://github.com/friendlyarm/WiringNP

https://github.com/wertyzp/WiringNP

 

friendlyarm's WiringNP have a mapping bug.

gpio of pin#35 and #36 won't work.

 

static int pinToGpio_m1 [64] ={
    0, 6, // 0, 1
    2, 3, // 2, 3
    200, 201, // 4  5
    1, 203, // 6, 7
    12, 11, // 8, 9
    67, 17, //10,11
    64, 65, //12,13
    66, 198, //14,15
    199, -1, //16,17
    -1, -1, //18,19
    -1, 20, //20,21
    21, 8, //22,23
//    13, 9, //24,25 /nopnop2002
    16, 9, //24,25
//    7, 16, //26,27 /nopnop2002
    7, 13, //26,27
    15, 14, //28,29
    19, 18, //30,31

 

Link to comment
Share on other sites

On 27-10-2017 at 10:28 AM, JohnF said:

I had the same issue with wiringNP on nanoPi NEO. The issue was resolved by adding a line to the file "boardtype_friendlyelec.c" in the array "BoardHardwareInfo gAllBoardHardwareInfo[]"

 

The line added is:

{"sun8i", 0, NanoPi_NEO, "NanoPi-NEO-Armbian", "-1(-1)"},

 

The critical parameter is the -1(-1), which is the board type reported by the kernel for this board.

 

I have not carried our thorough testing, but the gpio readall reports properly and I am able to toggle outputs and read inputs correctly using the gpio command.

I will try this on the Neo Air 

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