Hi all,
I am using RTX on a CM3 STM32F1x and I would like to change the priorities of the three handlers that RTX uses: the SVC_Handler(), PendSV_Handler(), and SysTick_Handler().
They are normally set to have the lowest priority amongst the handlers in the system but I would like to give them maximum priority so that RTX calls are not interrupted by any other ISR.
I have configured the system to use priority group 4 and I have changed the priorities of the three handlers just after the call of os_sys_init_user(), to be sure to override any initialisation done by RTX.
In my system I also have a TCP/IP stack which uses an ETH_IRQHandler() with priority 5.
If the three handlers are set to have a priority >= 5, then everything works fine. Instead, if they have a priority < 5 (e.g., = 0), then after some ethernet activity (a few pings) the system crashes.
I attach in here excerpts of the code I have used to set priorities.
// set priority group in teh whole system NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4); ... // change default priority of eth isr NVIC_SetPriority(ETH_IRQn, 5); ... // after the call of os_sys_init_user() which sets priorities to 0xfc, 0xff, 0xff // respectively, i set priorities of svc, pendsv, systick to maximum value 0. NVIC_SetPriority(SVCall_IRQn, 0); NVIC_SetPriority(PendSV_IRQn, 0); NVIC_SetPriority(SysTick_IRQn, 0);
Do you have any experience in changing priorities of the handlers in RTX? Any suggestions?
Many thanks in advance, Marco Accame