Error setting GPIOs on Jetson Nano

Hello, I am trying to set pin 127 (GPIO04) to high on the jetson nano board. I have tried to do so when connected to the devBoard, as well as on our own custom carrier board, and I get this error:

image

Other pins such as 120 will work. What is the cause of this? Is there something I need to do on the device tree to allow this?

Thanks,
Jason

Hi jmwright415,

Are you using the devkit or custom board for Jetson Nano?
What’s your Jetpack version in use?

Please share the result of the following command on your board.

$ sudo cat /sys/kernel/debug/gpio

and also the dmesg for further check.

Hey @KevinFFF,

Thanks for your reply. I am seeing this error when connected to a custom board as well as when connected to a devkit. Here is my Jetpack version 4.6.4:

Here is the output of sudo cat /sys/kernel/debug/gpio

jet@jet:/boot$ sudo cat /sys/kernel/debug/gpio
[sudo] password for jet:
gpiochip0: GPIOs 0-255, parent: platform/6000d000.gpio, tegra-gpio:
 gpio-0   (                    )
 gpio-1   (                    )
 gpio-2   (                    |pcie_wake           ) in  hi
 gpio-3   (                    )
 gpio-4   (                    )
 gpio-5   (                    )
 gpio-6   (                    |system-suspend-gpio ) out hi
 gpio-7   (                    )
 gpio-8   (                    )
 gpio-9   (                    )
 gpio-10  (                    )
 gpio-11  (                    )
 gpio-12  (SPI1_MOSI           )
 gpio-13  (SPI1_MISO           )
 gpio-14  (SPI1_SCK            )
 gpio-15  (SPI1_CS0            )
 gpio-16  (SPI0_MOSI           )
 gpio-17  (SPI0_MISO           )
 gpio-18  (SPI0_SCK            )
 gpio-19  (SPI0_CS0            )
 gpio-20  (SPI0_CS1            )
 gpio-21  (                    )
 gpio-22  (                    )
 gpio-23  (                    )
 gpio-24  (                    )
 gpio-25  (                    )
 gpio-26  (                    )
 gpio-27  (                    )
 gpio-28  (                    )
 gpio-29  (                    )
 gpio-30  (                    )
 gpio-31  (                    )
 gpio-32  (                    )
 gpio-33  (                    )
 gpio-34  (                    )
 gpio-35  (                    )
 gpio-36  (                    )
 gpio-37  (                    )
 gpio-38  (GPIO13              )
 gpio-39  (                    )
 gpio-40  (                    )
 gpio-41  (                    )
 gpio-42  (                    )
 gpio-43  (                    )
 gpio-44  (                    )
 gpio-45  (                    )
 gpio-46  (                    )
 gpio-47  (                    )
 gpio-48  (                    )
 gpio-49  (                    )
 gpio-50  (UART1_RTS           )
 gpio-51  (UART1_CTS           )
 gpio-52  (                    )
 gpio-53  (                    )
 gpio-54  (                    )
 gpio-55  (                    )
 gpio-56  (                    )
 gpio-57  (                    )
 gpio-58  (                    )
 gpio-59  (                    )
 gpio-60  (                    )
 gpio-61  (                    )
 gpio-62  (                    )
 gpio-63  (                    )
 gpio-64  (                    |i2c-mux-gpio        ) out hi
 gpio-65  (                    |?                   ) out hi
 gpio-66  (                    )
 gpio-67  (                    )
 gpio-68  (                    )
 gpio-69  (                    )
 gpio-70  (                    )
 gpio-71  (                    )
 gpio-72  (                    )
 gpio-73  (                    )
 gpio-74  (                    )
 gpio-75  (                    )
 gpio-76  (I2S0_FS             )
 gpio-77  (I2S0_DIN            )
 gpio-78  (I2S0_DOUT           )
 gpio-79  (I2S0_SCLK           )
 gpio-80  (                    )
 gpio-81  (                    )
 gpio-82  (                    )
 gpio-83  (                    )
 gpio-84  (                    )
 gpio-85  (                    )
 gpio-86  (                    )
 gpio-87  (                    |sysfs               ) in  lo
 gpio-88  (                    )
 gpio-89  (                    )
 gpio-90  (                    )
 gpio-91  (                    )
 gpio-92  (                    )
 gpio-93  (                    )
 gpio-94  (                    )
 gpio-95  (                    )
 gpio-96  (                    )
 gpio-97  (                    )
 gpio-98  (                    )
 gpio-99  (                    )
 gpio-100 (                    )
 gpio-101 (                    )
 gpio-102 (                    )
 gpio-103 (                    )
 gpio-104 (                    )
 gpio-105 (                    )
 gpio-106 (                    )
 gpio-107 (                    )
 gpio-108 (                    )
 gpio-109 (                    )
 gpio-110 (                    )
 gpio-111 (                    )
 gpio-112 (                    )
 gpio-113 (                    )
 gpio-114 (                    )
 gpio-115 (                    )
 gpio-116 (                    )
 gpio-117 (                    )
 gpio-118 (                    )
 gpio-119 (                    )
 gpio-120 (                    |sysfs               ) in  lo
 gpio-121 (                    )
 gpio-122 (                    )
 gpio-123 (                    )
 gpio-124 (                    |sysfs               ) out hi
 gpio-125 (                    )
 gpio-126 (                    )
 gpio-127 (                    )
 gpio-128 (                    )
 gpio-129 (                    )
 gpio-130 (                    )
 gpio-131 (                    )
 gpio-132 (                    )
 gpio-133 (                    )
 gpio-134 (                    )
 gpio-135 (                    )
 gpio-136 (                    )
 gpio-137 (                    )
 gpio-138 (                    )
 gpio-139 (                    )
 gpio-140 (                    )
 gpio-141 (                    )
 gpio-142 (                    )
 gpio-143 (                    )
 gpio-144 (                    )
 gpio-145 (                    )
 gpio-146 (                    )
 gpio-147 (                    )
 gpio-148 (                    )
 gpio-149 (GPIO01              )
 gpio-150 (                    )
 gpio-151 (                    )
 gpio-152 (                    )
 gpio-153 (                    )
 gpio-154 (                    )
 gpio-155 (                    )
 gpio-156 (                    )
 gpio-157 (                    )
 gpio-158 (                    )
 gpio-159 (                    )
 gpio-160 (                    )
 gpio-161 (                    )
 gpio-162 (                    )
 gpio-163 (                    )
 gpio-164 (                    )
 gpio-165 (                    )
 gpio-166 (                    )
 gpio-167 (                    )
 gpio-168 (GPIO07              )
 gpio-169 (                    )
 gpio-170 (                    )
 gpio-171 (                    )
 gpio-172 (                    )
 gpio-173 (                    )
 gpio-174 (                    )
 gpio-175 (                    )
 gpio-176 (                    )
 gpio-177 (                    )
 gpio-178 (                    )
 gpio-179 (                    )
 gpio-180 (                    )
 gpio-181 (                    )
 gpio-182 (                    )
 gpio-183 (                    )
 gpio-184 (                    )
 gpio-185 (                    )
 gpio-186 (                    )
 gpio-187 (                    )
 gpio-188 (                    )
 gpio-189 (                    |Power               ) in  hi IRQ
 gpio-190 (                    |Forcerecovery       ) in  hi IRQ
 gpio-191 (                    )
 gpio-192 (                    )
 gpio-193 (                    )
 gpio-194 (GPIO12              |sysfs               ) out hi
 gpio-195 (                    )
 gpio-196 (                    )
 gpio-197 (                    )
 gpio-198 (                    )
 gpio-199 (                    )
 gpio-200 (GPIO11              |sysfs               ) out hi
 gpio-201 (                    |cd                  ) in  lo IRQ
 gpio-202 (                    |pwm-fan-tach        ) in  hi IRQ
 gpio-203 (                    |vdd-3v3-sd          ) out hi
 gpio-204 (                    )
 gpio-205 (                    )
 gpio-206 (                    )
 gpio-207 (                    )
 gpio-208 (                    |sysfs               ) in  lo
 gpio-209 (                    )
 gpio-210 (                    )
 gpio-211 (                    |sysfs               ) in  lo
 gpio-212 (                    )
 gpio-213 (                    )
 gpio-214 (                    )
 gpio-215 (                    )
 gpio-216 (GPIO09              |sysfs               ) in  hi
 gpio-217 (                    )
 gpio-218 (                    |sysfs               ) in  lo
 gpio-219 (                    )
 gpio-220 (                    )
 gpio-221 (                    )
 gpio-222 (                    )
 gpio-223 (                    )
 gpio-224 (                    )
 gpio-225 (                    |hdmi2.0_hpd         ) in  hi IRQ
 gpio-226 (                    )
 gpio-227 (                    )
 gpio-228 (                    |extcon:extcon@1     ) in  hi IRQ
 gpio-229 (                    )
 gpio-230 (                    |sysfs               ) out hi
 gpio-231 (                    |?                   ) out hi
 gpio-232 (SPI1_CS1            )
 gpio-233 (                    )
 gpio-234 (                    )
 gpio-235 (                    )
 gpio-236 (                    )
 gpio-237 (                    )
 gpio-238 (                    )
 gpio-239 (                    )

