Timer interrupt delayed with LwIP stack

Hello,

Our firmware should trigger an interrupt every 50kHz and generate a low/high pulse at PF5. 
The source code for the timer interrupt looks like this:

void Init(void)
{
    ...
    result = adi_int_InstallHandler(ADI_SID_TIMER0, _TIMER0_INTERRUPT, 0, true);
    *pSIC_IMASK |= IRQ_TIMER0;

    *pTIMER_DISABLE = TIMDIS0;
    *pTIMER0_PERIOD = 2400
    *pTIMER0_WIDTH  = 0;
    *pTIMER0_CONFIG = PWM_OUT | PERIOD_CNT | IRQ_ENA;
    *pTIMER_ENABLE = TIMEN0;
    ...
}

static void _TIMER0_INTERRUPT(uint32_t iid, void *pCBParam)
{
    *pPORTFIO_CLEAR = PF5
    *pTIMER_STATUS = TIMIL0;
    *pPORTFIO_SET = PF5
}

The problem I have is that the timer interrupts with a delay, but only when the LwIP stack is used.
If the stack is not used, the interrupt always strikes correctly.
To illustrate this, I have attached 2 images of the LogicPort Analyzer:

ConvSt (Timer0) without LwIP Stack:

ConvSt (Timer0) with LwIP Stack:

I am using CrossCore Embedded Studio v.2.8.3 with the Lightweight TCP/IP (lwIP) Stack v.2.6.0.

I used the BF537 processor with CoreClock 600Mhz and SysClock 120Mhz on a own hardware board.

I have tried several LwIP configurations and changed the thread priorities of the LwIP stack. Unfortunately all without success.

Can you help me with this problem?

Thanks.

Best regards,

SONSDM



tagged
[edited by: JValeriani at 3:07 PM (GMT 0) on 14 Oct 2019]