-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Description
Describe the bug
When building PWM applications with CONFIG_PWM_CAPTURE enabled, the build fails with undefined definitions for PWM_SetFilterSampleCount and PWM_SetFilterSamplePeriod. These function definitions are guarded by FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE flag which is not defined for RT11XX family. The following change fixes the build:
--- a/drivers/pwm/pwm_mcux.c
+++ b/drivers/pwm/pwm_mcux.c
@@ -464,11 +464,14 @@ static int mcux_pwm_configure_capture(const struct device *dev,
/* Setup input capture on channel */
PWM_SetupInputCapture(config->base, config->index, pwm_channel, &capture_config);
+#if defined(FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE) && \
+ (FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE == 1U)
/* Set capture filter */
PWM_SetFilterSampleCount(config->base, pwm_channel, config->index,
config->input_filter_count);
PWM_SetFilterSamplePeriod(config->base, pwm_channel, config->index,
config->input_filter_period);
+#endif
return 0;
}
but the PWM capture doesn't seem to work for simple loopback test from channel A to B of PWM submodule 0:
<wrn> pwm_capture: pwm capture timed out
Have anyone tested FlexPWM driver for input capture (with/without input filter) on RT11XX series?
Is this a known issue?
Regression
- This is a regression.
Steps to reproduce
Build applications for NXP RT11XX family with CONFIG_PWM_CAPTURE=y and pwm_capture_cycles API used in code.
Relevant log output
Impact
Major – Severely degrades functionality; workaround is difficult or unavailable.
Environment
No response
Additional Context
No response