Hello,
I'm using LPC1788 with KSZ8051 PHY and some strange things are happening.
Most part of the time the communication works ok, but sometimes a packet written to EMAC is not transmitted.
At least 1 packet in 100 is lost and have to be retransmitted.
Does anyone have a clue about it?
My source code for transmitting :
void WriteData_EMAC(void *Source, unsigned int Size) { unsigned int idx; unsigned short * piSource; unsigned short *txptr;
__set_PRIMASK(1);
idx = LPC_EMAC->TxProduceIndex; txptr = (unsigned short *)TX_DESC_PACKET(idx);
TX_DESC_CTRL(idx) = Size | TCTRL_LAST | TCTRL_INT;
piSource = Source; Size = (Size + 1) & 0xFFFE; // round Size up to next even number
while (Size > 0) { *txptr++ = *piSource++; Size -= 2; }
if (++idx == NUM_TX_FRAG) idx = 0;
while( idx == LPC_EMAC->TxConsumeIndex );
LPC_EMAC->TxProduceIndex = idx;
__set_PRIMASK(0);
}
Thankyou!
Hi,
I'm having a similar problem using a LPC1778 with an ICS1894-40 PHY. When sending 10000 packets from the LPC to a PC only ~9700 packets are received.
I'm curious what mode you have your PHY configured in, MII or RMII mode? Multiple evaluation boards I've used work correctly but all of them are using RMII mode.