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.

GPIO in Olinuxino Micro A20

Featured Replies

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.

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).

  • Author

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.

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

  • Author

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.

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.