I've had this issue all day where I could not get absolutely anything from the discovery board's MAC, starting a very simple project using LwIP and CubeMX4.22
First of all, after lots of reading, it seems that CubeMX 4.22 still generates the PHY address value as 1 if "PHY" is configured as "LAN8742_PHY_ADDRESS".
There's two workarounds at the moment:
1) On "ethernetif.c" add the following lines
/* USER CODE BEGIN MACADDRESS */
/* This overrides the physical address */
heth.Init.PhyAddress = 0;
/* USER CODE END MACADDRESS */
2) On the ETH Configuration window -> Advanced Parameters
set "PHY" to "user PHY"
rename it to LAN_8742A (for some reason the PHY Address Vaulue 0 cannot be changed)
Under "User Constants" add
LAN_8742A_PHY_ADDRESS and value "0"
Regenerate your code. Call your "MX_LWIP_Process()" function inside the main loop, inside the user code section. That should get you the ethernet interface up and running.
I haven't tried any apps yet, but at least the PING command from a PC works.
Hope that helps someone.