AnsweredAssumed Answered

FreeRTOS and K64 Interrupt Priority

Question asked by Jared Evans on Jan 17, 2016
Latest reply on Jan 18, 2016 by Jared Evans



I have been working on a K64 Freedom board with KDS 3.0, having KSDK 1.3 and processor expert enabled. Issues have been occuring such as stack variables corruption, default ISRs, and FreeRTOS functionality failing (such as software timers stopping). I have both malloc and stack overflow hooks enabled, but neither are being entered. With much of the code being simplified to debug this issue, I do not believe a memory issue is occurring.


By tracing the thread from the default ISR, I noticed the crash occured after a call to uxListRemove in FreeRTOS for multiple cases. This led me to a forum discussion here Re: Kinetis and FreeRTOS , and I am wondering if my problem is similar based on the issues encountered.


Reviewing the information from that thread and the additional content from the FreeRTOS site about Cortex M processors, I ensured that the SysCall priority was set to 1 and the KerneI priority was set to 15. Any other interrupts use priority 7 if they have FreeRTOS functionality.


I currently am using two UART interrupts, one GPIO interrupts, SDHC interrupts, and a hardware timer callback. Looking through both the processor expert components and the generated code, all seem to be correctly set to medium prority (7). I am not entirely sure how the callback functions compare to the interrupts' priorities, but the the hardware timer callback does use FreeRTOS functions. Could using the hardware timer callback function instead of creating an interrupt be the source of this issue?


I would appreciate if anyone could guide me towards other directions in solving this issue. If any more information or tests can be provided, please let me know.