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
解決済! 解決策の投稿を見る。
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;
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;