gpiochip1: GPIOs 504-511, parent: platform/max77620-gpio, max77620-gpio, can sleep:
 gpio-505 (                    |spmic-default-output) out hi
 gpio-507 (                    |vdd-3v3-sys         ) out hi
 gpio-510 (                    |enable              ) out lo
 gpio-511 (                    |avdd-io-edp-1v05    ) out lo

As well as the output of dmesg. Thank you for suggesting that.

Here is part of the output of my kernel dtb file (/boot/kernel_tegra210-p3448-0000-p3449-0000-b00.dtb),. Does this need to be function= “gpio”; for the gpio pins I desire to use, and then the jetson reflashed with these changes? Or is there a specific line that needs to be modified?

I am looking to utilize all of these gpios below. Currently only GPIO02 and GPIO00 work.

Thank you for your assistance,
Jason

Then, let’s focus on the devkit first.

It seems gpio-120 has been exported from you with sysfs.

Please share the full dmesg as file here.
It seems something error when registering the pin.

Normally, you don’t need to configure the device tree.
Please just use pinmux spreadsheet to configure the pin status.

Which pin could not use currently?

Hey @KevinFFF,

dmesg.txt (58.0 KB)

Here is the dmesg outputted to a file. I am unable to use the pins as shown at the bottom of the file. Specifically I am trying to get pin 127 to work and be able to control it’s gpio value.

