工具/软件:
我正在尝试在我自己的项目中重复使用 EMACbootloader 代码中的 BOOTP 和 TFTP 功能。 但是、当我直接重复使用并执行 BOOTPThread 函数时、程序会在调用 UIP_UDP_REMOVE (g_PCONN) 时进入 FaultISR。 此函数用于修改变量 g_PCONN。 您是否知道在执行此功能时可能导致问题的原因?
PT_THREAD(BOOTPThread(void))#endif{ // // Begin the proto-thread. // PT_BEGIN(&g_sThread);wait_for_link: PT_WAIT_UNTIL(&g_sThread, (LOCAL_EMACPHYRead(EMAC0_BASE, 0, EPHY_BMSR) & EPHY_BMSR_LINKSTAT) != 0);// // Reset the host address. // *((uint32_t *)(void *)(&uip_hostaddr)) = 0;// // Re-bind the UDP socket for sending requests to the BOOTP server. // uip_udp_remove(g_pConn); *((uint32_t *)(void *)(&g_sServerAddr)) = 0xffffffff; uip_udp_new(&g_sServerAddr, HTONS(BOOTP_SERVER_PORT)); uip_udp_bind(g_pConn, HTONS(BOOTP_CLIENT_PORT));