PWM0 don't work

We have issue with pwm0. We use pwm0 for control FAN speed but pwm0 is not pulse.
I did same as guide (Nano pwm0 cant work - #17 by shgarg) but there is error:
ac@vsm:~$ echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
-bash: echo: write error: Invalid argument
I also try to nano dev kit but error is same
Anyone can help me for solve this issue?
Thanks so much!

hello ThangNguyen115,

had you ran through sysfs nodes to enable the PWM controller?
for example,
echo 0 > /sys/class/pwm/pwmchip0/export
echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable

yes, i did it

could you please also refer to Running two simple DC motors (5 Amp) Forward and Backward in Jetson Nano for using Nano PWM.

I tried to Launching Jetson‑IO on my device but Main Screen show and it disappeared immediately, so i can not set pinmux(there is not any error message). Do you know reason?

hello ThangNguyen115,

may I know which SKU of your Jetson Nano? for example, is it SD-card or eMMC, or is it A02 or B01?

Hi JerryChang,
My jetson nano is emmc, B02

hello ThangNguyen115,

it’s due to Jetson-IO tool does not support with eMMC versions.
you may refer to pinmux spreadsheets to check default pin configurations,
please have pinmxu changes to define your board’s pinmux configuration.

I see that gpio07 for FAN is configured to pwm0 as default. But when i measure signal then it is not pwm. So, What i need change from source code for active pwm?

hello ThangNguyen115,

by checking Nano’s pinmux spreadsheet (Version 1.01), GPIO07 is default configured as GPIO3_PV.00.
you should modify the [Customer Usage] in the spreadsheets and generate new DT files, please include the update and compile the sources to update DTB binary.

Sorry, i don’t understand what you mean.
I see on DT files that config GPIO07 as pwm
pv0 {
nvidia,pins = “pv0”;
nvidia,function = “pwm0”;
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
Are there something that i need change from DT?

hello ThangNguyen115,

could you please confirm which JetPack release version you’re working with,
i.e. $ cat /etc/nv_tegra_release

besides, please also share below for reference,
# cat /sys/kernel/debug/pinctrl/700008d4.pinmux/pinmux-pins | grep PV0

Hi JerryChang,
I would like share to you result:
ac@vsm:~$ cat /etc/nv_tegra_release
#R32 (release), REVISION: 5.1, GCID: 26202423, BOARD: t210ref, EABI: aarch64, DATE: Fri Feb 19 16:45:52 UTC 2021

root@vsm:~# cat /sys/kernel/debug/pinctrl/700008d4.pinmux/pinmux-pins | grep PV0
pin 168 (PV0): 700008d4.pinmux (GPIO UNCLAIMED) (HOG) function pwm0 group pv0

hello ThangNguyen115,

wait… would you like to control fan speed?
could you please check /sys/devices/pwm-fan/hwmon/hwmon1.
please see pwm_rpm_table and assign values to target_pwm to check if the fan spinning.

yes, i would like control fan speed. I also try to assign value to target_pwm but fan speed is not change.

hello ThangNguyen115,

is it already spinning at full speed, are you able to read cur_pwm for the current settings?
please also refer to Jetson Nano Product Design Guide and check chapter-11.4 for Nano’s thermal solution.