Is NVIC_PRIORITYGROUP_4 (3) same in effect as 0 ? (32F417)
Cube MX generates a call with a value of NVIC_PRIORITYGROUP_4 which is defined as
#define NVIC_PRIORITYGROUP_4 0x00000003U /*!< 4 bits for pre-emption priority
0 bits for subpriority */
but if you follow the function NVIC_SetPriorityGrouping() it limits the value to 3 bits anyway, and the effect of both is identical, so why does Cube default to
NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4)
I have tested both in my target and they both work apparently the same, but if there is some very subtle difference, I might never know.
There is a hint here
https://freertos.org/RTOS-Cortex-M3-M4.html
which says
Most systems default to the wanted configuration, with the noticeable exception of the STM32 driver library. If you are using an STM32 with the STM32 driver library then ensure all the priority bits are assigned to be preempt priority bits by calling NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 ); before the RTOS is started.
but this just takes you round in circles.
Is there any downside to just using NVIC_SetPriorityGrouping(0)?
I am running FreeRTOS. All my interrupts are levels 1,2, and Systick is 15 as required by FreeRTOS.
I don't want any of that sub priority stuff.
Thank you in advance for any help.
