Ewm driver examples in k26 and mcxn does not work as thought

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

Ewm driver examples in k26 and mcxn does not work as thought

跳至解决方案
305 次查看
Crshi
Contributor II

hi,

I am trying to use ewm since it does reset peripherals。

But examples in both k26 and mcxn does not work as we thought. 

I add logs to print ewmIsrFlag, it shows that ewm enters interrupt when interrupt bit is enabled. ewm does not enter interrupt when we wait for timeout.

 Step by step debugging also gives the same proof。

Sincerely waiting for your reply.

 

Is there any known bugs or the refresh procedure is not exactly right ?

 

 

 

标记 (4)
0 项奖励
回复
1 解答
264 次查看
Celeste_Liu
NXP Employee
NXP Employee

Hello @Crshi ,

Thanks for your post.

According to the description of RM, "When the ewm_out_b signal asserts, an interrupt request can be generated to indicate the assertion of the EWM reset out signal. The interrupt is enabled when CTRL[INTEN] = 1. Writing 0 to this field clears the interrupt request but does not affect the ewm_out_b signal, which can be deasserted only by forcing a system reset."

Therefore the ewm_out_b signal determines whether an interrupt request will be generated, while INTEN bit determines whether the interrupt is allowed to be passed to the CPU. In other words, when ewm_out_b is asserted and INTEN = 1, the interrupt request will be sent to the CPU, but whether the IRQ handler is ultimately executed depends on the following additional conditions:

1. The interrupt is not masked by a higher-priority interrupt;
2. The interrupt vector table is correctly configured;
3. The NVIC has enabled the EWM0 interrupt.

The interrupt number of EWM can be found in "Table 15. Interrupt Vector Assignments" of the RM.

Celeste_Liu_0-1750151705793.png

 

Hope it can help you.

BRs,

Celeste

 

--------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
--------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
2 回复数
292 次查看
Crshi
Contributor II

I read the rm word by word again.

It says,

1. When IntEn bit is set and EWM_out is asserted, an interrupt is generated.

2.When ewm_out is asserted, it can only be deasserted by forcing reset.

So,  does it mean that once an interrupt generated, the respective irq handler will be triggered when IntEn is set?

0 项奖励
回复
265 次查看
Celeste_Liu
NXP Employee
NXP Employee

Hello @Crshi ,

Thanks for your post.

According to the description of RM, "When the ewm_out_b signal asserts, an interrupt request can be generated to indicate the assertion of the EWM reset out signal. The interrupt is enabled when CTRL[INTEN] = 1. Writing 0 to this field clears the interrupt request but does not affect the ewm_out_b signal, which can be deasserted only by forcing a system reset."

Therefore the ewm_out_b signal determines whether an interrupt request will be generated, while INTEN bit determines whether the interrupt is allowed to be passed to the CPU. In other words, when ewm_out_b is asserted and INTEN = 1, the interrupt request will be sent to the CPU, but whether the IRQ handler is ultimately executed depends on the following additional conditions:

1. The interrupt is not masked by a higher-priority interrupt;
2. The interrupt vector table is correctly configured;
3. The NVIC has enabled the EWM0 interrupt.

The interrupt number of EWM can be found in "Table 15. Interrupt Vector Assignments" of the RM.

Celeste_Liu_0-1750151705793.png

 

Hope it can help you.

BRs,

Celeste

 

--------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
--------------------------------------------------------------------------------------------------------------------

0 项奖励
回复