Marcelm2000 Posted May 13, 2017 Share Posted May 13, 2017 Hello, actually i have "Bananian" with the kernel "3.4.113-bananian", and I would like to switch to the Armbian mainline kernel! My problem / question is how does it work with the GPIO in the mainline kernel? I use these commands under the legacy kernel... (I use the modified WiringPI from LeMaker) echo "17" > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio17/direction echo "1" > /sys/class/gpio17/value But these unfortunately no longer work under the mainline kernel! I don't understand how i calculate now the right GPIO Pin. (http://linux-sunxi.org/GPIO#Accessing_the_GPIO_pins_through_sysfs_with_mainline_kernel) I look forward to your help! Greeting, Marcel Link to comment Share on other sites More sharing options...
martinayotte Posted May 13, 2017 Share Posted May 13, 2017 As the Linux-sunxi page you've mentioned : Quote (position of letter in alphabet - 1) * 32 + pin number So, in your example, the pin is PA17. If we take another pin, lets say PC12 : it would be 76. If we take another pin, lets say PD5 : it would be 101. 1 Link to comment Share on other sites More sharing options...
Marcelm2000 Posted May 14, 2017 Author Share Posted May 14, 2017 Hello, thank you for your reply! I think it is not PA17, because i'm connected physically to Pin 11 and in the Schematic (http://forum.lemaker.org/thread-10852-1-1.html) is CON6-P11 = PI19 and that is 257, right? I will test both afterwards! Link to comment Share on other sites More sharing options...
squid4t2 Posted May 14, 2017 Share Posted May 14, 2017 Hi Marcelm, try your calculation again .. I think you may find it works out to 275. I hope this sorts the problem for you. 8 x 32 plus 19 1 Link to comment Share on other sites More sharing options...
Marcelm2000 Posted May 14, 2017 Author Share Posted May 14, 2017 Thank you squid4t2! It works great. Greeting, Marcel Link to comment Share on other sites More sharing options...
squid4t2 Posted May 14, 2017 Share Posted May 14, 2017 Hi Marcelm, glad to be of help. I found sorting GPIO pins / inputs / outputs quite a challenge to start with as Odroid, Pine and Raspi etc all had / have different values. All very confusing .... 1 Link to comment Share on other sites More sharing options...
Recommended Posts