AnsweredAssumed Answered

MPC5777C FEC - Transmit Buffer Descriptor & FEC DMA setting

Question asked by Taekyoung Kim on Feb 15, 2017
Latest reply on Feb 17, 2017 by Petr Stancik

Hi. 

 

I have problem with transmission of Ethernet frame.

When I captured a transmitted Ethernet frame at the other monitoring system, it looked like the Ethernet frame data was disordered.

I have set the source MAC address like a 0x11, 0x22, 0x33, 0x44, 0x55, 0x66

The captured packet showed disordered MAC address and wrong data length.(I set the frame length '18')

I'm considering that this problem caused by miss configuration of FEC DMA or Transmit Buffer Descriptor.

 

The Ethernet frame setting function likes below... (I referred MPC5646C FEC sample code)

 

void setupGlobalFrame()
{
   int i;
   frame = (void *) txBuf;

   // Setup broadcast as destination
   for (i = 0; i < 6; i++)
   {
      frame->destination[i] = broadcast[i];
   }

   // Setup source address
   for (i = 0; i < 6; i++)
   {
   frame->source[i] = mac[i];
   }

   // Set length (static at 4 for the 32-bit data payload)
   frame->length = 4;

   // Setup txDesc for the (2x6-byte address + 2byte length + 4byte data) 18-byte frame
   txDesc[0].length = 18;
   txDesc[1].length = 18;
}

 

Also TBD settings are below

 

.....

   for (i = 0; i < 2; i++)
   {
      // Init tx and rx descriptors
      txDesc[i].status = 0x2C00; // Last and transmit CRC
      txDesc[i].length = 0;
      txDesc[i].bufferPointer = txBuf;

      markRxDescEmpty(&rxDesc[i]);
      rxDesc[i].bufferPointer = rxBuf[i];
   }

....

FEC.ETDSR.R = (unsigned long) &txDesc;

 

In short, my questions are below

1. Is there any configuration for FEC DMA?

2. Possible miss-configuration of Transmit Buffer Descriptor? Any guesses?

 

Thank you.

Taekyoung Kim

Outcomes