I found the similar issue from FEC CodeWarrior MPC56xx - Tx repeting bytes
From that issue,
-------------------------------------------------------------------------------------------------------------------------------------------
This is very hard to explain if you have 32-bit memory and the FEC is reading 32 bits at a time, as it would require some intermediate "byte-lane changing hardware" to be doing something stupid.
It would be easier to understand if you've got 16-bit RAM, or a 16-bit pathway between the FEC and the RAM. the "pathway" is unlikely as the FEC is a master on the Crossbar.
-------------------------------------------------------------------------------------------------------------------------------------------
You can see that the transmitted Ethernet frame was duplicated 16 bit words.
ex) 11 22 11 22 11 22 11 22 11 22

Is this because Crossbar setting? or system clock?
I'm afraid not to share the project files for the security policy, but here are some functions related to FEC configuration.
#define OBE 0x0200
#define IBE 0x0100
#define ODE 0x0020
#define SRC 0x0004
#define WPE 0x0002
#define WPS 0x0001
#define PA_GPIO 0x0000
#define PA_PRIM 0x0400
#define PA_ALT1 0x0800
#define PA_ALT2 0x0C00
#define PA_ALT3 0x1000
#define SIU_SYSDIV_PERCLKSEL_NON_FM_CLOCK 0x1000000
#define SIU_SYSDIV_PERDIV_DIVIDE_BY_2 0x0000000
...
// initFecIo - initialise pads for FEC use in the SIU
void initFecIo(void)
{
// MPC5777C - FEC MII-Lite mode IO setting
SIU.PCR[PCR99_FEC_MDIO_ALT2].R = PA_ALT2 | OBE | IBE | SRC | WPE; //FEC_MDIO
SIU.PCR[PCR109_FEC_MDC_ALT3].R = PA_ALT3 | OBE | WPE; //FEC_MDC
SIU.PCR[PCR252_FEC_TX_EN_PRIM].R = PA_PRIM | OBE | SRC; //FEC_TX_EN
SIU.PCR[PCR248_FEC_TXD0_PRIM].R = PA_PRIM | OBE | SRC; //FEC_TXD0
SIU.PCR[PCR251_FEC_TXD1_PRIM].R = PA_PRIM | OBE | SRC; //FEC_TXD1
SIU.PCR[PCR98_FEC_TXD2_ALT2].R = PA_ALT2 | OBE | SRC; //FEC_TXD2
SIU.PCR[PCR101_FEC_TXD3_ALT3].R = PA_ALT3 | OBE | SRC; //FEC_TXD3
SIU.PCR[PCR474_FEC_TX_CLK_PRIM].R = PA_PRIM | IBE | WPE; //FEC_TX_CLK
SIU.PCR[PCR100_FEC_RX_CLK_ALT3].R = PA_ALT3 | IBE | SRC | WPE; //FEC_RX_CLK
SIU.PCR[PCR249_FEC_RX_DV_PRIM].R = PA_PRIM | IBE | WPE; //FEC_RX_DV
SIU.PCR[PCR250_FEC_RXD0_PRIM].R = PA_PRIM | IBE | SRC | WPE; //FEC_RXD0
SIU.PCR[PCR253_FEC_RXD1_PRIM].R = PA_PRIM | IBE | SRC | WPE; //FEC_RXD1
SIU.PCR[PCR101_FEC_RXD2_ALT3].R = PA_ALT3 | IBE | SRC | WPE; //FEC_RXD2
SIU.PCR[PCR107_FEC_RXD3_ALT3].R = PA_ALT3 | IBE | SRC | WPE; //FEC_RXD3
//Input Multiplexing Register0(SIU_IMUX0) setting for FEC input pins
SIU.IMUX0.R = IMUX0_MUXSEL6_FEC_TXCLK | IMUX0_MUXSEL1_FEC_RXDV | IMUX0_MUXSEL2_FEC_RXD0 | \
IMUX0_MUXSEL5_FEC_RXD1 | IMUX0_MUXSEL11_FEC_RXD2 | IMUX0_MUXSEL8_FEC_RXD3;
//Peripheral Clock Setting
SIU.SYSDIV.R = SIU_SYSDIV_PERCLKSEL_NON_FM_CLOCK | SIU_SYSDIV_PERDIV_DIVIDE_BY_2;
}
static int initFec(void)
{
int result = 1;
int i;
initFecIo();
FEC.ECR.R = 0x1;
while (FEC.ECR.B.RESET) { } ; // Wait for reset to complete
FEC.EIMR.R = 0; // Disable interrupts
FEC.EIR.R = 0xFFFFFFFF; // Clear any interrupts
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];
}
// Reset multicast fields
FEC.GAUR.R = 0;
FEC.GALR.R = 0;
FEC.IAUR.R = 0;
FEC.IALR.R = 0;
// Set rx buf size
FEC.EMRBR.R = 1536;
// Point FEC to our (single) tx and rx descriptors
FEC.ETDSR.R = (unsigned long) &txDesc;
FEC.ERDSR.R = (unsigned long) &rxDesc;
// Enable full duplex
FEC.TCR.R = 0x00000004; //full duplex enable
// Set in MII mode with full frame size
FEC.RCR.R = 0x05EE0004;
// Set MII speed - assume operation at 64Mhz
FEC.MSCR.B.MII_SPEED = 0x5; // 50MHz(Internal bus clock) / 2 => 25 MHz
// Enable interrupt
FEC.EIMR.R = 0x02000000;
// Enable module
FEC.ECR.R = 0x2;
// Configure a MAC address
FEC.PALR.R = (unsigned long)((mac[0] <<24)|(mac[1] <<16)|(mac[2] <<8)|(mac[3] <<0));
FEC.PAUR.R = (unsigned long)(mac[4] <<24)|(mac[5] <<16);
initFecPhy();
// Flag descriptors available to allow reception
FEC.RDAR.R = 0x0100000;
return result;
}
int main(void)
{
volatile int counter = 0;
volatile int loop = 0;
STM_A.CR.R = 1; //System Timer Module
disableWatchdog();
xcptn_xmpl (); /* Configure and Enable Interrupts */
HW_init();
setMacAddr();
initFec();
setupGlobalFrame();
SIU.GPDO[LED1_pin].R = 0;
while(!isConnected());
/* Loop forever */
for(;;) {
while(loop <= 10000)
{
loop++;
}
SIU.GPDO[LED1_pin].R ^= 1;
txEthernetFrame();
loop = 0;
counter++;
}
}
Thank you.