How to debug Ethernet Phy on a customized board?

Hi,

We designed a customized board based on NUCLEO_F429ZI, so far everything works except Ethernet Interface. When the customized board is connected to a router, running Ethernet example code will output no ip/DHCP cannot get IP address. However link LED stays on, and activity LED will blink once in a while. The port on router customized board connects to will be shown as plugged in 100MHz. I assume the problem is somewhere between MCU and ethernet phy IC LAN8742.

Can anyone offer some pointers on how to troubleshoot? Crystal? Layout? I did check schematics to make sure they are identical to NUCLEO_F429ZI .

Thanks in advance.

Hey I was just in your situation.

One thing that helped was editing lwipopts.h and enabling all the debug prints from LWIP. This will cause it to print all packets that are sent and received over the PHY.

Some other things to check:

  • Is the PHY getting an input clock at the right freq?
  • Is the PHY outputting the correct clock?
  • Do you see a plausible digital signal on all the RMII lines?
  • Are the RMII lines connected to the same processor pins as on the Nucleo board?
  • If you made a custom target, did you add a customized stm32f4_eth_init.c and stm32f4_eth_conf.c to it? These files are used by Mbed to set up what pins are used for RMII, and they are attached to the NUCLEO board target, not the MCU target, so they don’t get included if you build a custom target.

In our case, it turned out we had two problems. First of all, the eth init file was not getting built because we had a custom target, so we had to copy it to the custom target dir and also modify it to account for using different pins on our board. Also, there was a solder bridge on one of the RMII lines causing it to be stuck at high. This manifested as being able to receive packets fine but not being able to send them.

1 Like

Hi Jamie,

Thanks for your tip.

Our problem was eventually tracked down to changes made to local copy of mbed-os. When we were working with Arch_max board, we changed default phy address in stm32xx_emac.cpp because that is not the phy address configured on actual board. Unfortunately this file is shared by all STM32F4 based boards and we totally forgot about the changed phy address.