Orin NX modify PWM

Disable pwm first, and then enable it after setting it. Won’t the setting value be overwritten by nvfancontrol again?

Yes, these are the two issues right now:

  1. During burning and starting from the 3rd second after booting, a low frequency of 1.13kHz will appear (this is the reason why the fan generates high-frequency noise and lasts for about 3 seconds).

  2. During the boot process, the fan will stop once, and when it starts again, the frequency will become 60~100kHz.

I currently want to solve the second problem first.

So, you have to disable nvfancontrol service first.

It seems more like specific to your custom FAN.

What’s the exact frequency do you observe?
Or it is not the stable frequency?

Do you have the Orin NX+ Orin Nano devkit board (p3768) to reproduce the similar issue?

Yes, we have reproduced this issue on the Orin NX devkit board (p3768).

The frequency signal of the entire process is:
Power on: 25kHz (lasts about 2s)
Noise generation: 1.13kHz (lasts about 3 seconds)
Frequency increase: 60~100kHz (lasts about 10 seconds)
Fan stop.

Fan starts again:
Enter the system desktop: 50kHz (maintain)

At present, we have adjusted the frequency of entering the system desktop to 25kHz.
Is there a way to adjust the signal before the fan stops?

It seems to be controlled by nvfancontrol service.

Please let me check this with internal.

I’ve checked this with internal that the kernel would control it before nvfancontrol service loaded.

	pwm-fan {
		cooling-levels = <0 187 255>;
	};
..
	thermal-zones {
		tj-thermal {
			cooling-maps {
				map-active-0 {
					cooling-device = <&fan 0 1>;
					trip = <&tj_trip_active0>;
				};

				map-active-1 {
					cooling-device = <&fan 1 2>;
					trip = <&tj_trip_active1>;
				};
			};
		};
	};

You can refer to the above parts that the default PWM is 0, it would configure PWM to 187 if it exceeds tj_trip_active0 and to 255 if it exceeds tj_trip_active1.

You can also try to configure them for your use case.

I tried modifying the part mentioned above, but it didn’t work.
Does modifying this part have anything to do with the control before the fan stops during the startup phase?

And in the waiting for target to boot-up… stage of Flash, the fan will start at this time
However, noise will also be generated due to low frequencies.

This may have nothing to do with modifying the tj_trip_active0 and tj_trip_active1 mentioned above.

The snippet I shared above is used to configure FAN in kernel.

The FAN is not configured through kernel driver during flash.

The default tj_trip_active0 is 35 degree and tj_trip_active1 is 74 degree.
It seems you want to configure the pwm for fan during early boot stage?

Yes, the frequency is abnormal in the initial stage of startup.
In the early stages of startup (before the fan stops) there will be what I described above.

Power on: 25kHz (lasts about 2s)
Noise generation: 1.13kHz (lasts about 3 seconds)
Frequency increase: 60~100kHz (lasts about 10 seconds)
Fan stop.

Fan starts again:
Enter the system desktop: 25kHz (maintain)

Do you mean there’s also the noise from the FAN on the devkit?

What’s your expected behavior in each stages?

Yes, the same is true for signals on devkit

I want to solve the problem of low frequency (1.13kHz) causing the fan to make noise for 3 seconds.
Increase the frequency until no noise is produced and maintain it at 25kHz.

You said it lasts for 3 seconds.
Could you help to check the serial console log to get what’s the boot stage at that moment?
MB1/MB2? UEFI? Kernel?