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.