I only get one ENET receive interrupt

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

I only get one ENET receive interrupt

ソリューションへジャンプ
1,587件の閲覧回数
danielnäslund
Contributor III

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

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,040件の閲覧回数
danielnäslund
Contributor III

Problem fixed. I needed to set the interrupt flag in the eNBUF's status8 field, every time I left the ISR.

buf->status0 = RX_BD_S0_E;
buf->status8 = RX_BD_S8_INT;   // The fix
buf->statusA = 0;
buf->statusC = 0;
buf->statusE = 0;
buf->status10 = 0;
buf->length = 0;

元の投稿で解決策を見る

1 返信
1,041件の閲覧回数
danielnäslund
Contributor III

Problem fixed. I needed to set the interrupt flag in the eNBUF's status8 field, every time I left the ISR.

buf->status0 = RX_BD_S0_E;
buf->status8 = RX_BD_S8_INT;   // The fix
buf->statusA = 0;
buf->statusC = 0;
buf->statusE = 0;
buf->status10 = 0;
buf->length = 0;