S32K1x disable Interrupt for critical section

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K1x disable Interrupt for critical section

ソリューションへジャンプ
2,995件の閲覧回数
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,980件の閲覧回数
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,976件の閲覧回数
francoisdugue
Contributor III

Hi Daniel,

I'll have a deep look on it.

Thank you for the link

0 件の賞賛
返信
2,981件の閲覧回数
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 件の賞賛
返信