Switching uart rx/tx (pins 8 & 10) to gpio TX2

Using Jetson-TX2-Series-Pinmux-Template I changed the Customer Usage for both uart pins 8 & 10 to GPIO3_PT, exported the dtsi files, converted them to cfgs and re-flashed the TX2.

I have two questions:

  1. The pins are listed as ‘rsvd’ instead of ‘unused’, is this anything to be concerned about?

  2. I am unable to test the pins gpio functionality using jetson-gpio as the pins are not registered in the gpio_pin_date.py file. Is it safe/recommended to manually add the pin into this file? Or is their another more common method to enabling the gpio api for pin 8 10?

hello user7414,

that should works, could you please try to toggle the pin by sysfs?
for example,

#define TEGRA_MAIN_GPIO(port, offset) \
  	((TEGRA_MAIN_GPIO_PORT_##port * 8) + offset)
[    0.470658] gpiochip_setup_dev: registered GPIOs 320 to 511 on device: gpiochip0 (tegra-gpio)
[    0.474610] gpiochip_setup_dev: registered GPIOs 256 to 319 on device: gpiochip1 (tegra-gpio-aon)

the gpio number of GPIO3_PT.00 is… 18 * 8 + 0 + 320 = 464
you may enable GPIOs manually once you know the GPIO number,
for example,
# echo 464 > /sys/class/gpio/export
# cd gpio464
# echo 1 > value


Thanks for the quick response, I tried to run the example but I get the following write error:

As a side note I had already ran the following to setup permissions:
sudo groupadd -f -r gpio
sudo usermod -a -G gpio lab

hello user7414,

you may export and control the GPIO with root permission,
please try $ sudo -i for entering root to have verification.

Thank you, that worked. I am able to manually execute control commands to the GPIO. How do I go about adding the pin/s to the Rpi.gpio (jetson-gpio) so that I can control them via software?

hello user7414,

you may add the pin definition then you’ll able to control it through software level.
please look into gpio_pin_data.py and test_all_pins.py for reference,

I’ve been spending time creating the definition for each pin I’ve modified to be GPIO i.e. pins 3, 5, 8, 10. I’ve looked through documentation and forms but I can figure out a couple of values used for the definitions (indicated by cross out text):

  1. I don’t understand where the values 140: 117/47:31 comes from? I understand that 192: 146,/64: 40 represents (GPIO range: Linux GPIO pin number.

  2. I can’t find any documentation or information listing BCM (Broadcom SoC GPIO numbers) for each pin.

hello user7414,

don’t there, Line32-Line47 show the description of each field in the array?

here’s head file to define all the GPIO ports and the calculation formula.
for example, $L4T_Sources/r32.6.1/Linux_for_Tegra/source/public/kernel/kernel-4.9/include/dt-bindings/gpio/tegra186-gpio.h
please also see the developer guide, GPIO Changes for the instructions to check the GPIO number.

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