2025-08-11 6:08 PM
In a recent release (not sure which one) the option to select USER_PHY was added to the platform settings under LWIP.
I need to implement a different PHY for a LAN9374. It is basically identical to the LAN8742. The only issue is that the LAN8742 init code fails unless modified slightly. If I select LAN8742 and modify the file I can get it working but as expected every time I regenerate the project the modifications get overwritten. Where is the documentation on how to implement a USER_PHY?
2025-08-12 2:44 AM
Hello @theRat
Could you please add the .ioc file.
KR,
Souhaib
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-08-12 4:11 PM - edited 2025-08-12 4:41 PM
Hi Souhaib,
Thanks for the reply. I am not sure how the .IOC file is particularly relevant to my question but here it is anyway.
When you select USER_PHY it aslo creates 2 files in the LWIP/Target directory (eth_custom_phy_interface.c and .h). These are basically empty files with a couple of prototypes and no information as what is needed/expected. I have attached those files as well.
Regards
Simon
2025-08-13 3:21 AM
Hello @theRat
Yes, exactly. Using the USER PHY option will generate two files, and the user is supposed to use them to implement their custom driver.
Try to copy your code into these files and ensure that your code is under the USER section to avoid your modifications being overwritten.
KR,
Souhaib
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-08-13 3:37 AM
Hi Souhaib,
Once again thanks for the reply. I guess the crux of the question is what is needed to be implemented. I basically need to implement a copy of the LAN8742 driver that I can customise very slightly that doesn't get obliterated every time I regenerate from the IOC file. Part of the problem is that when using the standard LAN8742 driver it registers a bunch of functions. I don't see how this is meant to be handled in a custom PHY. In fact the functions prototypes of the init functions are different depending on whether you select USER_PHY or LAN8742. TO me it looks like the USER_PHY option has not been thought through properly and without a worked example is not usable.
Regards
Simon