2013-03-31 04:18 AM
Once again I feel really stupid. I can't get nested interrupts working.
In the attached file there are three functions, NVIC_Configuration(), SysTick_Handler() and TIM6_DAC_IRQHandler().I intend the SysTick interrupt to run at highest priority and the TIM6 interrupt to run at medium priority. I can verify that I get both interrupts (the BLIP macros) but the TIM6 interrupt block the SysTick interrupt.What am I missing?TIA!/Janne #stm32f4xx #nested #interrupt2013-03-31 04:56 AM
You can't use NVIC_Init for internal core sources, ie IRQn less than zero
/* set SysTick interrupt priority to high */ NVIC_InitStructure.NVIC_IRQChannel = SysTick_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure);
You need to use NVIC_SetPriority(SysTick_IRQn, 0); after you've enabled the SysTick itself.2013-03-31 05:16 AM
Thank you very much for your very quick reply. It solved my problem.
I wasn't aware of this and also kind of expected the priority of SysTick to be 0 after reset.2013-03-31 06:10 AM
The System Handler priority register does clear at reset, however SysTick_Config() [core_cm3.h] sets it down to the lowest setting for the NVIC being used, here 4-bits are implemented.
Prior to the CMSIS version of the fw library (v2.x) so of this was done a bit differently, but you still needed to use a different function to set the SysTick (System Handler) priorities.