Hello I work on a Kinetis MKE18F512 with SDK 2.6 and now I have problems to understand and use the interrupts in a correct way.
My Problem:
I have interrupt settings at reset state.
I drive a system-timer wit the sysTick interrupt. Now if I use a UART transfer the sysTick don't run and I don't get any timings.
It also don't help to lower the UART interrupt priority by
NVIC_SetPriority( LPUART0_TX_IRQn, 1 );
NVIC_SetPriority( LPUART0_RX_IRQn, 1 );
NVIC_SetPriority( CAN0_ORed_IRQn, 2 );
NVIC_SetPriority( CAN0_Error_IRQn, 2 );
NVIC_SetPriority( CAN0_Wake_Up_IRQn, 2 );
NVIC_SetPriority( CAN0_ORed_Message_buffer_IRQn, 2 );
If one interrupt is running no other will be called.
How could I setup that the systick interrupt can preempt all others?
I have found the problem:
The function SysTick_Config(uint32_t ticks) set the interrupt priority of the sysTick to 15. That means the lowest priority.
The solution was to reset the priority after calling the init function
if( 0 != SysTick_Config( SystemCoreClock / 1000 ) )
{
ret = HAL_ERR_INIT;
}
else
{
NVIC_SetPriority( SysTick_IRQn, 0 );
// no errors
}
Bu for further information's.
Could you lead me to a example how to configure the interrupt priority with the SDK.
Hi Tobias,
I am very happy that the problem has been resolved. Unfortunately, there are no examples with that specific functionality that show the use of NVIC.
If you have any questions please don't hesitate to ask.
Best Regards,
Ricardo