CH32V208W DHCP换到MQTT例程就不行
代码如下,就运行到 PHY Link Success ,然后就停住了;
运行DEMO中的DHCP是可以正常从路由获取到IP,但是将代码拷贝到MQTT例程,就不行了,IP获取不到
也注释到了MQTT的连接,也是不行,
默认IP也改为DHCP的DEMO中的{0,0,0,0}
有熟悉的帮忙看看,是不是哪不对
TIM2_Init();
WCHNET_GetMacAddr(MACAddr); //get the chip MAC address
printf("mac addr:");
for(i = 0; i < 6; i++)
printf("%x ",MACAddr[i]);
printf("\n");
WCHNET_DHCPSetHostname("WCHNET"); //Configure DHCP host name
i = ETH_LibInit(IPAddr,GWIPAddr,IPMask,MACAddr); //Ethernet library initialize
mStopIfError(i);
if(i == WCHNET_ERR_SUCCESS) printf("WCHNET_LibInit Success\r\n");
WCHNET_DHCPStart(WCHNET_DHCPCallBack);
// Transport_Open(); //open the TCP connection.
while(1)
{
/*Ethernet library main task function,
* which needs to be called cyclically*/
WCHNET_MainTask();
/*Query the Ethernet global interrupt,
* if there is an interrupt, call the global interrupt handler*/
if(WCHNET_QueryGlobalInt())
{
WCHNET_HandleGlobalInt();
}