cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet on custom board with STM32H730

DanS
Associate

I have a custom board with an STM32H730 and a LAN8710A PHY, operated in RMII mode.  The board is a new design, based on an older board but with some differences (the older board has an STM32H750).  My short-term goal is to prove out the hardware -- a response to a ping would be sufficient for this.

I have no prior experience with the STM32 family.  I set up a project with STM32CubeIDE, following the Ethernet video from ControllersTech.  I'm at a point where the firmware initializes without error, and seems to correctly set up the PHY.  But then I run into problems.

With the board plugged into the building LAN and a scope connected to the RX lines of the PHY, I see activity on those signals.  There is, however, no activity on the TX lines going from the processor back to the PHY.  And of course there's no response to a ping.

We're outputting a 50 MHz clock from MCO1, and feeding that into ETH_RMII_REF_CLK and into the PHY clock input.  That signal looks good.

During setup the firmware queries the registers in the PHY, and the results look reasonable -- for example, I can see that the PHY is correctly in RMII mode.

We're using an 8710 PHY, and the Ethernet driver in the project is for a LAN8742, which has new features and new registers defined.  I looked at the list of registers in the driver, and searched the code for their uses.  I don't see any setting or queries of registers that are present in the 8742 but missing from the 8710.

With the complexity of memory configuration and all the other setup, I don't know what direction to go in.  Any hints on how to approach this would be appreciated.

3 REPLIES 3
######
Senior

Hello, this might not apply to your case, but sometimes the built in cube default settings for the PHY don't actually match the datasheet and need tweaking. For example regarding the 8742 see posts by other members here:

https://community.st.com/s/question/0D53W000015bQsFSAU/cant-get-f746zg-nucleo-ethernet-to-work-with-the-lwip-example-on-cubeide

To get my setup to work with 8742 I had to edit the following parameters in Cube:

Phy Address 0

Phy Special control / status register Offset 0x1F

Phy Speed Mask 0x004

Phy Duplex Mask 0x0010

Looking at the Datasheet for the 8710 page 53, the PHY SPECIAL CONTROL/STATUS REGISTER
Index (In Decimal): 31 which equals 1F in hex (so the Offset should be 0x1F).

Hope this helps. 

DanS
Associate

Thanks all.  A colleague of mine managed to make this work, starting with some different code that he found using FreeRTOS (I was programming to bare metal).  It took quite a bit of experimentation but eventually he was able to ping the board, proving out the hardware configuration.  It's unfortunate that this is so difficult.