Question
PRIMASK bit on after enabling interrupts.
Posted on July 07, 2015 at 20:47
Hi all,
I am using STM32F407 chip with GCC toolchain. I have a trouble with my code. I wrote a function that needs an exclusive access to variables (I want to have ability to call this function from interrupts as well as from main loop code), so I am disabling interrupts whenever code reaches critical sections. The thing is that whenever I am using disable_irq()/enable_irq() functions, interrupts sporadically do not get turned on again and stay disabled (PRIMASK = 1). I am still while developing and debugging my code but I would like to ask if there any other possibility for PRIMASK to get set to 1 other than using ''asm volatile (''cpsid i'');'' line? I was looking into datasheet/reference/programmers manuals, but so far no luck. #stm32f4