2021-10-28 10:34 PM
Hi,
please help me figure out priorities in my project.
So, I'm using:
I configured PA9 as EXTI on Rising/Falling edge. For now i just want to light a diode when USB conection is detected. It works on simplier project with just USB device CDC.
My priorities:
All sub priorities are 0.
I tried giving EXTI9_5 (PA9 pin) preemption priority from 0 to 6, and also preemption priority 5 with subpriority 1.
I know that the higher number it is, the lower priority it gets. My guess is that EXTI should have the last priority, but I'm not sure.
My MCU is STM32F407VG.
Thanks, and have a nice day!
Solved! Go to Solution.
2021-10-29 06:56 AM
This is correct. Numerically lower priorities will pre-empt numerically higher ones.
The usual method (and typically best) is not to use subpriorities at all and assign all 4 bits to preemption.
> My guess is that EXTI should have the last priority, but I'm not sure.
It's your choice. Anything should work here.
Consider debouncing the line, and/or delaying USB initialization for 100ms after the line goes high.
2021-10-29 06:56 AM
This is correct. Numerically lower priorities will pre-empt numerically higher ones.
The usual method (and typically best) is not to use subpriorities at all and assign all 4 bits to preemption.
> My guess is that EXTI should have the last priority, but I'm not sure.
It's your choice. Anything should work here.
Consider debouncing the line, and/or delaying USB initialization for 100ms after the line goes high.