This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
Hi,
I am developing an Ethernet driver for one of our projects and am trying to ensure that the MAC layer is functioning correctly.
When I used the example code provided in HALCoGen and set breakpoints in both the RX and TX IRQs, it was working fine.
To verify this with my PC, I sent an ARP request from my ECU to the PC, but I couldn’t see any data with my ECU's MAC address in Wireshark.
2.1. I tried enabling loopback under EMAC.
2.2. I also tried without enabling loopback, but it still did not work.
Regards,
Sandeep
Hi Sandeep,
I am working on your issue now and will try to provide my updates ASAP.
--
Thanks & regards,
Jagadish.
Working now.
I found the solution now its working fine, i tested dummy ARP request to the PC and then i visualized in Wireshark i can see the data.
Facing issue or need assistance
I am currently working on integrating Mongoose with our project, which does not use LWIP. I am in the process of porting the TX and RX interrupt handlers to be compatible with Mongoose. However, I am encountering some confusion, particularly regarding the RX descriptor data access.
I noticed that in the RX handler, a while
loop is used. Could you provide more insight into why this approach is taken? Additionally, if you have any documentation or resources that could help me better understand the RX descriptor handling and its integration with Mongoose, I would greatly appreciate it.
while(hdkif_swizzle_data(curr_bd->flags_pktlen) & EMAC_BUF_DESC_SOP)
{
ex_len = 0;
len_to_alloc = 0;
/* Start processing once the packet is loaded */
if((hdkif_swizzle_data(curr_bd->flags_pktlen) & EMAC_BUF_DESC_OWNER) != EMAC_BUF_DESC_OWNER) {
if(rxch->free_head == NULL) {
/* this bd chain will be freed after processing */
rxch->free_head = curr_bd;
}
/* Get the total length of the packet. curr_bd points to the start
* of the packet.
*/
tot_len = hdkif_swizzle_data(curr_bd->flags_pktlen) & 0xFFFF;
/* Get the start of the pbuf queue */
q = curr_bd->pbuf;
do {
/* Get the pbuf pointer which is associated with the current bd */
pbuf = curr_bd->pbuf;
/* If the earlier pbuf ended, update the chain */
if(pbuf->next == NULL)
{
pbuf->next = (struct pbuf*)hdkif_swizzle_rxp(curr_bd->next)->pbuf;
}
len_to_alloc += pbuf->len;
/* Update the len and tot_len fields for the pbuf in the chain*/
pbuf->len = hdkif_swizzle_data(curr_bd->bufoff_len) & 0xFFFF;
pbuf->tot_len = tot_len - ex_len ;
processed_bd = curr_bd;
ex_len += pbuf->len;
curr_bd = hdkif_swizzle_rxp(curr_bd->next);
} while((hdkif_swizzle_data(processed_bd->flags_pktlen) & EMAC_BUF_DESC_EOP) != EMAC_BUF_DESC_EOP);
Regards,
Sandeep C
Hi Sandeep,
Good to hear that you solved this issue on your own.
--
Thanks & regards,
Jagadish.