Hello @FrankLiu2019 ,
Thank you for sharing all the details.
Your MII clock settings appear correct. However, to my knowledge, there is currently no active NXP EVB or RDB kit that uses MII mode, so I don't have hands-on experience with MII configurations.
May I ask — is there a specific reason you're opting for MII instead of RMII?
You might find this thread helpful regarding RMII clocking:
https://community.nxp.com/t5/S32K/RMII-clock-for-S32K3/m-p/2053530
As a starting point, I would recommend using the lwIP example from the TCP/IP stack package. Please ensure that S32K3 FreeRTOS 11.1.0 6.0.0 CD01 is installed prior to S32K3 TCP/IP Stack 3.0.0.
Regarding your observation:
If you're using Gmac_Ip directly, you must set the PHY interface mode manually before calling Gmac_Ip_Init(). Specifically, this line should be placed as the very first instruction in your bring-up code:
IP_DCM_GPR->DCMRWF1 = (IP_DCM_GPR->DCMRWF1 & ~DCM_GPR_DCMRWF1_MAC_CONF_SEL_MASK) | DCM_GPR_DCMRWF1_MAC_CONF_SEL(0U);
This is essential because the PHY interface mode is latched during GMAC reset.
If you're using the Eth_43_GMAC stack, this configuration is already handled internally during the call to Eth_43_GMAC_Init(), so no manual register setup is required.
Best regards,
Pavel