When setting or clearing NVIC Interrupts without library functions the |= operator doesnt work. When I used it, all other interrupts were cleared.
The stm32F103 Datasheet says that the actual enable state can be read from both ICER or ISER register.
Doesnt work: (IR29 just an example):
NVIC->ICER[0] |= (1UL << 29) // Disables all other interrupts too !!
.
Writing with = operator works:
NVIC->ICER[0] = (1UL << 29) // Disables only Interrupt 29
Keil uvision 4.71.2.0
Hello Henry,
To make your life simpler you can use the helper functions that are part of CMSIS
In C:\Keil_v5\ARM\CMSIS\Include\core_cm3.h
There is the NVIC_DisableIRQ() function. As you noticed, it does not use a |= statement to change the value of the register.
Read more about this function at:
www.keil.com/.../group__NVIC__gr.html
For reference you can read about the ICER register here:
developer.arm.com/.../interrupt-clear-enable-registers