AnsweredAssumed Answered

I only get one ENET receive interrupt

Question asked by Daniel Näslund on May 16, 2017

I have a MPC5748g dev board.

 

I can set a breakpoint in the my ENET_1_ISR and it gets triggered when I receive a packet. But only once.

 

Can you see any obvious problems in how I manage the buffers and acknowledge the interrupt? See the attached EthernetInterface.{cpp,h} file. Sorry about not posting the whole project. I'll try creating a new project that don't includes any company dependencies and post it in a follow-up, if no one spots any obvious bugs.

 

void InitRxInterrupts()
{
     INTC.PSR[211].B.PRC_SELN = 0x8; // IRQ sent to core 0.
     INTC.PSR[211].B.PRIN = 10; // IRQ priority = 10, (15 is highest)

     // Enable the generation of Rx frame interrupts.
    ENET.EIMR.B.RXF = 1;

    // Indicate Empty buffers have been produced
     ENET.RDAR.B.RDAR = 1;
}

extern "C" void ENET_1_ISR()
{
     eNBUF *bd = GetActiveRxBD();

    MarkRxBDEmpty(bd);

    // Flag that descriptors are available to allow reception
     ENET.RDAR.B.RDAR = 1;

    // Clear interrupt
     ENET.EIR.B.RXF = 1;

    //To check if receiver is working or not....
     //If receiver handler exists successfully then LED will toggle at each receive event
     static int flag = 0;
     if(flag==0)
     {
         SIUL2.MSCR[Pad(PG, 2)].B.OBE = 1;
         flag=1;
     }
     else
     {
         SIUL2.MSCR[Pad(PG, 2)].B.OBE = 0;
         flag=0;
     }
}

Original Attachment has been moved to: EthernetInterface.h.zip

Original Attachment has been moved to: EthernetInterface.cpp.zip

Outcomes