int main(void)
{ unsigned int i,j;
/*!< At this stage the microcontroller clock setting is already configured to
168 MHz, this is done through SystemInit() function which is called from
startup file (startup_stm32f4xx.s) before to branch to application main.
To reconfigure the default setting of SystemInit() function, refer to
system_stm32f4xx.c file
*/
USART_Config();
DMA_Config();
NVIC_Config();
GPIO_SetBits(GPIOF, GPIO_Pin_10); //关闭LED
//add a long delay wait for DP83848 finish reset
for(i=0;i<50;i++){
for(j=0;j < 65500;j++);
}
#ifdef SERIAL_DEBUG
DebugComPort_Init();
#endif
ETH_BSP_Config(); /* Initilaize the LwIP stack */
LwIP_Init(); /* tcp echo server Init */
tcp_echoserver_init(); /* Infinite loop */
while (1)
{
if(ETH_CheckFrameReceived()){/* check if any packet received */
LwIP_Pkt_Handle();/* process received ethernet packet */
}
LwIP_Periodic_Handle(LocalTime); /* handle periodic timers for LwIP */
}
以上是我的主函数,在主函数中主要有串口初始化函数和lwip初始化函数,现在是串口函数能用,网络部分没反应;当这两部分函数的位置互换,结果就是网络好用,串口没反应。有明白的帮着解释解释啊。。。。。。
此帖出自
小平头技术问答
一周热门 更多>