S32K1x disable Interrupt for critical section

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

S32K1x disable Interrupt for critical section

Jump to solution
1,814 Views
francoisdugue
Contributor III

Hi,

I have to protect part of my code against interruption (i.e update sw_fifo's pointers).

I see lots of words on web, goods and bads, but at least i need to have some kind of synthesis.

i see the following :

 

#define ENABLE_INTERRUPTS() __asm volatile ("cpsie i" : : : "memory");
#define DISABLE_INTERRUPTS() __asm volatile ("cpsid i" : : : "memory");

 

Some time with couter... i feel ok with this part.

Some time i also see dsb and isb usage right after disabling interrupt. I think it's more related to S32K14x... Can you confirm me that i don't need to do use these instructions?

Both usage can be found on Project exemple FreeRtos_s32k116 and flexcan_encrypted_s32k116

Thanks in advance for your clarifications

Labels (1)
0 Kudos
1 Solution
1,799 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @francoisdugue,

I believe this is explained in

ARM Cortex ™ -M Programming Guide to Memory Barrier Instructions Application Note 321

https://documentation-service.arm.com/static/5efefb97dbdee951c1cd5aaf?token=

4.8 Disabling interrupts using CPS and MSR instructions
4.7 Enabling interrupts using CPS instructions and MSR instructions

 

BR, Daniel

View solution in original post

0 Kudos
2 Replies
1,795 Views
francoisdugue
Contributor III

Hi Daniel,

I'll have a deep look on it.

Thank you for the link

0 Kudos
1,800 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @francoisdugue,

I believe this is explained in

ARM Cortex ™ -M Programming Guide to Memory Barrier Instructions Application Note 321

https://documentation-service.arm.com/static/5efefb97dbdee951c1cd5aaf?token=

4.8 Disabling interrupts using CPS and MSR instructions
4.7 Enabling interrupts using CPS instructions and MSR instructions

 

BR, Daniel

0 Kudos