PRIMASK bit on after enabling interrupts.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-07 11:47 AM
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
Labels:
- Labels:
-
STM32F4 Series
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-07 1:29 PM
Posted on July 07, 2015 at 22:29
Seem to recall it's not something that's inherently stacked by the processor on the Cortex parts.
I guess if you used a mutex, or provided some sort of audit trail you might be able to figure out who failed to re-enable. If you're using an RTOS, it could stack things. Look also for MSR usage. You'd also want to make sure you've covered all exit paths from a routine. Again, some sort of audit trail might permit you to track any commonality in the failure.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-08 1:13 AM
Posted on July 08, 2015 at 10:13
You were right. I have checked my code again and there was a possibility for it to exit before re-enabling interrupts back again. Silly mistake. Thank for a clue!
