Our device is a ‘A02’ version, however I’m not able to export the pin.
ubuntu@jetson-1:~$ sudo cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-255, parent: platform/6000d000.gpio, tegra-gpio:
gpio-2 ( |pcie_wake ) in hi
gpio-6 ( |vdd-usb-hub-en ) out hi
gpio-151 ( |cam_reset_gpio ) out lo
gpio-187 ( |? ) out hi
gpio-189 ( |Power ) in hi IRQ
gpio-190 ( |Forcerecovery ) in hi IRQ
gpio-201 ( |cd ) in lo IRQ
gpio-202 ( |pwm-fan-tach ) in hi IRQ
gpio-203 ( |vdd-3v3-sd ) out hi
gpio-225 ( |hdmi2.0_hpd ) in hi IRQ
gpio-228 ( |extcon:extcon@1 ) in hi IRQ
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
ubuntu@jetson-1:~$ sudo echo 6 > /sys/class/gpio/export
echo: write error: Device or resource busy
I get the same response using python gpio library. Can you tell me how to use access this pin?
This tells the shell to run “echo 6” in the context of super-user, after redirecting standard out to /sys/class/gpio/export…
But the shell is not root, so it can’t redirect to that file.
You need to either first “sudo -i” and then run the commands without sudo (so you have a root shell,) or run the entire shell expression as root.
sudo sh -c 'echo 6 > /sys/class/gpio/export
Or you can just bang the registers directly, using C/C++ code. There’s some code here to do that:
Note that this code is written as an example of how to talk to the GPIO hardware from user space; I haven’t tested it for this particular use case. But … it ought to work, perhaps with minimal changes?
Also, because it uses /dev/mem, it needs root.
The echo 6 suggestion yields the same result as before, even with the extra sudo flag.
DaneLLL: your link points to pretty much exactly what we’re trying to do: power-cycle the usb hub.
However, the corresponding regulator device on the Nano doesn’t seem to respond to writing to the ‘state’ file as shown here:
As I am having an unstable WLAN Access I supected that this solution could help.
Using this command (June 2020; more recent software):
sudo apt-get install libusb-1.0-0-dev
Its said, already installed.
When using:
gcc -o power_cycle realtek_hub_power_cycle.c -lusb-1.0
there is an error message:
gcc: error: realtek_hub_power_cycle.c: No such file or directory.
Nevertheless, the message: WARNING: system is no being throttled is still coming.
Was there a change?
Hi, just want to confirm, if this script works for Jetson Nano to power cycle individual USB port? or is there anyway to control individual port? Thanks!