Orin NX modify PWM

JetPack: 6.0
L4T: 36.3
I am using a custom board and using other brands fan
The fan will make a loud noise when the NX turn on, and will disappear after about 2~5 seconds.
This situation will not happen after entering the system
Only at the moment of booting

Can I modify the PWM frequency at startup?

Hi 99520321,

Do you mean the fan spin at full speed and cause noise during boot up?

How did you control the fan?
Are you using nvfancontrol service?

Yes, it occurs at the moment of power-on and will end within 2 to 5 seconds.

I have modified the value of nvfancontrol. Do I need to provide this value?

I also found that this happens when Flash.

Is your fan also controlled by the PWM?

Could you measure PWM signal during boot up and after boot up?

Could you just use the default one? since we don’t see this issue on our devkit

It seems more like that the default state of your fan running at full speed if it has not been controlled from kernel.

Yes, the fan is also controlled through PWM.

I have no way to measure the PWM signal during startup.

I tried using the preset nvfancontrol value, but there was still noise during Flash and at the boot-up moment mentioned above.

I also try disconnect the fan PWM signal and keeping the fan running at full speed. There was no high-frequency noise problem, only the sound of the fan running at full speed.

nvfancontrol service would work after boot up so that your issue (noise during flash and boot up) may not be helped from nvfancontrol service.

Do you know where is the “high-frequency noise” coming from? From Jetson or custom board or your fan?
I believe that we don’t hit this issue on the devkit.

The noise is coming from my fan

I would suggest you also asking the help from the vendor of your fan since we are not familiar with your fan.
Or you can also check what’s the PWM signal when your get the high-frequency issue through logical analyzer of scope. Maybe it may be caused from some HIGH output so that you can try configuring the default state to LOW?

Mentioned above: Set preset status to low
Can this be achieved by modify the content in the L4T source?

Are you using the following pin for PWM FAN?

If so, you can try to configure the Req. Initial State in pinmux spreadsheet. The current state is LOW(Drive 0).

Please tell me how to modify this part, I want to know the exact path and file.
I am using NX_8G.

Please refer to the following instruction to configure the pinmux.
Jetson Orin NX and Nano Series — Generating the Pinmux dtsi Files

Currently, it has been measured that the PWM frequency after power-on is between 60-100kHz.
Is there any way to adjust this PWM frequency to maintain it at 20~25kHz?

I try to modify source/hardware/nvidia/t23x/nv-public/tegra234-p3768-0000.dtsi
pwm-fan{
pwms = <&pwm3 0 45334>
}
45334 > 40000

nvidia@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/pwm
platform/39c0000.tachometer, 1 PWM device
 pwm-0   ((null)              ): period: 0 ns duty: 0 ns polarity: normal

platform/32e0000.pwm, 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: 40000 ns duty: 12549 ns polarity: normal

platform/3280000.pwm, 1 PWM device
 pwm-0   ((null)              ): period: 0 ns duty: 0 ns polarity: normal

Although numerically it looks like 25kHz
However, the actual measured PWM frequency signal still remains at 60~100kHz.

Is it the one you are using?

Have you tried using /etc/nvfancontrol.conf to control PWM for FAN?
It may depend on your current temperature.
You can refer to Fan Profile Control for details.

Yes, 32a0000.pwm is currently in use
I have also modified /etc/nvfancontrol.conf

POLLING_INTERVAL 2

<FAN 1>
	TMARGIN ENABLED
	FAN_GOVERNOR cont {
		STEP_SIZE 10
	}
	FAN_CONTROL close_loop {
		RPM_TOLERANCE 100
	}
	FAN_PROFILE quiet {
		#TEMP 	HYST	PWM	RPM
		0	0	255	5000
		10	0	255	5000
		30	0	190	4000
		40	0	130	3000
		55	0 	80	1800
		105	0	80	1800
	}
	FAN_PROFILE cool {
		#TEMP 	HYST	PWM	RPM
		0	0	255	6000
		35	0	255	6000
		70	0 	0	0
		105	0 	0 	0
	}
	THERMAL_GROUP 0 {
		GROUP_MAX_TEMP 105
		#Thermal-Zone Coeffs Max-Temp
		CPU-therm 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
		GPU-therm 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
		SOC0-therm 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
		SOC1-therm 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
		SOC2-therm 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
	}
	FAN_DEFAULT_CONTROL close_loop
	FAN_DEFAULT_PROFILE quiet
	FAN_DEFAULT_GOVERNOR cont
	KICKSTART_PWM 64

However, when I measured the PWM frequency signal after turning it on, it still remained at 60k~100kHz.
This phenomenon occurs in development kits and customized boards.

Have you tried to disable nvfancontrol service and configure the PWM manually?

$ systemctl stop nvfancontrol

I tried it, but the PWM frequency signal is still the same at 60k~100kHz.

Afte disabling nvfancontrol, have you modified the period and duty cycle through sysfs node to check if the frequency could be configured?

Afte disabling nvfancontrol, I have modified the period and duty cycle. Judging from the return value alone, the modification has been successful. However, when measured with an oscilloscope, it is still maintained at 60kHz~100kHz.

root@tegra-ubuntu:/home/nvidia# systemctl stop nvfancontrol
root@tegra-ubuntu:/home/nvidia# echo 128 > /sys/class/hwmon/hwmon0/pwm1
root@tegra-ubuntu:/home/nvidia# cat /sys/kernel/debug/pwm
platform/39c0000.tachometer, 1 PWM device
 pwm-0   ((null)              ): period: 0 ns duty: 0 ns polarity: normal

platform/32e0000.pwm, 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: 40000 ns duty: 20078 ns polarity: normal

platform/3280000.pwm, 1 PWM device
 pwm-0   ((null)              ): period: 0 ns duty: 0 ns polarity: normal

It seems your period is still 40000ns (freq = 25kHz)
You should disable the pwm before modifying the period and enable it after that.

Is your current issue still about the loud noise during boot up?
Or you want to modify the period/frequency of pwm-fan after boot up?