Need for GPIO Pins correlation on iMx6 Ultralite Board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need for GPIO Pins correlation on iMx6 Ultralite Board

1,750 Views
johncoleman
Contributor IV

Need for GPIO Pins correlation on iMx6 Ultralite Board:

I am using the i.MX6 Ultralite board.

But, I don't know the correlation between GPIO / GPIOCHIP #s and the actual pin #s.

Such as these would be useful (to start) :

  J1703 - D0,D1,D2,D3,D4,D5,D6,D7

  J1706 - A0,A1,A2,A3,A4,A5

  J1704 - D8,D9,D10,D11,D12,D13,D14,D15

Thanks - in advance.

Labels (1)
0 Kudos
7 Replies

938 Views
johncoleman
Contributor IV

Actually I have tried most ALL of the 160 Pins using the SysFs script below, on the Ultralite board.

But, I see No Results on the Output Pins.

  echo 23  > /sys/class/gpio/export

  echo out > /sys/class/gpio/gpio23/direction

  echo 1   > /sys/class/gpio/gpio23/value

So, I have NOT seen any output on the Any Pins.

... Anybody have any suggestions ?

0 Kudos

938 Views
johncoleman
Contributor IV

Actually,

I have correlated the Pins to GPIO #s.

But, I am having trouble compiling the code.

I can create a simple Layer project.

But, when I attempt to include external files, like gpio.h ,

I only get back compile errors:

#include <linux/gpio.h>

Log data follows:

| DEBUG: Executing shell function do_compile

| helloworld.c:9:24: fatal error: linux/gpio.h: No such file or directory

|  #include <linux/gpio.h>

|                         ^

| compilation terminated.

| WARNING: exit code 1 from a shell command.

| ERROR: Function failed: do_compile (log file is located at /home/johnc/yocto_3.14.38-6UL/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/myHelloWorld/0.1-r0/temp/log.do_compile.14565)

Even direct path includes:

#include  "/home/johnc/yocto_3.14.38-6UL/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/linux-libc-headers/3.14-r0/linux-3.14/include/linux/gpio.h"

Log data follows:

| DEBUG: Executing shell function do_compile

| In file included from helloworld.c:11:0:

| /home/johnc/yocto_3.14.38-6UL/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/linux-libc-headers/3.14-r0/linux-3.14/include/linux/bug.h:4:21: fatal error: asm/bug.h: No such file or directory

|  #include <asm/bug.h>

|                      ^

| compilation terminated.

| WARNING: exit code 1 from a shell command.

| ERROR: Function failed: do_compile (log file is located at /home/johnc/yocto_3.14.38-6UL/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/myHelloWorld/0.1-r0/temp/log.do_compile.14225)

-> How am I supposed to Include Files/Headers and/or modify the Include Paths ?

0 Kudos

938 Views
w2vy
Contributor V

So I guess we'd write to the GPIO registers directly as Memory Mapped I/O, right?

Tom

0 Kudos

938 Views
johncoleman
Contributor IV

ok

0 Kudos

938 Views
igorpadykov
NXP Employee
NXP Employee

Hi john

one can use by pad name: for example J1703 -D1 UART2_TXD

sect.4.1.1 Muxing Options p.182 i.MX6UL Reference Manual (rev.0  8/2015) :

GPIO1_20. Then use Chapter 27 General Purpose Input/Output (GPIO)

http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6ULRM.pdf

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

938 Views
almarto
Contributor IV

Hi Igor, John,

I am also working with the imx6ulevk and trying to use simple gpio at arduino expansion connectors.

In order not to modify the device tree, I would like to use gpio_1, gpio_2, gpio_3 and gpio_4.

They are already defined as gpios in the device tree:

pinctrl_tsc: tscgrp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO01__GPIO1_IO01  0xb0
MX6UL_PAD_GPIO1_IO02__GPIO1_IO02  0xb0
MX6UL_PAD_GPIO1_IO03__GPIO1_IO03  0xb0
MX6UL_PAD_GPIO1_IO04__GPIO1_IO04  0xb0
>;
};

For instance, in the case of GPIO_1 I do the following:

R1718ON / R906OFF / R1115OFF

and

root@imx6ulevk:/sys/class/gpio# echo 1 > /sys/class/gpio/export

root@imx6ulevk:/sys/class/gpio# echo out > /sys/class/gpio/gpio1/direction

root@imx6ulevk:/sys/class/gpio# echo 1 > /sys/class/gpio/gpio1/value

First thing that I don't understand is why

cat /sys/class/gpio/gpio1/value equals 0 when I have set it to 1.

Regarding voltage levels:

root@imx6ulevk:/sys/class/gpio# echo 1 > /sys/class/gpio/gpio1/value -> around 700mV

root@imx6ulevk:/sys/class/gpio# echo 0 > /sys/class/gpio/gpio1/value -> around 100mV

can anybody give me some advice on how to go on?

Thanks in advance!

BR

0 Kudos

938 Views
johncoleman
Contributor IV

I am having problems compiling.

- See below.

0 Kudos