Hi Alex,
During the initial reset, NVIC is turned off. Therefore, the processor cannot receive any interrupts (except for NMI, Reset interrupt, and hard fault). To turn on the interrupts with configurable priority:
asm volatile ("cpsie i");
“CPSIE I” is a assembly instruction to enable the priority configurable interrupts. Actually, it’s a shortcut to this longer procedure.
| asm volatile ("MOVS r0, #0\n\MSR PRIMASK, r0"); |
To turn off the priority configurable interrupts:
asm volatile ("cpsid i");
Or, taking the longer non-atomic procedure:
| asm volatile ("MOVS r0, #1\n\MSR PRIMASK, r0"); |
And the NVIC is applicable to enable or disable specific interrupt, the only thing that you need to do is to set IRQ X ‘Set Enable Register’ (ISER) or ‘Clear Enable Register’ (ICER).
Please learn more information about it through the link as below.
ARM Information Center
Hope this helps.
Have a great day,
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------