Hi,
I am trying to transmit Ethernet frame on LS1021A TWR board using RGMII mode.
I followed the initialization process mentioned in the datasheet.
I have created buffer descriptors array (txbd[10]). "bufPtr" points to a data buffer.
I have loaded address of "txbd" in TBASEH and TBASE0 registers and also in TBDBPH.
In TQUEUE register, I have enabled the Queue 0.
And for transmission, I set READY, INTERRUPT (and also, LAST) flag. I was waiting for DMA to read this Buffer, Transmit the data and clear the flag. But nothing happened.
Am I missing something?
Problem was in Buffer Descriptors and Buffers.
txbd_struct trasmitbd[TX_BD_COUNT]__attribute__ ((aligned (8))) __attribute__((section (".DMASection")));
rxbd_struct receivebd[RX_BD_COUNT]__attribute__ ((aligned (8))) __attribute__((section (".DMASection")));
U8 u8TransmitBuffer[ETHERNET_BUFFER_SIZE]__attribute__ ((aligned (8))) __attribute__((section (".DMASection")));
U8 u8ReceiveBuffer[ETHERNET_BUFFER_SIZE]__attribute__ ((aligned (8))) __attribute__((section (".DMASection")));
When I moved BDs and Buffers to DMASection, Transmission and Reception started working properly.
1. You said "I followed the initialization process mentioned in the datasheet" - could you please describe in details which exactly initialization sequence was performed or point exact place in the document?
2. When eTSEC is enabled, it generates output transmission clock "GTX_CLK" for PHY, please check by scope that this clock is oscillating. Is this clock is not oscillating, please verify input clock is present on GTX_CLK125 input.
Have a great day,
Alexander
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I have followed initialization sequence mentioned in LS1021A Reference Manual Rev 1 (06/2016) Table 20-52.
And to transmit the data, I have declared the buffer as mentioned in section 20.9.8.2.
I have edited the question and attached my source code.
Concerned functions are:
vInitRGMIIMode() and vSendEthernetData()
And My Trasmit function is as follows:
u32Temp = (U32) &u32TxBuffer[0];
SwapEndian(&u32Temp);
txbd[0].u32BufPtr = u32Temp;
u32Temp = ((TXBD_LAST | TXBD_INTERRUPT | TXBD_READY) << 16) | 0x80; //Let's transmit 128 Bytes
SwapEndian(&u32Temp);
txbd[0].u32Status = u32Temp;
vWriteRegister(ETHERNET_TSEC_BASE_ADDR, TSEC_TSTAT, TSTAT_CLEAR_THALT);
Ok, waiting for response for Question #2 from my initial reply.