Jump to content

Nano Pi Neo Air Gpio


Guest

Recommended Posts

I am trying to use gpio without C or Python library, I follow pinout in the wiki :

http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO_Air

7    GPIOG11    203

 

modprobe gpio-sunxi

echo 203 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio203/direction

echo 1 > /sys/class/gpio/gpio203/value

 

LED I connected to Gpio don't light for the moment, I have missed something ?

What Linux Gpio may I use ?

Link to comment
Share on other sites

It is my fault, a bad solder ... I forgot that I only soldered a few pins (in case I remove the header).
The code above works well on nano pi neo air.

Link to comment
Share on other sites

52 minutes ago, martinayotte said:

Your question is not clear ...

The answer could be FEX for Legacy or DT for Mainline ...

 

 

Thank you for your answer martinayotte, what is not clear ?

I understand, so, armbian-config -> fex edit -> and then :)

(I don't really want to do wrong things that's why I prefer ask....)

 

gpio=port:PA17<0><default><default><0> ?

Link to comment
Share on other sites

2 hours ago, sirob said:

"7    SPDIF-OUT/GPIOA17" to GND

"5    USB-DM2" to VCC

 

This is really not clear !

Do you wish GPIOA17 to become GND ? USB-DM2 to become VCC ?

euuuhhh ???? why ????

Explain in details what you wish to accomplish ...

Link to comment
Share on other sites

Yes :)

I need to do this in order to easily solder my ir receiver..

I don't need a big output current to power my receiver so it will be ok if I set gpio to high level at 3V

To resume I need to solder my ir receiver on 3pins nearby, that's why I need GPIOA17 to 0V and USB-DM2 at 3V

Link to comment
Share on other sites

4 minutes ago, zador.blood.stained said:

Possible but not practical due to the GPIO current limit.

 

Not possible, this is not a GPIO (general-purpose) pin but a specialized USB pin that can't be reconfigured

 

Thank you for your answer Zador :)

Yes, current limit will be enough for me.... I hope :D

How can I set this (what must I add in Fex file) ? (GPIOA17 to 0V)

 

Not possible to set USB-DM2 to 3V.... Ok, and USB-DM2 at 0V and GPIOA17 to 3V ?

Link to comment
Share on other sites

Ok, so the option left is to set GPIOA17 to 0V

So, armbian-config -> fex edit -> and then ?
(I don't really want to do wrong things that's why I prefer ask....)
 

May I add :
gpio=port:PA17<0><default><default><0>

Link to comment
Share on other sites

Just to be sure I do right things :

 

[gpio_para]

gpio_used = 1
gpio_num = 1
gpio_pin_1 = port:PA17<0><default><default><0>

 

modprobe gpio-sunxi
echo 1 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio1/direction
echo 0 > /sys/class/gpio/gpio1/value

 

 ?

Link to comment
Share on other sites

1 hour ago, sirob said:

gpio_pin_1 = port:PA17<0><default><default><0>

Nope ! According to FEX guide, and the fact you wish to have it as output pin :

 

Quote

port:<port><mux feature><pullup/down><drive capability><output level>

gpio_pin_1 = port:PA17<1><0><3><0>

 

Also, I doubt it would be "gpio_pin_1", because there are several pins already present.

Are you starting a new FEX file from scratch ? Wrong idea !

You need to decompile current /boot/script.bin using "bin2fex", edit existing script.fex by adding your new pin in existing "[gpio_para]" section, increment the "gpio_num", save resulting file, and recompile it into /boot/script.bin using "fex2bin", then reboot the board.

Make sure to keep a backup of the original /boot/script.bin.

 

Link to comment
Share on other sites

I use "armbian-config" to set the FEX config (wery well designed)

So I replaced "[gpio_para]" section :

[gpio_para]
gpio_used = 1
gpio_num = 1
gpio_pin_133 = port:PA17<1><0><3><0>

 

And then after reboot (maybe if later I want to set it to 3V) :

echo 133 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio133/direction
echo 1 > /sys/class/gpio/gpio133/value

 

What did I missed ? (I can't control it for the moment and default value at <1> does not have effect)

Link to comment
Share on other sites

45 minutes ago, sirob said:

What did I missed ? (I can't control it for the moment and default value at <1> does not have effect)

I don't think you missed anything, but I can't verify since I'm using Mainline on all my boards.

What do you mean by " you can't control it" ? Why did you put "gpio_pin_133" instead of "gpio_pin_17" ?

Are you sure that your are using Legacy ? what "uname -a" is reporting ?

 

Link to comment
Share on other sites

# uname -a
Linux nanopi 3.4.113-sun8i #18 SMP PREEMPT Thu Jun 15 02:16:06 CEST 2017 armv7l armv7l armv7l GNU/Linux
 

Maybe I can connect an input pin to 5V in order to use it as a power pin ?

Link to comment
Share on other sites

Yes, I agree ^^ I mean if I connect an input Pin to 5V (the nearest for me is PA17) is there protections, does input Pin must be connected to 3v3 ?

It will helps me to have 5v or 3v3 on Pins I use....

 

For example if I connect PG7 to 5v and configure it as an input Pin is it ok ?

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