barish Posted December 2, 2015 Posted December 2, 2015 Hello, I am new to armbian and am quite impressed of the ease of installation and use. I copied the vanilla headless Debian jessy to a spare SD and the board booted right away. So first of all, many thanks to the developers! I rely on GPIO for my application of the board, so I first tested the export of a GPIO. Normally, the kernel from Olimex gives me something like "gpio64_pg0", which is not very compatible to the programs out in the internet (e.g. OpenHAB.org which I use), so – with this kernel – I was happy to get a standard "gpio1" when echoing "1" to "export". But as soon as I tried to change the direction echo out > gpio1/direction the whole board crashed immediately. I haven't yet looked into it further and would be very happy about some feedback of a possible easy solution here on the forum...? Furthermore, it would be interesting what layout is used for the pin numbering.
zador.blood.stained Posted December 2, 2015 Posted December 2, 2015 Look at GPIO numbering scheme in mainline kernel here: https://linux-sunxi.org/GPIO It is tied to SoC pin bank (port) numbers, so GPIO 1 would be pin PA01, and this pin (for A10/A20 CPUs) is probably used by network driver, so no wonder kernel crashed here. You will need to calculate GPIO numbers for pins manually by their names (i.e. PG0 -> GPIO 192 if I'm not mistaken). 1
barish Posted December 2, 2015 Author Posted December 2, 2015 Ah, great! thanks a lot for this hint! So I have to calculate the pin position! Wonder if that's the new standard way, or are there the two standards, calculating and naming the pins...? edit: Just tested it and this is the solution. Thanks again.
zador.blood.stained Posted December 2, 2015 Posted December 2, 2015 Yes, this is the standart for GPIO numbering in mainline kernel and it shouldn't change anytime soon. Pin configuration (names and numbers) is defined by SoC manufacturer, then board manufacturer wires them to expansion headers. You should look at board schematics or pin map, for example, here on page 4, port names are marked green: http://www.py6zgp.com/download/A20-GPIO.pdf
barish Posted December 2, 2015 Author Posted December 2, 2015 Yes, I've already got this excellent description on GPIO, and of course Olimex also shows the ports on his wiki page: https://www.olimex.com/wiki/A20-OLinuXino-MICRO#Hardware Only that in the kernel I used so far, the ports are named as in the mentioned description, by their explicit name like "GPIO1_pg1", and in the description, Guido Petz says that this will be the new naming convention for kernels 3.4.67+ . So they might have changed back to the single number naming. Well, now I know and appreciate this, because in this way I can easier use the pins in other software.
zador.blood.stained Posted December 2, 2015 Posted December 2, 2015 This may be new naming convention for kernel supported by manufacturer, but mainline kernel has its own standarts, common for all supported devices.
Recommended Posts