How to determine available GPIO on iMX6ULL to toggle LED on Colibri eval board?

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:

  1. 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:

  1. Identify SODIMM comment in device tree imx6ull-colibri.dtsi starting at Line 345
  2. Search PDF Colibri Eval Board Data Sheet for SODIMM_pinNumber, for example “SODIMM_133
  3. 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
  1. 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:

Hi @embeddedEd

Thanks for writing to the Toradex Community!

I understand iMX6ULL has 32 GPIO.

No, as written in section 1.2.3 Interfaces of the SoM’s Dasasheet, there are up to 88 GPIOS available.

  1. How to determine a free GPIO pin for the boot2qt demo image that I can use to toggle an LED?

Many of the pins described in the section 4.4.1 can be used as GPIO, if not used by other Fuctionality.

Should I look for Ball Names that start with “GPIO”?

As already said, many of these pins can be defined as GPIO. In general you should look for yellow, this describe the default definition of a Pin used in the SoM. Further you should look here, where the free Pins are defined as 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/gpioshows the assignment of the pin to a function. I would suggest to rather define a SODIMM Pin you want to use and then check if this pin is free or not by checking the regular Devicetree. You can also also use the PinOutDesigner tool for this.

Best regards,
Jaski

@jaski.tx Thank you for your help in understanding how to figure this out.

How to Identify Free GPIO Pin Accessible from Colibri Evaluation Board

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:

  1. Identify SODIMM comment in device tree imx6ull-colibri.dtsi starting at Line 345
  2. Search PDF Colibri Eval Board Data Sheet for SODIMM_pinNumber, for example “SODIMM_133
  3. Matches may be found in PDF for 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
  1. If no match found then, repeat with next GPIO PIN in device tree imx6ull-colibri.dtsi starting at Line 345

File: imx6ull-colibri.dtsi

	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 */
		>;
	};

Thanks again for helping me locate free GPIO pins that are accessible on the Colibri Eval Board.

-Ed

@jaski.tx your answer disappeared from the discussion board.

It appears I accidentally moved it to moderation. I did not intend to. I would like to restore your reply if possible?

@jaski.tx Thank you for your help in understanding how to figure this out.

How to Identify Free GPIO Pin Accessible from Colibri Evaluation Board

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:

  1. Identify SODIMM comment in device tree imx6ull-colibri.dtsi starting at Line 345
  2. Search PDF Colibri Eval Board Data Sheet for SODIMM_pinNumber, for example “SODIMM_133
  3. Matches may be found in PDF for 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
  1. If no match found then, repeat with next GPIO PIN in device tree imx6ull-colibri.dtsi starting at Line 345

File: imx6ull-colibri.dtsi

	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 */
		>;
	};

Thanks again for helping me locate free GPIO pins that are accessible on the Colibri Eval Board.

-Ed

@jaski.tx Thank you for your help in understanding how to figure this out.

How to Identify Free GPIO Pin Accessible from Colibri Evaluation Board

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:

  1. Identify SODIMM comment in device tree imx6ull-colibri.dtsi starting at Line 345
  2. Search PDF Colibri Eval Board Data Sheet for SODIMM_pinNumber, for example “SODIMM_133
  3. Matches may be found in PDF for 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
  1. If no match found then, repeat with next GPIO PIN in device tree imx6ull-colibri.dtsi starting at Line 345

File: imx6ull-colibri.dtsi

	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 */
		>;
	};

Thanks again for helping me locate free GPIO pins that are accessible on the Colibri Eval Board.

-Ed

@jaski.tx Thank you for your help in understanding how to figure this out.

How to Identify Free GPIO Pin Accessible from Colibri Evaluation Board

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:

  1. Identify SODIMM comment in device tree imx6ull-colibri.dtsi starting at Line 345
  2. Search PDF Colibri Eval Board Data Sheet for SODIMM_pinNumber, for example “SODIMM_133
  3. Matches may be found in PDF for 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
  1. If no match found then, repeat with next GPIO PIN in device tree imx6ull-colibri.dtsi starting at Line 345

File: imx6ull-colibri.dtsi

	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 */
		>;
	};

Thanks again for helping me locate free GPIO pins that are accessible on the Colibri Eval Board.

-Ed

@aski.tx Thank you! Your reply was very helpful.

No, My answer is still there. I saw your reply.

Is the issue solved now?

Best regards,
Jaski