Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Nano Pi Neo Air Gpio

Featured Replies

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 ?

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.

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> ?

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

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 ?

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>

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

 

 ?

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.

 

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)

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 ?

 

# 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 ?

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 ?

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.