Recommended method for disabling and enabling all interrupts

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
I need to disable all interrupts, execute some code then re-enable all interrupts.

Is there a recommended method for doing this ?

Thank you in advance

Best regards
Aaron
0 Likes
4 Replies
ron
Employee
Employee
Hey

Software uses the CPSIE I and CPSID I instructions to enable and disable interrupts. The CMSIS provides the following intrinsic functions for these instructions:

void __disable_irq(void) // Disable Interrupts

void __enable_irq(void) // Enable Interrupts
0 Likes
Not applicable
Hey Ron,

Thank you. Very much appreciated.

Best regards
Aaron
0 Likes
Not applicable
Hey Ron,

I have just discovered that DAVE does not report an error if intrinsic functions cannot be found (though the debugger complains if you single step over a missing intrinsic function).

The header file "core_cmFunc.h" must be included or referenced in the project paths so the linker can locate the intrinsic functions.

Best regards
Aaron
0 Likes
Not applicable
Hi Aaron,

This is correct behaviour. The intrinsic functions are defined in the header and not in the C files. So no debug information is generated.

Best regards,
Sophia
0 Likes