3 3
digitalsuper8

Nanopi Neo Air and WiringNP

Recommended Posts

All, I downloaded and built WiringNP according to the FriendlyARM instructions. Running 'gpio read all' gives me an error saying

piBoardRev: Unable to determine board revision from /proc/cpuinfo

 

for the rest the Neo Air Armbian runs fine.

any ideas what's wrong?

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

Where should I start in the code? Any suggestions on which file to look in?

 

I started in wiringPi.c and I see that I probably have to tweak the function getBoardType().

But where can I find that function?

your help is appreciated.

Share this post


Link to post
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 ...

 

Share this post


Link to post
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.

Share this post


Link to post
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

 

Share this post


Link to post
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 

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