Gpioget not working on Verdin AM62 with Yocto multimedia image

Hi,

I’m using the Verdin AM62 module and built the Yocto multimedia image by setting:
MACHINE = “verdin-am62”
in my local.conf.

After flashing the image, I’m not able to access GPIOs. For example, when I try:
gpioget 1 0
I get the error:
gpioget: cannot find line ‘0’

Is there something I need to enable in the Yocto configuration or device tree to use gpioget?

Thanks in advance!

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello! Thank you for your question.

To access GPIOs on your Verdin AM62 using gpioget, the GPIOs must be properly enabled and configured in the device tree. Here’s how you can address this issue:

1. Confirm Device Tree Configuration

Ensure the relevant GPIO controller nodes are enabled (status = "okay";) in your device tree. If a controller (e.g., gpio1) is disabled, GPIO access won’t be available.

Example device tree overlay to enable a GPIO controller:

&gpio1 {
    status = "okay";
};

Device tree basics:

Device tree overview:

2. Device Tree Overlays

Toradex provides pre-built device tree overlays for enabling common features and peripherals. You might need to apply a suitable overlay, or create your own, depending on the specific GPIOs you wish to use:

3. Identifying the Correct GPIO Chip and Line

The gpioget 1 0 command refers to the second GPIO chip (chip index 1) and line 0. The actual mapping depends on your kernel’s GPIO numbering and the enabled controllers. You can list available GPIO chips using:

gpiodetect

This lists all GPIO chips. Find the one corresponding to the GPIO you want.

To list lines for a chip:

gpioinfo <chipname>

Replace <chipname> with e.g., gpiochip0, gpiochip1, etc.

4. Review Custom Image Configuration

As you’re building a custom image, make sure you’re not accidentally disabling GPIO support in your Yocto configuration. The reference Yocto image provided by Toradex should have GPIO enabled by default for Verdin AM62:


Summary of Steps

  • Verify the device tree enables required GPIO controllers.
  • Use gpiodetect and gpioinfo to check available GPIO chips and lines.
  • If needed, add or enable a device tree overlay as described in the docs above.
  • Rebuild and deploy the image with the correct configuration.

If you follow these steps, you should be able to access GPIOs with gpioget on your Verdin AM62 module.

Best regards,
Toradex AI Assistant.

Hello @ToradexAI

