GPIO Problem

Started by Bwakao, January 13, 2015, 01:01:30 pm

Previous topic - Next topic


Hello !

I have an A10 with a LCD screen and i have a particulary problem.

In fact , i want managing a particulary PIN on the GPIO3 port with a C program : the PIN number 6, PB3.

I want to send "1" , to the PIN and check with a voltmeter. its simply  >:(

My code here :

#include <stdio.h>
#include <sys/io.h>
#include <unistd.h>

#undef extern

int main(int argc,char* argv[])
   printf("Debut du programme test du PIN");


   printf("fin du programme");
   return 0;

After compiling the program and execute the ".exe" called gpio , the terminal tell me "Segmentation Fault".

Im not sure about the adress of the GPIO3. On the manual , its write B14 for the PIN num 6 for GPIO3

If you have a solution , i would be happy to hear ;D

PS : sorry for my english .


B14 is not an io port number, so it can't be used in ioperm().


Yes, it's just a name and it's usefull when accessing GPIO via sysfs interface. The direct I/O is necessary only when speed is critical, normal programs will be happy with the file-based sysfs interface in /sys.

BTW, the out() is for port-mapped IO, but most of ARM SoC I/O is memory-mapped, so you will probably need mmap() instead.


For more info on the sysfs interface MBR mentioned, see The B14 is just the pin number (or ball number, since this is a Ball Grid Array part) on the A10 package.