Gpio control in JP 5.0.2

I have Jetson Agx development board with JP 5.0.2-b231. the problem is with gpio setting. in JP 4.6.2 i use gpios 250,251,257,248,249 .
now this gpio keys do not work. it is not clear how to find new pin number fot these gpios. could you pls send me an example how to calculate new key for gpio 248 for example(pin 33)

There are some discussions here:

thanks a lot for reply.
per mapping that i downloaded from nvidia (Jetson-Xavier-GPIO-mapping) :

33 GPIO13 Low CAN1_DOUT CAN1_DOUT CAN1_DOUT CAN1_DOUT AA.00 0 248 248.
but /sys/kernel/debug/gpio doesn’t include AA.00 directory. could you pls explain how to control GPIO per this table.

Can you provide the link where you downloaded the mapping?

i have https://jetsonhacks.com/wp-content/uploads/2018/11/Jetson-Xavier-GPIO-mapping.xlsx. maybe this link is wrong?
another link is:
Log in | NVIDIA Developer
but in this link there is no gpio number , for example for the same CAN1_DOUT signal:

CAN1_DOUT H61 CAN1_DOUT AA49 unused_CAN1_DOUT GPIO3_PAA.00 CAN1_DOUT B O CAN1 RSVD1 RSVD2 RSVD3 RSVD1 can1_dout_paa0 vddio_ao_hv CZ BDSDMEM_DFCR90M14L_VDP1P1P1VC 19.5K +/- 35% pu GPIO_PAA0 PULL_DOWN TRISTATE ENABLE 1 1 1 1 1 1 VALID GPIO3_PAA.00 Input Int PD 40-pin header Pin 33 GPIO/CAN1 Bus

could you pls help to understand it/send correct link

hello sabina.greenberg,

FYI. gpio allocation range has changed since k-5.10.
you may refer to developer guide, To check the GPIO number. please follow the GPIO debugfs for looking up the port and offset.

Hi , thank you very much, now it is clear.
In the JP 4.6 we used pin#18 GPIO35_PWM3. now it is 479/ PX.03
After ‘echo 479>/sys/class/gpio/export’ command AGX box perform shutdown. Could we continue to use this GPIO? in the Jetson_AGX_Xavier_Series_Pinmux_Configuration is marked as CVM only.

hello sabina.greenberg,

may I know what’s the actual pin usage for PX.03? this is already used as PWM. you cannot alter this pin via debugfs.

Hi,
It was my fault with this pin. we have problem with pin#26 . (40-pin header Pin 26 GPIO/SPI1)
per configuration it is GPIO3_PZ.07. after command sudo cat /sys/kernel/debug/gpio | grep PZ.07 i get: gpio-499 (PZ.07. so we use this pin as io499. when this pin defined as output - it work. But when it is defined as input - doesn’t work.(always read 1). we work with evaluation board. is it impossible to use this pin as input?

hello sabina.greenberg,

you need to configure the pinmux spreadsheets to alter pin direction,
please see-also developer guide, Pinmux Changes session to change the pinmux configuration applied by the software.

Hi,
thank, yes we use this link.
I’ve defined GPIO 499 as INPUT. cat /sys/class/gpioPZ.07/direction return IN. We have problems with GPIO 499 only. . GPIO 387, 388 , 306 work as input properly. should we do any additional changes for this specific GPIO?

hello sabina.greenberg,

may I know what’s the pinmux configured you’ve done with this pin PZ.07.

hi,
i do the following configuration:

  1. echo 499 >/sys/class/gpio/export
  2. echo in >/sys/class/gpio/PZ.07/direction
  3. cat /sys/class/gpio/PZ.07/direction
    in

hello sabina.greenberg,

it looks correct, and this pin by default configured as input with internal pull-up.
may I know what’s the exactly problems with GPIO 499 only, please describe the issue and share the logs for reference.

Hi,
I’ve configured gpio388 as output, gpio 499 as input and connected between them
all work good.(set gpio388 values 0/1 => read gpio499 0/1).
After it I’ve configured gpio387 as output, gpio 498 as input and connected between them,
after I set gpio387, & gpio388 values 0/1 - read wrong gpio499 values(always 0 or 1 ).

hello sabina.greenberg,

is there a typo?? why you not checking gpio498 for this case?

i am reading it also, it doesn’t work good too. Same as 499(always the same value). It seems that i can not set as input together 498 and 499.