Showing results for 
Search instead for 
Did you mean: 

STM32H753: Ethernet & LWIP: SW Reset does not come and triggers timeout

Associate II

Hello everyone,

I am trying to get the Ethernet interface on the STM32H753ZIT up and running using CubeMX. The goal is that I can ping the µC. It is not an Evalboard but a self developed board. Unfortunately I don't have the schematic.

I have already searched very intensive the internet and worked through different tutorials but I always have the same error: during the initialization of the lwip stack at the following position in the 

stm32h7xx_hal_eth.c a timeout is triggered:

/* Wait for software reset */
  while (READ_BIT(heth->Instance->DMAMR, ETH_DMAMR_SWR) > 0U)
    if (((HAL_GetTick() - tickstart) > ETH_SWRESET_TIMEOUT))
      /* Set Error Code */
      heth->ErrorCode = HAL_ETH_ERROR_TIMEOUT;
      /* Set State as Error */
      heth->gState = HAL_ETH_STATE_ERROR;
      /* Return Error */
      return HAL_ERROR;

In different forums the above mentioned problem was solved by changing the

APB4 frequency was changed. I have also tried various frequencies, unfortunately without success. It is often mentioned that the problem is related to the clock line. Interestingly, apparently only self-developed boards are affected by the problem, so no Evalboards!

The manufacturer of the PCB still stated that the signals MDIO and MDC are not used. I cannot switch off the two signals in CubeMX, because otherwise the complete Ethernet interface is switched off. The manufacturer then provided me with a firmware, with which the Ethernet interface can be put into operation. So the signals MDIO and MDC are apparently not mandatory for a ping.

1st question:

Is it possible to create a working CubeMX project at all if the MDIO and MDC lines are not used on the HW but are still active in CubeMX?

2nd question:

Does anyone have an idea how I solve the problem with the timeout mentioned above? Or does anyone have a guess why no SW reset is triggered?

To keep the thread clear I have added the main.c and my IOC file to the attachment. If there is any information missing, please let me know. I will add them as soon as possible.

I thank you for your help and would be glad about answers.

Lead III

In my source, check the comment on top.

So, are the GPIOs set correctly?

Is the PHY providing a clock? Grab a scope and check.

/* Ethernet Software reset */
	/* Set the SWR bit: resets all MAC subsystem internal registers and logic */
	/* After reset all the registers holds their respective reset values */
	/* Note: The SWR is not performed if the ETH_RX_CLK or the ETH_TX_CLK are
				not available, please check your external PHY or the IO configuration */
	/* wait for software reset to reset... */
	u32TickStart = HAL_GetTick();
		/* timeout ? */
		if( (HAL_GetTick() - u32TickStart ) > ETH_TIMEOUT_SWRESET_MS )
			uart_printf("# ERR: ETH_DMAMR_SWR software reset TO\n\r");
			return HAL_TIMEOUT;