Hi,
in our application we use Jetson Orin Nano with carrier board not manufactured by Nvidia (Seedstudio J401 carrier board).
I want to configure 32 pin of 40 pin expansion header to be PWM.
I changed configuration of pin 32 to PWM in PINMUX spreadsheet for Orin Nano. I exported all necessary fiiles and linked them to board.conf file.
Flash was successful and it was verified by running command
$ sudo /opt/nvidia/jetson-io/jetson-io.py
I verified that pin 32 was already configured as PWM (so pinmux configuration went well).
Afterwards I tried following:
$ sudo apt update
$ sudo apt install git python3-pip
$ git clone https://github.com/NVIDIA/jetson-gpio.git
$ cd jetson-gpio
$ sudo python3 setup.py install
$ cd samples
(modify the following line in simple_pwm.py)
output_pins = {
'JETSON_XAVIER': 18,
- 'JETSON_NANO': 33,
+ 'JETSON_NANO': 32,
'JETSON_NX': 33,
'CLARA_AGX_XAVIER': 18,
'JETSON_TX2_NX': 32,
'JETSON_ORIN': 18,
'JETSON_ORIN_NX': 33,
'JETSON_ORIN_NANO': **32**
}
$ sudo python simple_pwm.py
However this throws error:
dan@device01:~/jetson-gpio/samples$ python simple_pwm.py
Traceback (most recent call last):
File "simple_pwm.py", line 22, in <module>
import RPi.GPIO as GPIO
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "/usr/local/lib/python3.8/dist-packages/Jetson.GPIO-2.1.6-py3.8.egg/RPi/GPIO/__init__.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "/usr/local/lib/python3.8/dist-packages/Jetson.GPIO-2.1.6-py3.8.egg/Jetson/GPIO/__init__.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "/usr/local/lib/python3.8/dist-packages/Jetson.GPIO-2.1.6-py3.8.egg/Jetson/GPIO/gpio.py", line 33, in <module>
RuntimeError: The current user does not have permissions set to access the library functionalites. Please configure permissions or use the root user to run this. It is also possible that /dev/gpiochip0 does not exist. Please check if that file is present.
I believe there is some issue with current configuration, because following command returns result which is bad.
$ sudo cat /sys/kernel/debug/pwm
platform/39c0000.tachometer, 1 PWM device
pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: normal
platform/32c0000.pwm, 1 PWM device
pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: normal
platform/32a0000.pwm, 1 PWM device
pwm-0 (pwm-fan ): requested enabled period: 45334 ns duty: 9956 ns polarity: normal
platform/3280000.pwm, 1 PWM device
pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: normal
I believe there is one PWM entry missing and it is the entry that is used for PWM on pin 32. It is this entry that is missing:
platform/32e0000.pwm, 1 PWM device
pwm-0 (sysfs ): requested enabled period: 20000000 ns duty: 0 ns polarity: normal
We use jetpack version 5.1.1-b56
L4T version is 35.3.1