Jetson Nano Fan Tachometer reading does not work

We use a Jetson Nano on a JN30 carrier board, running Ubuntu 18.04.2 LTS.
We have connected a ASB0305HP fan.

Setting fan PWM via /sys/devices/pwm-fan/target_pwm works. However, we cannot get a readout from /sys/devices/pwm-fan/rpm_measured, it always displays 0.

The JN30 carrier board, has a FAN_TACH (208) pin described as “tachometer from the fan (open drain input with 100k pull-up to 1.8V)”, which we have connected.

Measuring the FAN_TACH out pin from the fan with an oscilloscope, we do get a frequency output. For example, the images attached show the fan set to 100 and 200 PWM. The frequency changes, but rpm_measured still always displays 0.

Any input on this? Did someone ever get this to work? There is a lot of posts about setting the PWM, but none about reading the RPM.

hello jonathan18,

please refer to Topic 159908 for the similar issue,
you might also check the look-up table, pwm_rpm_table, to check the PWM signals and its corresponding fan speed.

FYI,
there’s known issue that rpm_measured returns zero, we’re looking into it,
thanks

hello jonathan18,

fan rpm can be read by enabling tach from SW commands,
please also check Topic 159908 for comment #16.
you should use fan with 5V regulator, and please also make sure you had proper pin connections.
thanks

We are not getting any readouts from /sys/devices/pwm-fan/rpm_measured even if we do echo 1 > /sys/class/hwmon/hwmon1/tach_enable before.

We do have the pins connected, and are getting a signal on the oscilloscope as posted above on it.

hello jonathan18,

are you able to check fan interrupts?
for example,

$ cat /proc/interrupts | grep fan

HI jonathan18,

Any update? Is this still an issue to support?

Hi

$ cat /proc/interrupts | grep fan
300:          0          0          0          0      GPIO 202 Edge      pwm-fan-tach

still does not work for us.

hello jonathan18,

did you enable tach before checking the interrupts ?
i.e. echo 1 > tach_enable

$ cd /sys/devices/pwm-fan/
$ echo 1 > tach_enable
bash: echo: write error: Invalid argument\
# but tach_enable was 1 before anyways
$ cat tach_enable 
1

( doing that as root)

I’m running into the same issue on a Jetson Nano with the JN30 carrier board.

Is it possible that there is something setup in a wrong with the pinout setup in the device tree.
The device tree I’m running looks like this regarding the fan-tach-gpio configuration:

pfsd {
		num_resources = <0x00>;
		secret = <0x2f>;
		active_steps = <0x0a>;
		active_rpm = <0x00 0x3e8 0x7d0 0xbb8 0xfa0 0x1388 0x1770 0x1b58 0x2710 0x2af8>;
		active_rru = <0x28 0x02 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01>;
		active_rrd = <0x28 0x02 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01>;
		state_cap_lookup = <0x02 0x02 0x02 0x02 0x03 0x03 0x03 0x04 0x04 0x04>;
		pwm_period = <0xb116>;
		pwm_id = <0x03>;
		step_time = <0x64>;
		state_cap = <0x07>;
		active_pwm_max = <0xff>;
		tach_gpio = <0x56 0xca 0x01>;
		pwm_gpio = <0x56 0x27 0x01>;
		pwm_polarity = <0x00>;
		suspend_state = <0x00>;
		tach_period = <0x3e8>;
		linux,phandle = <0xa6>;
		phandle = <0xa6>;
	};

I tried to compare this with the latest source as it was suggested in this other ticket: Read fan frequency from FAN_TACH signal - #13 by JerryChang

However I have a hard time making sense of this, and comparing this to the sources currently available to download:
Linux_for_Tegra/sources/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-pwm-fan.dtsi

#include <dt-bindings/pwm/pwm.h>

/ {
	pwm_fan_shared_data: pfsd {
		num_resources = <0>;
		secret = <47>;
		active_steps = <10>;
		active_rpm = <0 1000 2000 3000 4000 5000 6000 7000 10000 11000>;
		active_rru = <40 2 1 1 1 1 1 1 1 1>;
		active_rrd = <40 2 1 1 1 1 1 1 1 1>;
		state_cap_lookup = <2 2 2 2 3 3 3 4 4 4>;
		pwm_period = <45334>;
		pwm_id = <3>;
		step_time = <100>; /* mesecs */
		state_cap = <7>;
		active_pwm_max = <255>;
		tach_gpio =  <&gpio TEGRA_GPIO(Z, 2) GPIO_ACTIVE_LOW>; /* TEGRA_GPIO_PZ2 */
		pwm_gpio = <&gpio TEGRA_GPIO(E, 7) GPIO_ACTIVE_LOW>; /* TEGRA_GPIO_PE7 */
		pwm_polarity = <PWM_POLARITY_NORMAL>;
		suspend_state = <0>;
		tach_period = <1000>;
	};

	pwm-fan {
		compatible = "pwm-fan";
		status = "okay";
		pwms = <&tegra_pwm 3 45334>;
		shared_data = <&pwm_fan_shared_data>;
		active_pwm = <0 80 120 160 255 255 255 255 255 255>;
	};
};

How can I check what hex values I get with <&gpio TEGRA_GPIO(Z, 2) GPIO_ACTIVE_LOW>; ?

I tried to track down the FanConnector to the GPIO

Carrier Board Datasheet:
image

Jetson Nano Pinout Table:

This is an old thread, please open a new topic for your own issue. Thanks