AnsweredAssumed Answered

Disable PHY initialization and configuration

Question asked by kerr.matthew on Aug 12, 2017

I'm using CubeMX version 4.22 and firmware FW_F4 V1.16.0. I'm using a STM32F427 and a MICREL KSZ8863MLL Integrated 3-Port 10/100 Managed Switch with PHYs. Everything is working fine. The problem I have is with the the PHY initialization and configuration code being generated by CubeMX. Specifically, stm32f4xx_hal_eth.c lines 278 through 434. I need to comment out the PHY initialization and configuration code as it's not compatible with my PHY. Which also means, every time i regenerate code, I need to disregard any changes to this file.

 

This is one of the few remaining files in my project which I have to revert whenever I regenerate code. I'd like to know is there a way to suppress this code being generated. I have considered creating my own custom files, and preventing this function from being called. I have done this in other areas. In this case, it's not that straight forward.

 

I think what I want to do is tell Cube that I have an MII interface, but no PHY. The default configuration of the Ethernet interface, and the default configuration of the two PHY on the switch, works just fine for me.

Outcomes