PWM stops while debug session is paused

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

PWM stops while debug session is paused

848 次查看
sanjay25
Contributor I

I have configured a PWM for a display backlight. It works fine when not debugging. However, while debugging, if a breakpoint is hit or I place a breakpoint in the code, the PWM output goes low and the backlight turns off. I have verified this on the PWM output pin.
I am using an MIMXRT1052 controller with Zephyr RTOS. I also tried setting the pwm_a (FLEXPWM4_PWMA0, which I am using) fault state to 01, but I still encountered the same issue.
Has anyone else faced this issue?

标签 (1)
0 项奖励
回复
1 回复

771 次查看
Habib_MS
NXP Employee
NXP Employee

Hello @sanjay25,

Please verify that bit 15, labeled “DBGEN,” in the Control 2 Register is set to 1. This setting ensures that the PWM operates in debug mode. For more details about this bit, refer to section 54.8.4 of the RM.
Additionally, there is an example that demonstrates PWM implementation using FlexPWM in Zephyr. The example is called “PWM LED” and can be found in the MCUXpresso extension for VS Code, which could be helpful.

Habib_MS_0-1762988466669.png


BR
Habib

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2200799%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E8%B0%83%E8%AF%95%E4%BC%9A%E8%AF%9D%E6%9A%82%E5%81%9C%E6%97%B6%20PWM%20%E5%81%9C%E6%AD%A2%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2200799%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E4%B8%BA%E6%98%BE%E7%A4%BA%E5%99%A8%E8%83%8C%E5%85%89%E9%85%8D%E7%BD%AE%E4%BA%86%20PWM%E3%80%82%E4%B8%8D%E8%B0%83%E8%AF%95%E6%97%B6%E8%BF%90%E8%A1%8C%E6%AD%A3%E5%B8%B8%E3%80%82%E4%BD%86%E6%98%AF%EF%BC%8C%E5%9C%A8%E8%B0%83%E8%AF%95%E6%97%B6%EF%BC%8C%E5%A6%82%E6%9E%9C%E9%81%87%E5%88%B0%E6%96%AD%E7%82%B9%E6%88%96%E6%88%91%E5%9C%A8%E4%BB%A3%E7%A0%81%E4%B8%AD%E8%AE%BE%E7%BD%AE%E4%BA%86%E6%96%AD%E7%82%B9%EF%BC%8CPWM%20%E8%BE%93%E5%87%BA%E5%B0%B1%E4%BC%9A%E5%8F%98%E4%BD%8E%EF%BC%8C%E8%83%8C%E5%85%89%E7%81%AF%E5%B0%B1%E4%BC%9A%E5%85%B3%E9%97%AD%E3%80%82%E6%88%91%E5%B7%B2%E5%9C%A8%20PWM%20%E8%BE%93%E5%87%BA%E5%BC%95%E8%84%9A%E4%B8%8A%E9%AA%8C%E8%AF%81%E4%BA%86%E8%BF%99%E4%B8%80%E7%82%B9%E3%80%82%3CBR%20%2F%3E%E6%88%91%E4%BD%BF%E7%94%A8%E7%9A%84%E6%98%AF%E8%A3%85%E6%9C%89%20Zephyr%20%E5%AE%9E%E6%97%B6%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%9A%84%20MIMXRT1052%20%E6%8E%A7%E5%88%B6%E5%99%A8%E3%80%82%E6%88%91%E8%BF%98%E5%B0%9D%E8%AF%95%E5%B0%86%20pwm_a%EF%BC%88%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%E7%9A%84%20FLEXPWM4_PWMA0%EF%BC%89%E7%9A%84%E6%95%85%E9%9A%9C%E7%8A%B6%E6%80%81%E8%AE%BE%E7%BD%AE%E4%B8%BA%2001%EF%BC%8C%E4%BD%86%E8%BF%98%E6%98%AF%E9%81%87%E5%88%B0%E4%BA%86%E5%90%8C%E6%A0%B7%E7%9A%84%E9%97%AE%E9%A2%98%E3%80%82%3CBR%20%2F%3E%E6%9C%89%E5%85%B6%E4%BB%96%E4%BA%BA%E9%81%87%E5%88%B0%E8%BF%87%E8%BF%99%E4%B8%AA%E9%97%AE%E9%A2%98%E5%90%97%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2200799%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX%20RT105x%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2203952%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PWM%20stops%20while%20debug%20session%20is%20paused%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2203952%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F256445%22%20target%3D%22_blank%22%3E%40sanjay25%3C%2FA%3E%E3%80%81%3C%2FP%3E%0A%3CP%3E%E8%AF%B7%E7%A1%AE%E8%AE%A4%E6%8E%A7%E5%88%B6%202%20%E5%AF%84%E5%AD%98%E5%99%A8%E4%B8%AD%E6%A0%87%E6%9C%89%20%22DBGEN%20%22%E7%9A%84%E7%AC%AC%2015%20%E4%BD%8D%E6%98%AF%E5%90%A6%E8%AE%BE%E7%BD%AE%E4%B8%BA%201%E3%80%82%E8%AF%A5%E8%AE%BE%E7%BD%AE%E5%8F%AF%E7%A1%AE%E4%BF%9D%20PWM%20%E5%9C%A8%E8%B0%83%E8%AF%95%E6%A8%A1%E5%BC%8F%E4%B8%8B%E8%BF%90%E8%A1%8C%E3%80%82%E6%9C%89%E5%85%B3%E8%AF%A5%E4%BD%8D%E7%9A%84%E6%9B%B4%E5%A4%9A%E8%AF%A6%E6%83%85%EF%BC%8C%E8%AF%B7%E5%8F%82%E9%98%85%20RM%20%E7%AC%AC%2054.8.4%20%E8%8A%82%E3%80%82%3CBR%20%2F%3E%E6%AD%A4%E5%A4%96%EF%BC%8C%E8%BF%98%E6%9C%89%E4%B8%80%E4%B8%AA%E7%A4%BA%E4%BE%8B%E6%BC%94%E7%A4%BA%E4%BA%86%E5%9C%A8%20Zephyr%20%E4%B8%AD%E4%BD%BF%E7%94%A8%20FlexPWM%20%E5%AE%9E%E7%8E%B0%20PWM%E3%80%82%E8%AF%A5%E7%A4%BA%E4%BE%8B%E5%90%8D%E4%B8%BA%20%22PWM%20LED%22%EF%BC%8C%E5%8F%AF%E5%9C%A8%20VS%20%E4%BB%A3%E7%A0%81%E7%9A%84%20MCUXpresso%20%E6%89%A9%E5%B1%95%E4%B8%AD%E6%89%BE%E5%88%B0%EF%BC%8C%E5%8F%AF%E8%83%BD%E4%BC%9A%E6%9C%89%E6%89%80%E5%B8%AE%E5%8A%A9%E3%80%82%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_0-1762988466669.png%22%20style%3D%22width%3A%20554px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_0-1762988466669.png%22%20style%3D%22width%3A%20554px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365356iB38D5D45CEBD1835%2Fimage-dimensions%2F554x334%3Fv%3Dv2%22%20width%3D%22554%22%20height%3D%22334%22%20role%3D%22button%22%20title%3D%22Habib_MS_0-1762988466669.png%22%20alt%3D%22Habib_MS_0-1762988466669.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EBR%3CBR%20%2F%3EHabib%3C%2FP%3E%3C%2FLINGO-BODY%3E