question about xavier recovery botton


We would like to detect the middle of the three buttons.
And what’s the pin number should we fill in to the second parameter of “gpio_config(gpio_drv, cd_gpio->pin, GPIO_PINMODE_INPUT);” function ?


hello boyi_liao,

suggest you refer to Jetson AGX Xavier OEM Product Design Guide, then you’ll able to check the details of FORCE_RECOVERY_N pin.
you might also access Jetson AGX Xavier Platform Adaptation and Bring-Up Guide, and check the [GPIO Changes] session for the steps to calculate the GPIO numbers.

Hi JerryChang:

Our question is can we read the status from software in cboot ?


hello boyi_liao,

yes, you could read the pin status in cboot,
please access cboot sources via Jetson Download Center
for example,


static tegrabl_error_t tegrabl_gpio_read(uint32_t gpio_num,
                                         gpio_pin_state_t *state, 
                                         void *drv_data)

you may have modification to customize your cboot binary,
then you could update the cboot partition with the following commands,

$ sudo ./ -r -k cpu-bootloader jetson-xavier mmcblk0p1

Hi JerryChang:

I know we can use tegrabl_gpio_read function to read gpio, but according read the doc we stiil didn’t
know what’s the recovery button pin number.


hello boyi_liao,

please download Jetson AGX Xavier Pinmux spreadsheet.
you should check the GPIO pin of the FORCE_RECOVERY_N pin, which is GPIO3_PG.00.

according to [GPIO Changes] session in Jetson AGX Xavier Platform Adaptation and Bring-Up Guide,
you’ll check the port index and also the offset as below.

port index:

nvidia@nvidia:~$ dmesg | grep tegra-gpio
[    1.027424] gpiochip_setup_dev: registered GPIOs 288 to 511 on device: gpiochip0 (tegra-gpio)
[    1.037438] gpiochip_setup_dev: registered GPIOs 248 to 287 on device: gpiochip1 (tegra-gpio-aon)

then, the calculation of GPIO3_PG.00 = (6*8+0)+288 = 336.

Hi JerryChange:

Thank your response, we still have some questions.

  1. it’s the pin number in linux is 336 .
  2. Is it the same number in cboot ?
  3. how to know it’s TEGRA194_MAIN_GPIO_PORT_G ?


hello boyi_liao,

there’s same GPIO pin number for your usage.
please check comment #6 about TEGRA194_MAIN_GPIO_PORT_G.