root@verdin-am62-15415775:~# ls
pictures sound video
root@verdin-am62-15415775:~# gpioinfo
gpiochip0 - 3 lines:
line 0: unnamed output
line 1: unnamed output
line 2: unnamed output
gpiochip1 - 24 lines:
line 0: “SODIMM_244” input active-low consumer=“PCIE_1_RESET#”
line 1: “SODIMM_206” input
line 2: “SODIMM_208” input
line 3: “SODIMM_210” input
line 4: “SODIMM_212” input
line 5: unnamed input
line 6: unnamed input
line 7: unnamed input
line 8: unnamed input
line 9: unnamed input
line 10: unnamed input
line 11: unnamed input
line 12: unnamed input
line 13: unnamed input
line 14: unnamed input
line 15: unnamed input
line 16: unnamed input
line 17: unnamed input
line 18: unnamed input
line 19: unnamed input
line 20: unnamed input
line 21: unnamed input
line 22: unnamed input
line 23: unnamed input
gpiochip2 - 92 lines:
line 0: “SODIMM_52” output consumer=“red:debug-1”
line 1: unnamed input
line 2: unnamed input
line 3: “SODIMM_56” output consumer=“red:debug-2”
line 4: “SODIMM_58” output consumer=“green:debug-2”
line 5: “SODIMM_60” input
line 6: “SODIMM_62” input
line 7: unnamed input
line 8: unnamed input
line 9: unnamed input
line 10: unnamed input
line 11: “SODIMM_54” output consumer=“green:debug-1”
line 12: “SODIMM_64” output active-low consumer=“spi0 CS1”
line 13: unnamed input
line 14: unnamed input
line 15: “SODIMM_174” input
line 16: “SODIMM_172” input
line 17: unnamed output active-low consumer=PHY reset
line 18: unnamed input
line 19: unnamed input
line 20: unnamed output active-low consumer=reset
line 21: unnamed output consumer=LDO1-VSEL-SD (PMIC)
line 22: unnamed input
line 23: unnamed input
line 24: unnamed input
line 25: unnamed input
line 26: unnamed input
line 27: unnamed input
line 28: unnamed input
line 29: “SODIMM_76” output consumer=“regulator-sdhci1”
line 30: “SODIMM_21” output active-low consumer=“reset”
line 31: “SODIMM_256” output consumer=“regulator-force-sleep-moci”
line 32: “SODIMM_252” input active-low consumer=“Wake-Up”
line 33: unnamed input
line 34: “SODIMM_46” input
line 35: “SODIMM_42” input
line 36: “SODIMM_218” input
line 37: unnamed input
line 38: “SODIMM_189” input
line 39: unnamed input
line 40: “SODIMM_216” input
line 41: “SODIMM_220” input
line 42: “SODIMM_222” input
line 43: unnamed input
line 44: unnamed input
line 45: unnamed input
line 46: unnamed input
line 47: unnamed input
line 48: unnamed input
line 49: unnamed input
line 50: unnamed input
line 51: unnamed input
line 52: unnamed input
line 53: unnamed input
line 54: unnamed input
line 55: unnamed input
line 56: unnamed input
line 57: unnamed input
line 58: unnamed input
line 59: unnamed input
line 60: unnamed input
line 61: unnamed input
line 62: unnamed input
line 63: unnamed input
line 64: unnamed input
line 65: unnamed input
line 66: unnamed input
line 67: unnamed input
line 68: unnamed input
line 69: unnamed input
line 70: unnamed input
line 71: “SODIMM_157” input
line 72: “SODIMM_187” input
line 73: unnamed input
line 74: unnamed input
line 75: unnamed input
line 76: unnamed input
line 77: unnamed input
line 78: unnamed input
line 79: unnamed input
line 80: unnamed input
line 81: unnamed input
line 82: unnamed input
line 83: unnamed input
line 84: unnamed input
line 85: unnamed input
line 86: unnamed input
line 87: unnamed input
line 88: unnamed input
line 89: unnamed input
line 90: unnamed input
line 91: unnamed input
gpiochip3 - 52 lines:
line 0: unnamed input
line 1: unnamed input
line 2: unnamed input
line 3: unnamed input
line 4: unnamed input
line 5: unnamed input
line 6: unnamed input
line 7: unnamed input
line 8: unnamed input
line 9: unnamed input
line 10: unnamed input
line 11: unnamed input
line 12: unnamed input
line 13: unnamed input
line 14: unnamed input
line 15: “SODIMM_15” input
line 16: “SODIMM_16” input
line 17: “SODIMM_19” input consumer=“hpd”
line 18: “SODIMM_66” input
line 19: “SODIMM_161” input consumer=“id”
line 20: unnamed input
line 21: unnamed input
line 22: unnamed input
line 23: unnamed input
line 24: unnamed input
line 25: unnamed input
line 26: unnamed input
line 27: unnamed input
line 28: unnamed input
line 29: unnamed input
line 30: unnamed input
line 31: unnamed input
line 32: unnamed input
line 33: unnamed input
line 34: unnamed input
line 35: unnamed input
line 36: unnamed input
line 37: unnamed input
line 38: unnamed input
line 39: unnamed input
line 40: unnamed input
line 41: unnamed input
line 42: unnamed input
line 43: unnamed input
line 44: unnamed input
line 45: unnamed input
line 46: unnamed input
line 47: unnamed input
line 48: unnamed input active-low consumer=cd
line 49: “SODIMM_17” input
line 50: “SODIMM_155” output consumer=“regulator-usb0-vbus”
line 51: unnamed input
root@verdin-am62-15415775:~# gpiodetect
gpiochip0 [tps65219-gpio] (3 lines)
gpiochip1 [4201000.gpio] (24 lines)
gpiochip2 [600000.gpio] (92 lines)
gpiochip3 [601000.gpio] (52 lines)
root@verdin-am62-15415775:~# gpioinfo gpiochip0
gpioinfo: cannot find line ‘gpiochip0’
root@verdin-am62-15415775:~# gpiochip2
-sh: gpiochip2: command not found
root@verdin-am62-15415775:~# gpiochip3
-sh: gpiochip3: command not found
root@verdin-am62-15415775:~#

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

Did you like my answer? :+1: :-1:


Hello! Thanks for sharing your output. Your GPIO setup is working correctly—the system detects all four GPIO chips, and you can see the available lines on each. Some clarification on command usage and pin access:


1. Correct Usage of gpioinfo and gpioget/gpioset

  • Use chip number with gpioinfo, gpioget, and gpioset, not the chip name.
  • Example:
    To list info for gpiochip0 (first chip), run:
    gpioinfo 0
    
    To read a line, for example SODIMM_206 (gpiochip1, line 1):
    gpioget 1 1
    

2. Mapping SODIMM Pins to GPIO Chips

According to your listing and the Verdin AM62 GPIO mapping:

  • SODIMM_206 = gpiochip1, line 1
  • SODIMM_208 = gpiochip1, line 2
  • SODIMM_52 = gpiochip2, line 0
  • SODIMM_56 = gpiochip2, line 3
  • etc.

For dedicated GPIOs, refer to the Verdin AM62 datasheet, Section 5.4:


3. Example GPIO Commands

  • List lines on GPIOS:
    gpioinfo 1     # info for gpiochip1 (24 lines)
    
  • Read a GPIO line:
    gpioget 1 2    # Reads SODIMM_208 (gpiochip1, line 2)
    
  • Set a GPIO as output high:
    gpioset 2 0=1  # Set SODIMM_52 (gpiochip2, line 0) to high
    
  • Multiple lines can be set like this:
    gpioset 2 3=1 4=0
    

