Calculate the GPIO number

We need to configure the K49 pin as GPIO, from the pinmux sheet we could that the GPIO is GPIO3_PM.05.

From the link Jetson AGX Orin Platform Adaptation and Bring-Up — Jetson Linux<br/>Developer Guide 34.1 documentation

I could see the following screen shot to calculate the GPIO number.

Can you help us how to know the base address for GPIO3_PM.05 to calculate the GPIO number as per the above screen shot.

*** Please note that this reply is generated by LLM automatically ***

To calculate the GPIO number for GPIO3_PM05 on the Jetson AGX Orin, we need to follow the steps outlined in the documentation. Here’s a step-by-step guide:

  1. Identify the port and pin offset for GPIO3_PM05:
    • From the pinmux sheet, we know that GPIO3_PM05 is located on port M, pin 05.
  2. Determine the base address for GPIO3:
    • The base address for GPIO3 is not explicitly mentioned in the provided context. However, we can infer that the base address is likely to be the same as the one mentioned in the context for the Jetson Orin NX Series and Jetson Orin Nano Series, which is 348.
    • To confirm, we can check the kernel boot log for the tegra234-gpio entry, which should indicate the base index for GPIO3.
  3. Calculate the port offset for port M:
    • The port offset for port M is not explicitly mentioned in the provided context. However, we can refer to the tegra234 GPIO port and offset mapping to determine the port offset for port M.
    • Assuming the port offset for port M is similar to the one mentioned in the context for port B (which is 8), we can use a similar value for port M. Let’s assume the port offset for port M is 16 (this value may need to be verified).
  4. Calculate the pin number using the formula:
    • base + port_offset + pin_offset
    • Substituting the values, we get: 348 + 16 + 05 = 369

Therefore, the GPIO number for GPIO3_PM05 on the Jetson AGX Orin is likely to be 369. However, please note that this calculation assumes the base address and port offset values are correct, and may need to be verified using the kernel boot log and tegra234 GPIO port and offset mapping.

In comparison, the provided context mentions the calculation for SOC_GPIO08 (GPIO3_PB.00) on the Jetson Orin NX Series and Jetson Orin Nano Series, which results in a GPIO number of 356. The main difference between the two calculations is the port offset value, which is 8 for port B and assumed to be 16 for port M.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

Hi rkk2,

Are you using the devkit or custom board for AGX Orin?
What’s the Jetpack version in use?

To get the GPIO number, you can simply run the following command to check.

# sudo cat /sys/kernel/debug/gpio |grep PM.05
 gpio-429 (PM.05               )

We are using Jetson AGX Orin based custom carrier board and the jetpack version is 6.

Okay, it should also be fine with custom carrier board.
Please let me know if you have further question to get the gpio number with the previous command I shared.

$ sudo cat /sys/kernel/debug/gpio|grep gpiochip

You can also run above command to check the available GPIO controller and the range of their GPIO number.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.