I am not sure what is your purpose to share this screenshot. This content is not the one from the spreadsheet.

These pins are from the max7760 PMIC GPIO. Which has nothing to do with the gpios you want to export here.

What did you exactly do after you generate files from the pinmux spreadsheet?

You are correct, my mistake. What values should I change to register the pin 127 to work in the jetson nano pinmux spreadsheet tool before generating the dtsi?

Hi,

The value of pin 127 does not matter. I feel the point here is it seems you ruined the whole device tree after you generate files from pinmux.

I didn’t mean the the file generated from spreadsheet has problem. My point is how you handle those generated files seems wrong.

That is why I asked:

What did you exactly do after you generate files from the pinmux spreadsheet?

Thanks @WayneWWW and @KevinFFF

The pin 127 has always had an error when trying to use it as a gpio, either from terminal commands or using the jetson gpio python package. It gives the message it is unregistered. I am trying to register it with a new generated device tree configuration. To do this I am compiling the dtb, placing it in the boot folder (from the dtsi generated from the spreadsheet), and then trying to activate it using the jetson-io tool. Is this correct?

I have seen some other things online about using a python file to generate a .cfg. Is there a way to just use the .dtsi files generated by the spreadsheet to update a dynamic configuration on the jetson that is called on boot to configure these gpio pins differently?

Could you share the exact steps you conducted as commands instead of such simple one?

To do this I am compiling the dtb, placing it in the boot folder (from the dtsi generated from the spreadsheet), and then trying to activate it using the jetson-io tool. Is this correct?

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