DP83640 PHY not working with STM32F767Zi MCU

Has anybody got the TI DP83640 PHY to work with Mbed?

I am working on a custom board using an STM32F767zi as MCU and can not seem to get ethernet working correctly. The initialisation of the ethernet interface seems to work correctly, but when opening a socket the link can’t be made.
Earlier tests on the NUCLEOF767zi development board, don’t show the same problems and this development board uses a different PHY transceiver (LAN8742A). We need to solder the PCB ourselves so for this reason we can not use the LAN8742A because it is only available in a no lead package.

All connections between MCU and PHY are exactly the same as on the Nucleo (RMII) and as far as we can tell the control and status registers are the same for both PHYs. The only difference we have found is that the PHY address of the DP83640 is 0x01 and the address of the LAN8742A is 0x00. For this reason we changed the PHY address to 0x01 in “stm32xx_emac.cpp” file included in Mbed OS. Sadly this did not fix our problem.

We have managed to find the following driver for the PHY transceiver: https://www.oryx-embedded.com/doc/dp83640__driver_8c_source.html
However we are not experienced enough to properly implement this within Mbed.

I don’t really know in exactly what direction to look next or what I should try to find out the exact cause of the problem. For this reason I am wondering if anybody has any experience with this PHY and Mbed or has any ideas we could try?

Kind regards,


Hi Sebastian

I am facing a similar issue with the LAN8742A which I havent solved, however I hope to build the solution together. The PHY Address that you say on STM32 boards are already written in the configuration of the project. I have noticed that when you start the project like a nucleo board that has ethernet, it selects PHY Address = 0 in ->ETH-> "Parameters" and "Advanced Parameters" (And here is not possible to change). Its then hardcoded on the HAL (Something weird). So, if you create your project from the STM32 chip alone this comes with the PHY address 1. I have tried to changed it directly in the code and it crashes the program. I guess your schematic of the PHY is correct, so the problem would be in PCB layout, connection/lenght of the cables or firmware. If changing the firmware doesn`t work or you have tried this circuit alone, try to use an oscilloscope over the serial signals (SMI) and the clock of the DP83640 to see if the chip is dead or the communication is not happening.

changing the code for a different phy address is not the correct way to go, there is a config setting in the emac library. You can change the address by adding "stm32-emac.eth-phy-address" : 1 to your mbed_app.json. There are also more settings for adjusting some register bits that are different for LAN8742 and DB83640.

In the meantime we found the issue was due to a mistake in our schematics. The datasheet of the LAN transformer specified something different to the datasheet of the PHY transceiver. We chose the LAN transformers version which missed 2 pull up resistors. After changing this (and setting PHY address to 1) everything worked fine.

1 Like