Sometimes, the ethernet funtionality works fine, sometimes it does not work at all.
I added a ton of xscope outputs: and it seems like the clients fifo/queue of size n is full once n-1 packets have been received and does not recover from that state. This behavior might or might not occure when starting a new debug session.
But how can this happen?
The library should not be forwarding any packets to the client before the client has set its configuration using the ethernet config interface (correct?). In my case, I have slightly altered the ethernet library, specifically the hash mac address filtering. I added a variable/flag that allows a client to bypass the MAC filtering, resulting in all packets being given to the client. The flag is set by calling the give_all_packets() config interface function.
Code: Select all
// get the tasks RX client index and let CFG know that we want all unused packets
unsigned uiIndex = ethRx_if.get_index();
// Let us receive aaaaaaall the packets
ethCfg_if.give_all_packets(uiIndex);
while(1){
select {
case ethRx_if.packet_ready():
unsigned char ucaBuffer[ETHERNET_MAX_PACKET_SIZE];
ethernet_packet_info_t packetInfo;
ethRx_if.get_packet(packetInfo, ucaBuffer, ETHERNET_MAX_PACKET_SIZE);
// process the packet
break;