Power & Source of Big Ideas

Developing GPIO Code on the M1

Moderators: chensy, FATechsupport

For the NanoPi M1 (and others) there is a downloadable directory called MATRIX which according to FriendlyArm you should cross-compile on a PC and then send the executable files to your M1. My interest is GPIO - and there is an example C program for controlling GPIO ports.

Running this on a cross- compiler is messy and I'd much rather keep the whole lot on the M1. I noted that GEANY is installed on the M1 - and having installed my usual programs on the M1 (Apache, Node-Red etc) I noted that as part of all that - the GNU C compiler environment is in there (might have been in Debian already).

So - I grabbed the MATRIX folder, dumped it into the M1 and LO - I could COMPILE the program from the GEANY environment.

Sadly when I tried MAKE - it fell over - a couple of includes needed ../../lib/include adding to the header. Clearly I'm missing some PATH info. Once I'd sorted that out - I noted the MAKE failed because the actual C programs referred to in the headers were ALSO missing. I pulled 2 C files into the main file - compiled and ran MAKE. VOILA - a working compiled program - granted it needs ROOT user which is not much use but better than nothing.

So my question is - being a tad on the novice side on Linux - where should I be looking to modify the path - the GEANY editor? The MAKE file? Somewhere else. If someone familiar with this library could help, it would certainly make programming these boards easier.
My try to compile matrix is succeeded, but this doesn't answers to a question how to code. I prefer wiringPi library as it's very easy to use. Btw WiringOP already have code to support Allwinner H3, all what friendlyarm needs is to remap gpio outputs in wiringPi.c. check https://github.com/zhaolei/WiringOP/blo ... wiringPi.c history, you will see remapped gpio outputs.
scargill wrote:
For the NanoPi M1 (and others) there is a downloadable directory called MATRIX which according to FriendlyArm you should cross-compile on a PC and then send the executable files to your M1. My interest is GPIO - and there is an example C program for controlling GPIO ports.

Running this on a cross- compiler is messy and I'd much rather keep the whole lot on the M1. I noted that GEANY is installed on the M1 - and having installed my usual programs on the M1 (Apache, Node-Red etc) I noted that as part of all that - the GNU C compiler environment is in there (might have been in Debian already).

So - I grabbed the MATRIX folder, dumped it into the M1 and LO - I could COMPILE the program from the GEANY environment.

Sadly when I tried MAKE - it fell over - a couple of includes needed ../../lib/include adding to the header. Clearly I'm missing some PATH info. Once I'd sorted that out - I noted the MAKE failed because the actual C programs referred to in the headers were ALSO missing. I pulled 2 C files into the main file - compiled and ran MAKE. VOILA - a working compiled program - granted it needs ROOT user which is not much use but better than nothing.

So my question is - being a tad on the novice side on Linux - where should I be looking to modify the path - the GEANY editor? The MAKE file? Somewhere else. If someone familiar with this library could help, it would certainly make programming these boards easier.



Hello,
Now you can compile the Matrix package directly on board, you need to update your matrix code via use git pull command.
Then you can compile and use program directly on board.

thanks
Check this topic
viewtopic.php?f=47&t=260
Good afternoom, how are you?. I'm to new to linux, programming and I'm having problems here. For some reason geany when I try to run the demo matrix-ir_receiver with the port set to the embedded IR receiver of the nanopi M1, generates an executable of the type object code and not of the type needed in that distribution of linux. When I try to run the demo from the console, it says permission denied

here are some pictures:

Answer from console:

Image

Commands to compile:

http://i65.tinypic.com/izm0z7.jpg

Files generated:

http://i63.tinypic.com/112acgh.jpg

Please help :( :(

Who is online

In total there are 28 users online :: 0 registered, 0 hidden and 28 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 28 guests