Showing results for 
Search instead for 
Did you mean: 

SWR bit of ETH_DMAMR does not get reset by hardware

Benedikt Schmidt
Associate II

I have to examples of a PCB with a H735. On one of them HAL_Init for ethernet fails due to the SWR bit of ETH_DMAMR not getting reset by hardware. On the other example of the PCB everything is working fine, running the exact same binary.

Usually this seems to indicate an issue with REF_CLK. Unfortunately, REF_CLK is fine in both cases. The reference manual does not got into really more detail about what else could be missing or incorrect. As the exact same binary is working on a different PCB I expect the internals to be configured correctly by software. Hence, I assume an external signal is incorrect or in an incorrect state?


Benedikt Schmidt

ST Employee

Hello @Benedikt Schmidt​ ,

Maybe this is due to the external MII/RMII clock!

So, check the pin configuration and the clock signal.

Have a look also at the errata sheet, and check if you have the same conditions as described in the Ethernet section.

I recommend you following the How to create project for STM32H7 with Ethernet and LwIP stack working article, it will help you in the Ethernet configuration.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.


When your question is answered, please close this topic by clicking "Accept as Solution".
Benedikt Schmidt
Associate II

Hi Imen,

as I wrote, I already checked the external clock. At least according to a visual inspection with the oscilloscope it was fine.

In the meantime a colleague figured out that the Ethernet Phy had an incorrect level on its reset pin. I still do not know how this exactly influenced the H7 to not clear the SWR bit, but setting this reset pin to a correct level fixed the issue.


Benedikt Schmidt

Associate II

Hello Benedict,


We have the exact same problem, which PHY are you using? We have an external micrel PHY. 

Benedikt Schmidt
Associate II

I think it was a LAN8720AI, but I am not totally sure anymore.


For now I'm only using the H723 Nucleo and the H735 Discovery, both with the LAN8742 PHY, which provides the 50 MHz ref clock for STM32 RMII.

Here's part of my startup code, no failures, ever... 😉

uint8_t EthBaseInit(void)
	uint32_t u32TickStart = 0;
	uint32_t u32TempReg = 0;

	/* ETH clock enable */


	/* reset Ethernet MAC peripheral */

	/* GPIO init */

/* set RMII Mode*/
	/* ### IMPORTANT dummy read to sync SYSCFG with ETH */

/* SoftWare Reset */
	/* set SWR bit: resets all MAC subsystem internal registers and logic
	 * 	NOTE: the SWR is not performed if the ETH_RX_CLK or the ETH_TX_CLK are
	 *			not available -> check external PHY or 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;

Hi Benedikt,


I am currently having the same issue with custom board and eth phy. Since I am new with the concept I need your help. Can you please explain in more detail what is meant by "incorrect level on its reset pin". My ethernet phy LAN8742AI has "nRST" pin that deals with external reset. If it is the issue how can I detect the incorrect level of this pin? 

Thank you in advance.

Incorrect level meant in our case that the RST pin was not pulled down correctly to ground, therefore the PHY did not reset. I recommend using a voltmeter or oscilloscope and measure the voltage of the nRST pin during the reset procedure.

In our case the issue was a faulty reset-circuitry.