I am using the boot2qt demo image.
My goal is to identify a GPIO, then connect a jumper to toggle an LED on the Colibri Eval board.
- The Colibri eval board has four LEDS (1 - 4)
- The LED_1 pin is located at X21.2 of the X21 LED/Switches header
I understand iMX6ULL has 32 GPIO.
A table of i.MX6ULL GPIO and Numeric Values is found here:
Question:
- How to determine a free GPIO pin for the boot2qt demo image that I can use to toggle an LED?
Table 4.4.1 SODIM 200 of Colibri iMX6ULL Datasheet (pages 21 - 24) lists I/O with an overwhelming number of pin options for ALT0 - ALT9, and ADC.
The first column in table is i.MX 6ULL Ball Name.
Should I look for Ball Names that start with “GPIO”?
How do you determine if a GPIO is free or in use by one of the alternate (ALT0-ALT9, ADC) options?
cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/209c000.gpio, 209c000.gpio:
gpio-2 ( |VCC_USB[1-4] ) out lo
gpio-11 ( |enable ) out hi
gpiochip1: GPIOs 32-63, parent: platform/20a0000.gpio, 20a0000.gpio:
gpiochip2: GPIOs 64-95, parent: platform/20a4000.gpio, 20a4000.gpio:
gpio-90 ( |spi_imx ) out hi
gpiochip3: GPIOs 96-127, parent: platform/20a8000.gpio, 20a8000.gpio:
gpiochip4: GPIOs 128-159, parent: platform/20ac000.gpio, 20ac000.gpio:
gpio-128 ( |cd ) in lo IRQ
gpio-129 ( |Wake-Up ) in lo IRQ
gpio-130 ( |id ) in lo IRQ
gpio-139 ( |WIFI_PDN ) out hi
Once I can determine a free GPIO, configure, and connect SODIMM jumper to LED_1 I expect something like this should toggle the LED:
# gpio53 direction = out
echo out > /sys/class/gpio/gpio53/direction
cat /sys/class/gpio/gpio53/direction
out
# gpio53 value = 0
echo 0 > /sys/class/gpio/gpio53/value
cat /sys/class/gpio/gpio53/value
# gpio53 value = 1
echo 1 > /sys/class/gpio/gpio53/value
cat /sys/class/gpio/gpio53/value
[Solved] How to Identify Free GPIO Pin Accessible from Colibri Evaluation Board
Solution provided by @jaski.tx
Look for free GPIO PIN definitions in device tree imx6ull-colibri.dtsi starting at Line 345
Note: A free PIN found in the dtsi does NOT mean it is accessible on the Colibri Eval Board GPIO connector X8 or X11
Steps:
- Identify SODIMM comment in device tree imx6ull-colibri.dtsi starting at Line 345
- Search PDF Colibri Eval Board Data Sheet for SODIMM_pinNumber, for example “SODIMM_133”
- Matches may be found in PDF Colibri Eval Board Data Sheet at sections:
- Default Signal Mapping on page 43-45
- GPIO 1 Male (X8 Row A) on pages 36-37
- GPIO 2 Male (X11 Row B) on pages 40-41
- If no match found then, repeat with next GPIO PIN in device tree imx6ull-colibri.dtsi starting at Line 345
File: imx6ull-colibri.dtsi starting at Line 345
pinctrl_gpio1: gpio1-grp { fsl,pins = < MX6UL_PAD_UART3_RX_DATA__GPIO1_IO25 0x10b0 /* SODIMM 77 */. <- SODIMM pin not connected to Colibri Eval board MX6UL_PAD_JTAG_TCK__GPIO1_IO14 0x70a0 /* SODIMM 99 */. <- SODIMM pin not connected to Colibri Eval board MX6UL_PAD_NAND_CE1_B__GPIO4_IO14 0x10b0 /* SODIMM 133 */. <- Connected to Colibri Eval Board X11.41 MX6UL_PAD_UART3_TX_DATA__GPIO1_IO24 0x10b0 /* SODIMM 135 */ MX6UL_PAD_UART3_CTS_B__GPIO1_IO26 0x10b0 /* SODIMM 100 */ MX6UL_PAD_JTAG_TRST_B__GPIO1_IO15 0x70a0 /* SODIMM 102 */ MX6UL_PAD_ENET1_RX_ER__GPIO2_IO07 0x10b0 /* SODIMM 104 */ MX6UL_PAD_UART3_RTS_B__GPIO1_IO27 0x10b0 /* SODIMM 186 */ >; };
References:
- GPIO Alphanumeric to GPIO Numeric Assignment
- Basic GPIO usage - Colibri Evaluation Board - Colibri VFxx
- GPIO Alphanumeric to GPIO Numeric Assignment, i.MX 6, i.MX6ULL, i.MX7
- Colibri iMX6ULL Datasheet
- How to use GPIO as output on Colibri running Embedded Linux
- Node.js in Linux, Examples GPIO - Blinking LED