S32K1x disable Interrupt for critical section

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K1x disable Interrupt for critical section

跳至解决方案
2,938 次查看
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

标签 (1)
0 项奖励
回复
1 解答
2,923 次查看
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 项奖励
回复
2 回复数
2,919 次查看
francoisdugue
Contributor III

Hi Daniel,

I'll have a deep look on it.

Thank you for the link

0 项奖励
回复
2,924 次查看
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 项奖励
回复