GPIO with boot2qt image

Hello,

I have the iMX6ULL with the boot2qt image installed.
I want to control a pin (SODIMM_76).
I don’t have libgpiod. Can I install it?

I have a LED connected to pin SODIMM_76 on my Colibri Evaluation Board
I tried to set the GPIO with sysfs but it doesn’t seem to work.

echo 69 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio69/direction
echo 1 > /sys/class/gpio/gpio69/value

When I run cat /sys/kernel/debug/gpio I see the this:

2024-09-28_15-18

But the LED does not turn on :roll_eyes:

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Based on the context provided, it seems you are using the deprecated sysfs interface to control GPIOs on your iMX6ULL with the boot2qt image. Since the sysfs interface is deprecated and you don’t have libgpiod installed, you might face issues.

Here are a few steps you can take to resolve this:

  1. Verify Pin Multiplexing:
    Ensure that the pin SODIMM_76 is correctly muxed as a GPIO in the device tree. If the pin is not muxed correctly, it will not function as expected. You might need to modify the device tree to set the pin function to GPIO.

  2. Install libgpiod:
    If possible, install libgpiod on your boot2qt image. This library provides a more modern and reliable way to control GPIOs. You can check if libgpiod is available in your package manager or build it from source.

  3. Using sysfs:
    If you must use sysfs, ensure that the GPIO number is correct. For SODIMM_76 on the Colibri iMX6ULL, the GPIO number might be different. You can find the correct GPIO number by referring to the Colibri iMX6ULL datasheet and the carrier board schematic.

  4. Check GPIO Export:
    Ensure that the GPIO is successfully exported and that you have the necessary permissions to access the GPIO sysfs interface.

Here is a revised approach using sysfs, assuming the GPIO number is correct:

echo 69 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio69/direction
echo 1 > /sys/class/gpio/gpio69/value

After running these commands, check the status of the GPIO:

cat /sys/class/gpio/gpio69/value

If the value is 1 and the LED does not turn on, there might be an issue with the hardware connection or the pin muxing.

  1. Debugging:
    Use the following command to check the status of all GPIOs:
cat /sys/kernel/debug/gpio

This will help you verify if the GPIO is correctly configured and if there are any conflicts.

If you continue to face issues, consider switching to a Toradex BSP that includes libgpiod for better GPIO management.

Please, also check if these links can help you solve your problem:

GPIO issues on Apalis iMX6 boot2qt 5.12.4.

How do I verify pin multiplexing?
How can I install libgpiod?

Hey there! I just went through this process. I was able to verify GPIO by using the command

$ gpioinfo 

From within my docker container!

You can also use

$ sudo tdx-info -dt

from within your Torizon OS to confirm that you are properly using the correct device tree/device tree overlays

image

I’m not using Torizon OS

image

If you have the apt package manager, you can do this to get the gpio commands. the documentation can help you better understand the tests too!

sudo apt update
sudo apt install gpiod

image

I just found out that there is opkg! However, it does not know libgpiod :roll_eyes:

I have installed the Toradex Reference Minimal Image (6.8.0)
This one has the gpio library installed.
I have the Colibry Evaluation Board.
I have connected the SODIMM_76 pin on the X9 connector to LED1 pin of X21 connector.

gpioset /dev/gpiochip2 5=1

But the LED does not turn on :roll_eyes:

afbeelding

When I use SODIMM_102 I’m able to toggle the LED :star_struck:

What do I need to do in order to use SODIMM_76?

Hi @gguns

There’s a lot of questions here.

First, gpio sysfs is deprecated by the linux kernel in place of libgpiod, but you should still be able to use, it’s just not recommended.

To install a package in boot2qt you need to add it using Yocto.

You need to check the Colibri iMX6ULL datasheet for which pins are available .

And check the device tree to see what the pins are being used for.

If the pin is already being used by with another function, you won’t be able to use it as a gpio.

	pinctrl_lcdif_dat: lcdifdatgrp {
		fsl,pins = <
			MX6UL_PAD_LCD_DATA00__LCDIF_DATA00 0x00079	/* SODIMM 76 */

is there a specific reason you want to use SODIMM_76?

Hi Allen, thanks for all your feedback.

Yes, our PCB designer uses this pin to enable a serial input.
We want to use UART6 (UART_D ?) to receive a data stream from a serial device.
I need to make SODIMM 76 high before the serial data will pass through.
It seems that I also need to make a change in the device tree in order to use UART6.

We don’t use a LCD panel. Can we disable &lcdifdatgrp and &lcdifctrlgrp in order to free up SODIMM 76 for general I/O?

How do we enable &uart6 properly?
We only use the receive pin.

Hi @gguns

You can change the SODIMM 76 pin function back to gpio3.IO[5].

So, are you using a custom carrier board?
And the product is already on the shelf, you are just working on upgrading an existing product?
Just to have a better understanding of your use case.

Yes, it’s is a custom carrier board. It’s a new product. I have the prototype and now I try to get it to work.