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.
Hi,
I originally posted this as a reply to a question in "https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/445955"
I am having a problem with the code getting locked up in the hkdif_rx_handler typically within the
while(hdkif_swizzle_data(curr_bd->flags_pktlen) & EMAC_BUF_DESC_SOP) section of code on the RM46L852PGET package. In Halcogen 4.05 the only drivers / pinmux enabled are MIBSPI3, MII, and SCI, with MIBSPI3NCS_1 conflict cleared and MIBSPI3NENA cleared (as opposed to CS_5).MDIO and MDCLK are checked. The VIM RAM is set as expected, and the clocks are also configured to be the same as the LWIP Ethernet Demo. The Ethernet Demo is used but modified for UDP instead of HTTP.
I am using UDP mode on LWIP, and if the host computer sends one UDP packet per cycle (i.e. the packet gets handled in a timely fashion) there are no issues and everything works, whereas if two UDP packets are sent sequentially without being processed by the ISR, the code gets stuck in the ISR, and typically at the hkdif_swizzle_data(curr_bd->flags_pktlen) & EMAC_BUF_DESC_SOP)
flags_pktlen is a big number (3942645758).
Any thoughts? It's frustrating not being able to handle the receipt of multiple UDP packets without locking up the microcontroller.
Josh Karch
Hi Joshua,
Is there any information in the MAC Network Statistics Registers that would help us figure out what's going on?
These registers should begin at 0xFCF7_8200.
Hello Josh,
I've the same Problem now.
If it is possible for you, can you please post your reworked code here? You will help me a lot.
Thank you in advance
Best Regards
Christian
Christian, so the issue we had was not processing and releasing packets quickly enough. The Int Handler needs to release buffers once packets have been received ASAP in order to prevent this lockup from occurring.
Best Regards,
Josh Karch
Hi,
thanks for your answers.
Increasing the pBuf is not possible because of low RAM. In one test case the PC sends 500 ARP request in one second, so the buffer cannot be big enough to handle this.
A faster handling is also difficult because the EMAC rx ISR only posts the pointer to the buffer in a RTOS queue. Then a task makes the call to the ethernet stack.
My idea is now to stop the EMAC from receiving if there are no free buffers and enable it again when the task has freed the buffers again. But until now my changed software doesn't work like expected. Is this a possible way to handle this issue?
Best regards
Christian