Jetson Orin Nano unable to configure PWM on 32 pin

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

Hi danielrehak98,

Do you get the pinmux spreadsheet from your vendor?
Or the one released from our official download center?

You are using Orin Nano rather than Jetson Nano so that please confirm JETSON_ORIN_NANO is configured with pin 32 in simple_pwm.py for PWM.

Could you run the following command on your board and share extracted_proc.dts for further check?

$ sudo dtc -I fs -O dts -o extracted_proc.dts /proc/device-tree

Hello Kevin,

I use
Jetson Orin NX Series and Jetson Orin Nano Series Pinmux
1.01
2023/02/24
Downloaded from Jetson Download Center | NVIDIA Developer

I can send all generated files + spreadsheet I generated it from if needed.

We use Jetson Orin Nano so I changed following line in simple_pwm.py:
'JETSON_ORIN_NANO': 33 --> 'JETSON_ORIN_NANO': 32

I attach extracted_proc.dts file (I changed extension to *txt otherwise I would not upload it)
extracted_proc.txt (425.2 KB)

Since you are using the custom carrier board, you should use the pinmux spreadsheet shared from your vendor.
The pinmux spreadsheet you are using is for the devkit. Your custom carrier board may have custom design and different pin usage.

	pwm@32e0000 {
		clock-names = "pwm";
		resets = <0x02 0x4a>;
		clocks = <0x02 0x6f>;
		nvidia,hw-instance-id = <0x06>;
		#pwm-cells = <0x02>;
		compatible = "nvidia,tegra194-pwm";
		status = "disabled";
		reg = <0x00 0x32e0000 0x00 0x10000>;
		phandle = <0x316>;
		reset-names = "pwm";
	};

From the device tree you shared, it seems pwm@32e0000 is disabled currently.
Please dissemble /boot/dtb/kernel_XXX.dtb to DTS and enable this node through configuring the status to okay.

Is it possible I did this yet device is still flashed with this pwm@32e0000 status "disabled"?
I believe I changed correct DTB file as the file is mentioned few times in CMD during flashing.
When I convert this DTB file do DTS I can see that pwm@32e0000 has status "okay".
But after flash when I try
$ sudo dtc -I fs -O dts -o extracted_proc.dts /proc/device-tree

I still get "disabled" status for this PWM.

Please check the flash log to confirm you modify the correct dtb for your board.

and also share the /boot/extlinux/extlinux.conf for further check.