I just unboxed my TX2 Dev Kit earlier this week. Looking at a few forum threads and tutorials I see people exporting double digit pin numbers e.g. number 38 like here (https://devtalk.nvidia.com/default/topic/1025531/jetson-tx1/gpio-with-interrupts/#).
I make myself super user and then try to export pin 38 and I get back I/O error. I can however export pin number 219. Here’s the command:
# sudo sh -c "echo 38 > export"
sh: echo: I/O error
This is the page I have been looking at for pin info: http://www.jetsonhacks.com/nvidia-jetson-tx2-j21-header-pinout/. It seems to indicate the pin numbers run from 1 through 40. It does however have columns for “Sysfs GPIO”, but none of the numbers there are in my gpio file (see below).
How does the pin numbering work please?
Here’s my gpio file:
# cat /sys/kernel/debug/gpio
GPIOs 216-223, platform/max77620-gpio, max77620-gpio, can sleep:
gpio-216 ( |external-connection:) in hi
gpio-221 ( |spmic_gpio_input_5 ) in lo
gpio-222 ( |spmic_gpio_input_6 ) in hi
GPIOs 224-239, i2c/0-0077, tca9539, can sleep:
gpio-227 ( |en-vdd-sys ) out lo
gpio-228 ( |lcd-bias-en-rail ) out hi
gpio-233 ( |en-vdd-cam ) out lo
gpio-234 ( |en-vdd-cam-1v2 ) out lo
GPIOs 240-255, i2c/0-0074, tca9539, can sleep:
gpio-240 ( |vdd-usb2-5v ) out lo
gpio-241 ( |en-vdd-ts-1v8 ) out hi
gpio-242 ( |en-vdd-ts-hv-3v3 ) out hi
gpio-243 ( |en-vdd-disp-3v3 ) out lo
gpio-244 ( |vdd-fan ) out hi
gpio-247 ( |en-mdm-pwr-3v7 ) out lo
gpio-249 ( |en-vdd-disp-1v8 ) out lo
gpio-250 ( |dis-vdd-1v2 ) out hi
gpio-252 ( |vdd-hdmi ) out hi
gpio-253 ( |en-vdd-cam-hv-2v8 ) out lo
GPIOs 256-319, platform/c2f0000.gpio, tegra-gpio-aon:
gpio-272 ( |temp_alert ) in hi
gpio-312 ( |Power ) in hi
gpio-313 ( |Volume Up ) in hi
gpio-314 ( |Volume Down ) in hi
gpio-315 ( |wifi-wake-ap ) in lo
gpio-316 ( |bt_host_wake ) in lo
GPIOs 320-511, platform/2200000.gpio, tegra-gpio:
gpio-381 ( |reset_gpio ) out lo
gpio-412 ( |vdd-usb0-5v ) out lo
gpio-413 ( |vdd-usb1-5v ) out lo
gpio-420 ( |eqos_phy_reset ) out hi
gpio-421 ( |eqos_phy_intr ) in hi
gpio-424 ( |wlan_pwr ) out hi
gpio-426 ( |cam1-pwdn ) out lo
gpio-441 ( |hdmi2.0_hpd ) in hi
gpio-444 ( |wp ) in hi
gpio-445 ( |cd ) in hi
gpio-446 ( |en-vdd-sd ) out lo
gpio-456 ( |cam_pwdn_gpio ) out lo
gpio-457 ( |cam1-rst ) out lo
gpio-461 ( |cam_reset_gpio ) out lo
gpio-479 ( |external-connection:) in hi
gpio-484 ( |bt_ext_wake ) out hi