How can I set PWM to input capture mode in Linux for EV1 board?
I am trying to configure the TIM2_CH4 to capture mode on EV1 board so I can sense a fan speed from a PWM fan but I keep getting
cat: read error: Connection timed outI have configured the timer as follows:
&timers2{
pinctrl-names = "default", "sleep";
pinctrl-0 = <&tim2_pins_mx>;
pinctrl-1 = <&tim2_sleep_pins_mx>;
status = "okay";
/* USER CODE BEGIN timers2 */
dma-names = "ch3";
pwm {
/* enable PWM on TIM2 */
status = "okay";
};
/* USER CODE END timers2 */
}; tim2_pins_mx: tim2_mx-0 {
pins {
pinmux = <STM32_PINMUX('A', 3, AF1)>; /* TIM2_CH4 */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
};
tim2_sleep_pins_mx: tim2_sleep_mx-0 {
pins {
pinmux = <STM32_PINMUX('A', 3, ANALOG)>; /* TIM2_CH4 */
};
};I am using TIM12_CH1 to generate a pulse and I have shorted the two pins on the board.
What am I doing wrong? Is there a better way to detect the sense on a PWM fan?
