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.

Liblwip implementation

Hi Folks,

I investigate the liblwip files (.c and .h) which is coming from TivaC driver library and targets to manage the high level initialization of LwIP, providing thread for package processing and handle MAC interrupts.

As I see, in the current implementation if an interrupt raised from the MAC controller, the interrupt handler put the interrupt status into a queue and disable any further interrupts. On the other site, an FreeRTOS thread is waiting for this queue, process the status info, and reenable interrupts.

Could anybody explain me what is the rational behind of this implemtation? Why are interrupts disabled at the end of the interrupt handler and enabled in the thread?

Regards,

Norbert

  • Hello Norbert,

    As you may have noticed in the comments, the task handles the interrupt and till the time they are not handled by the task, they must not be asserted again.

    Regards
    Amit
  • Hi Amit,

    Ok, then first of all, sorry for continuing this thread, I also have another thread, where I'm looking for a solution for a sporadic crash of my application (e2e.ti.com/.../1694260, but the followings seems to be differ to the link above.
    So, regarding the description of configKERNEL_INTERRUPT_PRIORITY parameter under the link www.freertos.org/a00110.html#kernel_priority, I adjust the configKERNEL_INTERRUPT_PRIORITY to 0xFF (aka lowest priority in Corrtex M4) and the configMAX_SYSCALL_INTERRUPT_PRIORITY to 0x20 (aka the highest one before 0x00).

    As I read the explanation of these parameters, priority of interrupts that uses FreeRTOS API in they handlers MUST be set between 7 and 1. The LwIP interrupt handler uses xQueueSendFromISR(), so I adjust the interrupt of EMAC to 0x60 (priority 2), that cause my application crashes almost inmediatly.

    Can anybody tell me, what I did wrong? Is my thread wrong?

    Regards,
    Norbert
  • Hello Norbert,

    We would need to isolate what call in the FreeRTOS causes the crash. Also in the other thread as you and Chester discussed, Stack Size may be an issue. Is there a memory leak in the code?

    Regards
    Amit