use IRQ in MQX

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

use IRQ in MQX

跳至解决方案
1,788 次查看
bluehacker
Contributor III

HI, everyone

I have one question.

for coldfire v1, for example mcf51acxxx, there are one IRQ pin, and can use as external interrupt request pin. but it seems is NMI interrupt. In mqx user manual , I find that user can't install NMI interrupt's ISR by _int_install_isr, and can only use _int_install_kernel_isr to install one kernel isr, BUT kernel isr can't call any mqx function.

 

so this is my question, for IRQ, if I can't call any mqx function, then I think I can't do any thing meaningful in the irq isr. for example, I want to in the isr to trigger event to resume one task, or I want to call 'printf' to output some debug information ....

 

0 项奖励
回复
1 解答
786 次查看
PetrL
NXP Employee
NXP Employee

Hi,

 

you are right, you shouldn't use MQX API  in the NMI interrupt service routine. This is common for the most of available RTOSes - the reason for it is that RTOS is usually protecting its own internal structures by locking interrupts for a short time  - this is not possible for NMI.

 

If you need to react on NMI interrupt in MQX tasks you have to create your own way how to do it - e.g. shared variable which is set in NMI and checked periodically in one of MQX tasks or you can invoke another interrupt (not NMI) and handled it by standard interrupt handler registered via _int_install_isr..

 

Regards,

PetrL

 

 

在原帖中查看解决方案

0 项奖励
回复
1 回复
787 次查看
PetrL
NXP Employee
NXP Employee

Hi,

 

you are right, you shouldn't use MQX API  in the NMI interrupt service routine. This is common for the most of available RTOSes - the reason for it is that RTOS is usually protecting its own internal structures by locking interrupts for a short time  - this is not possible for NMI.

 

If you need to react on NMI interrupt in MQX tasks you have to create your own way how to do it - e.g. shared variable which is set in NMI and checked periodically in one of MQX tasks or you can invoke another interrupt (not NMI) and handled it by standard interrupt handler registered via _int_install_isr..

 

Regards,

PetrL

 

 

0 项奖励
回复