Hi @Deepa-khatri2588 ,
Thanks for your interest in NXP MIMXRT series!
The first thing I would correct is the PWM channel index. Your pinmux routes GPIO_AD_B0_06 to FLEXPWM2_PWMA3, which is channel A of submodule 3. In Zephyr’s pwm_mcux.c, channel 0 maps to kPWM_PwmA and channel 1 maps to kPWM_PwmB. Therefore your calls should use channel 0, not channel 1.
Zephyr’s nxp,imx-pwm binding supports run-in-wait and run-in-debug, and the MCUX PWM driver maps these properties to pwm_config.enableWait and pwm_config.enableDebugMode. Please keep these properties in the flexpwm2_pwm3 node.
For runtime torque updates, keep the period and polarity unchanged and only update the pulse width. This allows the Zephyr MCUX driver to use PWM_UpdatePwmDutycycle() followed by PWM_SetPwmLdok(), instead of stopping and reconfiguring the submodule.
If the PWM still stops only when the kernel becomes idle, this indicates the issue is related to WFI/WAIT-mode clock handling. CONFIG_PM=n disables Zephyr PM policy/device PM, but does not necessarily prevent the CPU idle path from executing WFI. As a diagnostic test, keep the CPU out of idle with a temporary high-priority busy thread. If the PWM then becomes stable, we should focus on the SoC WAIT-mode clock/CCM/GPC configuration or apply the i.MX RT low-power workaround path.
Best regards,
Gavin