Proper BASEPRI on Kinetis when interrupt priorities are used

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

Proper BASEPRI on Kinetis when interrupt priorities are used

Jump to solution
960 Views
konrada_anton
Contributor III

Hello all,

 

In my K60-based MQX system, I need interrupts of different priorities. So far, I've used _bsp_int_init to assign priorities to the  interrupt vectors I want to have high priority, leaving ordinary interrupts untouched. When I look at the NVIC_IPRxx registers in the CodeWarrior 10 debugger, I see priority 0xC0 everywhere, except for my high-priority interrupts, some of which are at 0x80, some very urgent ones at 0x60. So far, so good.

 

On entering an ISR installed using _int_install_isr, I read BASEPRI as 0xC0, and PRIMASK as 0, i.e. every interrupt with priority 0x80 or 0x60 is welcome to interrupt this ISR. Hence, my 0x60 urgent ISR can be interrupted by a less-urgent 0x80 ISR, even if the first C instruction in its body is _int_disable().

 

Are my observations and conclusions correct? Is there a way I can achieve prioritized interrupts without using kernel ISRs everywhere?

 

0 Kudos
1 Solution
445 Views
DavidS
NXP Employee
NXP Employee

Hi Konrada,

First I'm not expert on the Kinetis NVIC yet.

The _int_install_isr() is actually registering your ISR function to a table that the kernel ISR will reference.  If you want your ISR to be highest you might want to implement a _int_install_kernel_isr() call.

Look at this post for further information on this topic:

https://community.freescale.com/message/92916#92916

Hope this helps.

Regards,

David

 

View solution in original post

0 Kudos
1 Reply
446 Views
DavidS
NXP Employee
NXP Employee

Hi Konrada,

First I'm not expert on the Kinetis NVIC yet.

The _int_install_isr() is actually registering your ISR function to a table that the kernel ISR will reference.  If you want your ISR to be highest you might want to implement a _int_install_kernel_isr() call.

Look at this post for further information on this topic:

https://community.freescale.com/message/92916#92916

Hope this helps.

Regards,

David

 

0 Kudos