MQX function calls with ISR routine

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

MQX function calls with ISR routine

1,015 Views
billnd
Contributor IV

It really isn't clear in the documentation I have, Rev 6. Section 3.9.2 suggests that lwevents should not be used, it is not listed. But section 3.6.2, indicates that lwevents set can be used from within interrupts. Please give me some guidance as to which commands can be used safely in interrupts.

On a similar subject, blocking commands are often talked about. Is there a list of command that are considered blocking or non-blocking? Or is there are rule for deciding, some are obvious, but others could be either.

Thanks

Bill

0 Kudos
Reply
3 Replies

634 Views
Martin_
NXP Employee
NXP Employee

An ISR must not call a blocking function. We are adding runtime checks to some kernel functions to check if they are called from an ISR and if so, return an error value. Once advice here is you should always check return values from MQX functions.

MQX Reference Manual gives information about blocking/non-blocking behavior of functions, also lists return values.

Due to interrupt latency, an application should not spend much time in an isr. When an isr executes, lower priority interrupts are masked so the MCU doesn't service them at the time when they occur, but at the time when code returns from the isr.

0 Kudos
Reply

634 Views
billnd
Contributor IV

Thanks for the reply Martin.

I understand that all functions called from ISR's need to be non-blocking, and that ISR's should execute for a minimum amount of time, and that all return values should always be checked. This is just good solid software engineering practice ;-)

I was just hoping for a table/list of functions that could be called from the ISR, and equally a table/list of functions that block or don't. The information is in the UG and the RM, just sometimes takes a bit of reading to find exactly what I'm after. Was just looking for a short cut.

Cheers,

Bill

0 Kudos
Reply

634 Views
DavidS
NXP Employee
NXP Employee

Hi Bill,

For new questions please start a new thread.  I did that for you.

Have you had an issue?

We try to make documentation as clear as possible.  Sorry for confusion.

Section 3.9.2 is clear to state what can be used in ISR routine including _lwsem_post() which is setting a flag and does not block.

Then Section 3.9.3 list all the MQX function that should not be called from ISR routine.

This includes not calling _lwsem_wait() (because it can block if a flag is not set.

Regards,

David

0 Kudos
Reply