use IRQ in MQX

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

use IRQ in MQX

Jump to solution
1,606 Views
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 Kudos
1 Solution
604 Views
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

 

 

View solution in original post

0 Kudos
1 Reply
605 Views
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 Kudos