Skip to main content
Explorer II
August 16, 2022
Solved

LWIP - HAL_ETH_Transmit stall on "Wait for data to be transmitted or timeout occurred"

  • August 16, 2022
  • 1 reply
  • 2584 views

Hi,

I'm using the STM32H743 device.

my main loop sends nonstop UDP messages perfectly.

I decided that I want to add a debug option that when my code has an issue and it stuck in one of the handlers (such as "HardFault_Handler") endless loops, he will send a nonstop special UDP message that indicates that a problem occurred from within the handler endless loop.

I wrote the code, but I see no udp message, when I used the IDE debug option I notice the code is stalling inside the HAL_ETH_Transmit method under the loop "/* Wait for data to be transmitted or timeout occurred */".

any idea why in the main loop the udp messages were sent with no problem and under the Handlers it stalls? do I need to initialize something before sending it?

pls, help!

thank you !!

    This topic has been closed for replies.
    Best answer by LCE

    Ouch, one of these errors..

    Try to use something without interrupts, maybe UART logging.

    Or re-write HAL_ETH_Transmit().

    I'm actually not the debugging expert, I mostly use UARTs and LEds for that, so maybe someone else has some better ideas.

    1 reply

    Graduate II
    August 16, 2022

    That function is using the Systick with HAL_GetTick().

    And the Systick is interrupt based and must have a higher priority than from the ISR where it's called from.

    Anyway, calling some lwIP TX stuff from some fault handler or ISR sounds "dangerous", to put it mildly.

    Mz.1Author
    Explorer II
    August 16, 2022

    @Community member​ thanks!

    do you have a different suggestion on how to implement correctly something similar to notify in case an error occurred?

    thank you :)

    Graduate II
    August 16, 2022

    No problem using that if "some error" occurred, seems kinda elegent.

    But with your example as "HardFault_Handler" you should better find the cause for that and simply use IDE debugging why and how you got there.