Hello,
I'm trying to implement the single-edge capture mode for FlexTimer modules of
i.MX 7Dual, in order to measure the duty cycle and the period of a pwm signal.
When a rising/falling edge occurs, an interruption is raised, but the register
FTMx_CnV is stuck to zero, while the value of the FMTx_CNT counter is not null.
In addition, the interruption is raised only when the CHIE bit is set and there is
an edge on the channel.
So, I don't understand what can be the issue, I read application notes, so on,
without results.
Below you will find the uri to the implementation based on the kernel tn-imx_4.14.98_2.0.0_ga-stable:
https://github.com/tprrt/linux-stable/compare/39c5899...tprrt/imx7-fmt
To perform tests, I use a board pico-pi-imx7:
https://www.technexion.com/products/system-on-modules/evk/pico-pi-imx7/
And I use sysfs to configure a pwm pin in output mode and the channel 0 of the ftm2 in capture mode.
Of course, the two pins which were previously connected together:
# output: GPIO_P15_3V (J8) / PWM3_3V / pwmchip10 / pwm0
echo "0" > /sys/class/pwm/pwmchip10/export
echo "10000000" > /sys/class/pwm/pwmchip10/pwm0/period
echo "5000000" > /sys/class/pwm/pwmchip10/pwm0/duty_cycle
echo "1" > /sys/class/pwm/pwmchip10/pwm0/enable
# capture: GPIO_P32_3V (J8) / FTM2 / pwmchip0 / pwm0
echo "0" > /sys/class/pwm/pwmchip0/export
cat /sys/class/pwm/pwmchip0/pwm0/capture
Can you help me to find the root cause of this issue?