Dear all I have made a simple project,but the DHCP seems to not working,Here is my code,
void TcpTickTask(void const *argument) { /* System tick timer task */ os_itv_set (100); while (1) { timer_tick (); tick = __TRUE; os_itv_wait (); } } static void dhcp_check () { /* Monitor DHCP IP address assignment. */ if (tick == __FALSE || dhcp_tout == 0) { return; } tick = __FALSE; if (mem_test (&localm[NETIF_ETH].IpAdr, 0, IP_ADRLEN) == __FALSE && !(dhcp_tout & 0x80000000)) { /* Success, DHCP has already got the IP address. */ dhcp_tout = 0; return; } if (--dhcp_tout == 0) { /* A timeout, disable DHCP and use static IP address. */ dhcp_disable (); dhcp_tout = 30 | 0x80000000; return; } if (dhcp_tout == 0x80000000) { dhcp_tout = 0; } } void MainTcpTask(void const *argument) { dhcp_tout = DHCP_TOUT; for(;;) { osMutexWait (mutex_TcpNet_ID, osWaitForever); main_TcpNet (); dhcp_check (); osMutexRelease (mutex_TcpNet_ID); } }
Some pictures, s30.postimg.org/.../DHCP.png postimg.org/.../ postimg.org/.../
Do you suggest any work around?
Are you using some board any one might recognize, or some custom one? Has the design been validated in any way? Can you send/receive Ethernet traffic? What kind of testing and debugging of the driver have you done?
Thanks for the info,Actually the board is a costume design,And I have tested the HTTP server on it with the static IP, every thing is working as expected, and the Ethernet derive and everything else like FTP Server, HTTP server are working,Now I wanted to switch to DHCP,So any Idea?