Hello all,
I've been reading up everything I can about setting the priority levels of interrupts and still have some questions. I'm using an STM32F411 and mbed revision 122.
I've found the NVIC functions and understand the basics of how they work. From what I've read so far this is what I think I know:
1) mbed sets all interrupts to 0 (highest priority)
2) equal level interrupts don't interrupt each other (no preempting)
3) equal level interrupts are processed in the order they are received (no subpriority levels)
In my project the classes that use interrupts are:
Interrupt Classes
Timer (x1)
Timeout (x1)
Ticker (x4)
InterruptIn (x4)
MODSERIAL (x2)
I2C (x2)
PWM (x14)
I would like to be able to explicitly set which interrupts can preempt others, and what order interrupts will be processed in when queued.
So some questions:
Do all the Timers, Timeouts, and Ticker's use the same interrupt? If so (as I assume), am I correct that I won't be able to set which ones can preempt others (except by coming up with my own method in an ISR)?
How can I find out all the interrupts (and interrupt names) my system uses?
I have been looking at the NVIC functions, and it looks like NVIC_EncodePriority(), NVIC_SetPriorityGrouping(), and NVIC_SetPriority() are what I want. But I don't know what parameters to pass to them. I'm also not sure what PriorityGroup is as opposed to PreemptPriority. So how would I use the NVIC functions to set the preempt, priority group, and subpriority levels?
See: uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
Thanks for any help!
Hello all,
I've been reading up everything I can about setting the priority levels of interrupts and still have some questions. I'm using an STM32F411 and mbed revision 122.
I've found the NVIC functions and understand the basics of how they work. From what I've read so far this is what I think I know:
1) mbed sets all interrupts to 0 (highest priority) 2) equal level interrupts don't interrupt each other (no preempting) 3) equal level interrupts are processed in the order they are received (no subpriority levels)
In my project the classes that use interrupts are:
Interrupt Classes
I would like to be able to explicitly set which interrupts can preempt others, and what order interrupts will be processed in when queued.
So some questions: Do all the Timers, Timeouts, and Ticker's use the same interrupt? If so (as I assume), am I correct that I won't be able to set which ones can preempt others (except by coming up with my own method in an ISR)?
How can I find out all the interrupts (and interrupt names) my system uses?
I have been looking at the NVIC functions, and it looks like NVIC_EncodePriority(), NVIC_SetPriorityGrouping(), and NVIC_SetPriority() are what I want. But I don't know what parameters to pass to them. I'm also not sure what PriorityGroup is as opposed to PreemptPriority. So how would I use the NVIC functions to set the preempt, priority group, and subpriority levels?
See: uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
Thanks for any help!