Hello,
Which board are you using?
You can refer to any lwIP example that is located at board folder. For example, I am using lwip_httpsrv_bm_frdmk64f example located at <SDK_2_0_FRDM-K64F>/boards/frdmk64f/demo_apps/lwip/lwip_httpsrv
In FRDM-K64F, PTB0 and PTB1 pins are used as RMII0_MDC and RMII0_MDIO respectively, so they are configured in BOARD_InitPins as follows:
/* Affects PORTB_PCR1 register */
PORT_SetPinMux(PORTB, 1u, kPORT_MuxAlt4);
configENET.openDrainEnable = kPORT_OpenDrainEnable;
configENET.mux = kPORT_MuxAlt4;
configENET.pullSelect = kPORT_PullUp;
/* Ungate the port clock */
CLOCK_EnableClock(kCLOCK_PortA);
/* Affects PORTB_PCR0 register */
PORT_SetPinConfig(PORTB, 0u, &configENET);
And PTA12, PTA13, PTA14, PTA5, PTA15, PTA16 and PTA17 are also connected to PHY:
/* Affects PORTA_PCR13 register */
PORT_SetPinMux(PORTA, 13u, kPORT_MuxAlt4);
/* Affects PORTA_PCR12 register */
PORT_SetPinMux(PORTA, 12u, kPORT_MuxAlt4);
/* Affects PORTA_PCR14 register */
PORT_SetPinMux(PORTA, 14u, kPORT_MuxAlt4);
/* Affects PORTA_PCR5 register */
PORT_SetPinMux(PORTA, 5u, kPORT_MuxAlt4);
/* Affects PORTA_PCR16 register */
PORT_SetPinMux(PORTA, 16u, kPORT_MuxAlt4);
/* Affects PORTA_PCR17 register */
PORT_SetPinMux(PORTA, 17u, kPORT_MuxAlt4);
/* Affects PORTA_PCR15 register */
PORT_SetPinMux(PORTA, 15u, kPORT_MuxAlt4);
You can check FRDM-K64F's schematic for more details.
Also, after BOARD_InitPins, BOARD_BootClockRUN and BOARD_InitDebugConsole function, lwip_init function is being called:
MPU_Type *base = MPU;
BOARD_InitPins();
BOARD_BootClockRUN();
BOARD_InitDebugConsole();
/* Disable MPU. */
base->CESR &= ~MPU_CESR_VLD_MASK;
lwip_init();
I hope this helps!
Regards,
Isaac