This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ISRs, flags and enables question (STM32)

I'm using a USB stack (libusb_stm32) on an STM32F103 for learning.  In this stack, when data arrives from the host PC, a callback in the USB ISR** runs a function of mine to put the data into my queue.  In this function of mine I have disabled interrupts, but I do NOT think I need to. Is this a correct assumption?

What surprises me here, is that old_primask is 0. Maybe I'm confused, but I expected in an ISR it would be 1. It does become 1 once __disable_irq() runs.

On the flip side I believe that I DO need to disable interrupts so that the USB interrupt can't interfere with my dequeueing. Is that correct? Here is that side:

** I verified that the callback happens at ISR level using this:

0