How to reuse GPIO 14 as pwm on Jetson Xavier NX?

Could you help me reuse the GPIO 14 as pwm, because we don’t need it to control fan.
I found that it’s on /sys/class/pwm/pwmchip3, by sudo cat /sys/kernel/debug/pwm :
platform/32d0000.pwm, 1 PWM device
pwm-0 (pwm-fan ): requested enabled period: 45334 ns duty: 23020 ns polarity: normal

but when I echo 0 > /sys/class/pwm/pwmchip3/export, it is busy. Should I first disable it and how?

Thank you.

hello Shepherd-Simple,

this is by default occupied.
as you can see in Xavier NX device tree settings,
for example,

        pwm-fan {
                pwms = <&tegra_pwm6 0 45334>;
                vdd-fan-supply = <&p3509_vdd_fan>;

you may modify the sources to remove the usage of tegra_pwm6.

thank you, may I ask where can I find the device tree settings? On the board?

hello Shepherd-Simple,

there’s binary file on the target, for example, /boot/tegra194-p3668-0000-p3509-0000.dtb
you’re able to disassembler the dtb file into text file to review the content.
for example, $ dtc -I dtb -O dts -o temp.txt tegra.dtb

you may check /etc/nv_tegra_release to confirm the L4T release version you’re using.
and, please visit Jetson Linux Archive | NVIDIA Developer page and download the same l4t version of [L4T Driver Package (BSP) Sources].
you should extract kernel_src.tbz2 package, and you’ll see hardware/ folder for device tree sources.

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