AnsweredAssumed Answered

PRIMASK bit on after enabling interrupts.

Question asked by mikey on Jul 7, 2015
Latest reply on Jul 8, 2015 by mikey
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.