4. About Your Errors

  • The command:
    gpioinfo gpiochip0
    
    fails because gpioinfo expects a chip number, not a name. The correct use:
    gpioinfo 0
    
  • Typing gpiochip2 by itself won’t work; it’s not a command but a device name.

5. Device Tree Overlays (If Needed)

If you want to change pin direction or initial state by default, you can apply a Device Tree Overlay:


Summary:
Your GPIO subsystem is working—just use chip numbers with gpiodetect, gpioinfo, gpioget, and gpioset as shown above. For pin mapping and advanced configuration, refer to the datasheet and the links above.

Best regards,
Toradex AI Assistant.

@ToradexAI

line  51:	unnamed         	input

root@verdin-am62-15415775:~# gpiodetect
gpiochip0 [tps65219-gpio] (3 lines)
gpiochip1 [4201000.gpio] (24 lines)
gpiochip2 [600000.gpio] (92 lines)
gpiochip3 [601000.gpio] (52 lines)
root@verdin-am62-15415775:~# gpioinfo gpiochip0
gpioinfo: cannot find line ‘gpiochip0’
root@verdin-am62-15415775:~# gpiochip2
-sh: gpiochip2: command not found
root@verdin-am62-15415775:~# gpiochip3
-sh: gpiochip3: command not found
root@verdin-am62-15415775:~# gpioinfo 0
gpioinfo: cannot find line ‘0’
root@verdin-am62-15415775:~# gpioget 1 1
gpioget: cannot find line ‘1’
gpioget: cannot find line ‘1’
root@verdin-am62-15415775:~# gpioinfo 1
gpioinfo: cannot find line ‘1’
root@verdin-am62-15415775:~# gpioinfo 0
gpioinfo: cannot find line ‘0’
root@verdin-am62-15415775:~#

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

Did you like my answer? :+1: :-1:


Hello,

It looks like the commands you are using are not matching the correct syntax for your version of the libgpiod utilities. On your Verdin AM62 system, you have the libgpiod 1.x command-line tools, which require you to use the device path (like /dev/gpiochip0), not just the chip number or chip name.

Please try the following commands:

  1. List lines of a GPIO chip
    For gpiochip0:

    gpioinfo /dev/gpiochip0
    

    For gpiochip1:

    gpioinfo /dev/gpiochip1
    

    For gpiochip2:

    gpioinfo /dev/gpiochip2
    

    For gpiochip3:

    gpioinfo /dev/gpiochip3
    
  2. Read a specific GPIO line
    For example, to read gpiochip1, line 1 (SODIMM_206):

    gpioget /dev/gpiochip1 1
    
  3. Set a GPIO output
    For example, to set gpiochip2, line 0 (SODIMM_52) high:

    gpioset /dev/gpiochip2 0=1
    

Common mistakes:

  • You must provide the full device path (e.g., /dev/gpiochip2), not just the number or the chip name.
  • There are no commands like gpiochip2 by themselves; they are device nodes, not executables.

For more details, see:

Let me know if these commands work for you!

Best regards,
Toradex AI Assistant.

@ToradexAI

No not working

root@verdin-am62-15415775:~# gpioinfo /dev/gpiochip0
gpioinfo: cannot find line ‘/dev/gpiochip0’
root@verdin-am62-15415775:~# gpioinfo /dev/gpiochip3
gpioinfo: cannot find line ‘/dev/gpiochip3’
root@verdin-am62-15415775:~#

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

Did you like my answer? :+1: :-1:


Thank you for testing and providing clear feedback.

Based on these errors, it appears you have a version of the libgpiod utilities that expects a different syntax than either the classic (v1.x) or newer (v2.x) tools. Let’s troubleshoot this step by step:


1. Check Your libgpiod Version

Run the following command to check which version of the utilities you have:

gpiodetect --version

Please let me know the output. It will help determine the correct syntax.


2. Try Listing Chips and Lines by Name

For some older utility versions, the tools expect just the chip name (not number, not path):

gpioinfo gpiochip0
gpioinfo gpiochip1
gpioinfo gpiochip2
gpioinfo gpiochip3

3. Try Line Numbers for gpioget

Attempt to read or set a GPIO using the chip name and line index (not path or number):

gpioget gpiochip1 1
gpioset gpiochip2 0=1

4. Fallback: Use the sysfs Interface

On some older BSPs/images, you may need to use the sysfs interface. Example for GPIO 1 (change to match your desired GPIO):

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

Check which GPIO numbers are available:

ls -la /sys/class/gpio/

5. For Reference

Please see:


Summary:
Your error points to a mismatch between the commands and your libgpiod utility version. Please report the version and try the alternatives above. We’ll adapt based on your findings.

Best regards,
Toradex AI Assistant.