This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

FreeRTOS with uIP

When running FreeRTOS with uIP on TM4C1294XL, I see the following:

  • the code faults in the routine uxListRemove
  • my attempt to look at the stack appear to show that the uxListRemove method was interrupted by an Ethernet interrupt
  • the FreeRTOS source code has a comment in the list methods to the effect that if the code blows up here, a likely cause is bad interrupt priorities
  • the FreeRTOS reference has an item called configMAX_SYSCALL_INTERRUPT_PRIORITY which sets the priority level at which it is safe to make xxxFROMISR calls
  • when I look at the registers when running the code, all NVIC_PRIn registers are 0, indicating that all interrupts are equal high priority, violating the above config item

 So, I think the fault issues are a result of our not setting up interrupt priorities correctly.  Any suggestions?

Thanks,

Shawn

  • Hello Shawn,

    Your analysis is correct.

    For ARM Cortex M3 and M4, if the FreeRTOS APIs are used within an interrupt context then the priority of that interrupt should be greater than or equal to "configKERNEL_INTERRUPT_PRIORITY" and lesser than or equal to "configMAX_SYSCALL_INTERRUPT_PRIORITY". For more details, please refer the link http://www.freertos.org/a00110.html#kernel_priority first!

    It is best to setup the interrupt priorities before starting the FreeRTOS scheduler i.e. before calling the function "vTaskStartScheduler()". TivaWare API "IntPrioritySet()" can be used to setup the priority of the interrupts.

    Hope this helps!

    Sai