GPIO qusetions

I’m new to embeded system, and I wonder how I can use the API for GPIOs, such as
gpio_set_value(num,0); gpio_set_value(num,1);
when I type:
gpio_set_value(478,1)
It returns:

bash: syntax error near unexpected token '478,1'

what should I fill in at “num”

We have

  • JETPACK 4.5 [L4T 32.5.1]
nvidia@nvidia-desktop:~$ sudo cat /sys/kernel/debug/gpio
gpiochip2: GPIOs 240-247, parent: platform/max77620-gpio, max77620-gpio, can sleep:
 gpio-246 (                    |gpio_default        ) out hi    
 gpio-247 (                    |gpio_default        ) out hi    

gpiochip1: GPIOs 248-287, parent: platform/c2f0000.gpio, tegra-gpio-aon:
 gpio-253 (                    |pex-refclk-sel-low  ) out lo    
 gpio-265 (                    |vdd-otg1-5v         ) out hi    
 gpio-266 (                    |vdd-usb2-5v         ) out hi    
 gpio-267 (                    |vdd-hdmi-5v0        ) out hi    
 gpio-284 (                    |power-key           ) in  hi    

gpiochip0: GPIOs 288-511, parent: platform/2200000.gpio, tegra-gpio:
 gpio-336 (                    |force-recovery      ) in  hi    
 gpio-338 (                    |vdd-sdmmc1-sw       ) out lo    
 gpio-339 (                    |wifi-enable         ) out hi    
 gpio-378 (                    |pcie_wake           ) in  hi    
 gpio-385 (                    |hdmi2.0_hpd         ) in  lo    
 gpio-392 (                    |avdd-cam-2v8        ) out lo    
 gpio-419 (                    |external-connection:) in  hi    
 gpio-424 (                    |vdd-sdmmc3-sw       ) out lo    
 gpio-425 (                    |eqos_phy_reset      ) out hi    
 gpio-428 (                    |j12-pin4            ) out lo    
 gpio-429 (                    |j12-pin3            ) out lo    
 gpio-478 (                    |j12-pin8            ) out lo    
 gpio-479 (                    |j12-pin7            ) out lo    
 gpio-480 (                    |j10-pin5            ) out lo    
 gpio-481 (                    |j10-pin6            ) out lo    
 gpio-482 (                    |j10-pin7            ) out lo    
 gpio-483 (                    |j10-pin8            ) out lo    
 gpio-489 (                    |external-connection:) in  hi

I want to chage the gpio478 level form low to high for simple test, how can I get it

If you want the simplest method, you can refer to this page.

Also, I am not sure what “j12-pin8” is. If this is already occupied by specific driver, then you can only change the gpio behavior through that driver. Sysfs may not work.

I tried the way on the links to web pages, defined a gpio478,out,value:1, and the text did changed form “j12-pin8” to “sysfs”, but I still can not detect a high level on the pin.

gpio-478 (                    |sysfs              ) out hi

And I found every time I restart the mechine, the ‘sysfs’ change back to ‘j12-pin8’
I wonder what’s the problem based on your experience.

Are you using custom board or nvidia devkit?

I am using Nvidia Xavier NX with rtso-6002-emmc

Issue is related with rtso-6002-emmc board. You may contact with vendor for the support.

Thanks

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