Guest Posted April 7, 2017 Posted April 7, 2017 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 ?
Guest Posted April 8, 2017 Posted April 8, 2017 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.
Guest Posted October 18, 2017 Posted October 18, 2017 Does somebody knows how to set linux gpio on the other header ? (USB/Audio/IR Pin Description) "7 SPDIF-OUT/GPIOA17" to GND "5 USB-DM2" to VCC http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO_Air Is it possible ?
martinayotte Posted October 18, 2017 Posted October 18, 2017 1 hour ago, sirob said: somebody knows how to set linux gpio Your question is not clear ... The answer could be FEX for Legacy or DT for Mainline ...
Guest Posted October 18, 2017 Posted October 18, 2017 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> ?
martinayotte Posted October 18, 2017 Posted October 18, 2017 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 ...
Guest Posted October 18, 2017 Posted October 18, 2017 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
zador.blood.stained Posted October 18, 2017 Posted October 18, 2017 8 minutes ago, sirob said: GPIOA17 to 0V Possible but not practical due to the GPIO current limit. 9 minutes ago, sirob said: USB-DM2 at 3V Not possible, this is not a GPIO (general-purpose) pin but a specialized USB pin that can't be reconfigured
Guest Posted October 18, 2017 Posted October 18, 2017 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 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 ?
martinayotte Posted October 18, 2017 Posted October 18, 2017 USB-DM2 is really a dedicated bidirectional pin for USB2, it can't be configured as output, neither 0V or VCC.
Guest Posted October 18, 2017 Posted October 18, 2017 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>
martinayotte Posted October 18, 2017 Posted October 18, 2017 http://linux-sunxi.org/Fex_Guide#Port_Definitions http://linux-sunxi.org/Fex_Guide#.5Bgpio_para.5D Don't forget to increment "gpio_num"
Guest Posted October 18, 2017 Posted October 18, 2017 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 ?
martinayotte Posted October 18, 2017 Posted October 18, 2017 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.
Guest Posted October 18, 2017 Posted October 18, 2017 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)
martinayotte Posted October 18, 2017 Posted October 18, 2017 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 ?
Guest Posted November 4, 2017 Posted November 4, 2017 # 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 ?
martinayotte Posted November 4, 2017 Posted November 4, 2017 I'm not following you : If you're talking about Pin17 of the header, it is a 3.3V output, not a input for 5V Power. Connecting that to 5V could destroy the board. The 5V Input is on Pin2 and Pin4.
Guest Posted November 4, 2017 Posted November 4, 2017 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 ?
Recommended Posts