2022-05-01 11:59 PM
While setting up Ethernet connectivity on STM32H753, the HAL layer exited with HAL error during initialization. I found out that the SET_BIT(heth->Instance->DMAMR, ETH_DMAMR_SWR); fails to reset the register and the initialization exits with HAL error on timeout. I am using DP83848 as Ethernet PHY. I was able to verify that the link state is 100-Mbps Full Duplex and 25MHz clock is available as TX_CLK and RX_CLK. The PHY is used in MII mode.
2022-05-02 04:17 PM
It the clocks are physically present on the respective MCU pins, then check the GPIO configuration for MII pins, MII/RMII configuration for the MAC and simple things like whether all 3 of the ETH MAC related clocks are enabled in RCC.
2022-05-02 05:40 PM
@AJose.2 Is the ETH driver the latest ST "reworked" version (HAL 1.10) or "pre-reworked", or anything custom?
If not the latest, could it be this issue?
Also, see this thread.
2022-05-02 06:02 PM
Good point, but, as MII is the reset value and doesn't change anyway, it should not matter in this particular case.
2022-05-05 02:05 AM
The HAL version I'm using is V1.2.0. I tried (void)SYSCFG->PMCR; as suggested in https://github.com/STMicroelectronics/STM32CubeH7/issues/121 but didnt work. I also verified the clock configuration in RCC.
2022-05-05 06:20 PM
On H7 only the latest version included in a CubeH7 v1.10 package is somewhat working. Previous versions, especially such an ancient one, are almost hopeless. Although the SWR bit depends on a simple things mentioned in previous comments and the issue should be simple.
2024-10-30 04:38 AM - edited 2024-10-30 04:40 AM
I found something when calling the SET_BIT function twice:
https://community.st.com/t5/stm32-mcus-embedded-software/stmh7-eth-dmamr-swr-fails/m-p/737333/highlight/true#M56484
Maybe this will help you :)