Interrupt Priorty Issue

cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt Priorty Issue

582 Views
shaileshagrahar
Contributor III

Hi,

I am using S32K144 micro controller . In this controller there are 16 interrupt level from 0 to 15.

In my application i am using two interrupt source and assigned priority 0 and 5 to both the interrupt source. 

Now at some state in my code i am disabling the both interrupts ( i am using  BASEPRI register to disable ).

So keeping in mind the above situation i have loaded BASEPRI= 0x00000000 to disable all interrupt having priorty level 0 and lower than 0 (means 5). But i am still getting interrupts,even i have disabled the interrupts.

Is this issue due to that i am putting "BASEPRI= 0x00000000"?

because Priority mask bits:0x00 = no effect,as given in this manual

ARM Information Center .

Could you please help me on this.

Thanks!

Labels (1)
Tags (1)
3 Replies

278 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

The BASEPRI register must be set to nonzero value in order to mask interrupts that have the same or lower interrupt priority. If you need to mask all interrupts including those with interrupt priority 0, then set PRIMASK bit.

__asm("cpsid i") // Disable interrupts
__asm("cpsie i") // Enable interrupts

Regards,

Daniel

263 Views
m_mishrikey
Contributor II

How do you set BASEPRI?

s32_core_cm4.h has macros for cpsie and cpsid, but nothing for BASEPRI register.

I am looking for something like this: 

// code before critical section
__set_BASEPRI(6 << (8 - __NVIC_PRIO_BITS));
// critical section
__set_BASEPRI(0U); // remove the BASEPRI masking
// code after critical section

 

described here: 

https://community.arm.com/developer/ip-products/system/b/embedded-blog/posts/cutting-through-the-con...

 

0 Kudos

278 Views
shaileshagrahar
Contributor III

Hi Daniel,

Thank you! 

0 Kudos