Hello All,
Now I use TWR-K60N512< TWR-SER> with MQX 3.8 to run a PPP client example <rtcs/examples/shell>.
I have done step by step follow the document ,Everything look fine and connection was established.
But, after that I've never success Ping to any IP, It always reply "Error 0x1510".
Could you please give me a suggestion for this?
Thank you
...................
Solved! Go to Solution.
It means no route to host.
Its because Freescale hasn't fixed their PPP driver (which also has infinate loops in it as well - so some of your RTCS functions will lock up your code when the ppp link is down).
This is what I did to fix the issue:
static boolean IPCP_up ( PPPFSM_CFG_PTR fsm /* [IN] - State Machine */ ){ /* Body */ IP_IF_PTR if_ptr = fsm->PRIVATE; IPCP_CFG_STRUCT_PTR ipcp_ptr = if_ptr->HANDLE; /* Bind the negotiated IP address to this interface */ ipcp_ptr->BIND_PARMS.ihandle = if_ptr; ipcp_ptr->BIND_PARMS.address = ipcp_ptr->LOPT.ADDR; ipcp_ptr->BIND_PARMS.network = ipcp_ptr->POPT.ADDR?ipcp_ptr->POPT.ADDR:((ipcp_ptr->LOPT.ADDR & IN_CLASSC_NET) + 1); //ipcp_ptr->BIND_PARMS.network = ipcp_ptr->POPT.ADDR; ipcp_ptr->BIND_PARMS.netmask = INADDR_ANY; RTCSCMD_smartissue(ipcp_ptr->BIND_PARMS, IPIF_bind_ppp); /* Install a default gateway */ if (ipcp_ptr->INIT.DEFAULT_ROUTE) { ipcp_ptr->GATE_PARMS.address = ipcp_ptr->POPT.ADDR?ipcp_ptr->POPT.ADDR:((ipcp_ptr->LOPT.ADDR & IN_CLASSC_NET) + 1); //ipcp_ptr->GATE_PARMS.address = ipcp_ptr->POPT.ADDR; ipcp_ptr->GATE_PARMS.network = INADDR_ANY; ipcp_ptr->GATE_PARMS.netmask = INADDR_ANY; /* Start CR 1133 */ ipcp_ptr->GATE_PARMS.locmask = 0; /* End CR 1133 */ RTCSCMD_smartissue(ipcp_ptr->GATE_PARMS, IPIF_gate_add); } /* Endif */#if RTCSCFG_ENABLE_DNS || RTCSCFG_ENABLE_LWDNS /* Set up the primary DNS server */ if (ipcp_ptr->NEG.NEG_DNS) {#if RTCSCFG_ENABLE_DNS /* Start CR 2257 */ DNS_SLIST_STRUCT slist_entry; DNS_init_slist_entry(&slist_entry); slist_entry.IPADDR = ipcp_ptr->LOPT.DNS; if (DNS_add_slist_entry(&slist_entry) != DNS_OK) return FALSE; /* End CR 2257 */#else LWDNS_server_ipaddr = ipcp_ptr->LOPT.DNS;#endif } /* Endif */#endif if (ipcp_ptr->IP_UP) { ipcp_ptr->IP_UP(ipcp_ptr->IP_PARAM); } /* Endif */ return TRUE;} /* Endbody */
It means no route to host.
Its because Freescale hasn't fixed their PPP driver (which also has infinate loops in it as well - so some of your RTCS functions will lock up your code when the ppp link is down).
This is what I did to fix the issue:
static boolean IPCP_up ( PPPFSM_CFG_PTR fsm /* [IN] - State Machine */ ){ /* Body */ IP_IF_PTR if_ptr = fsm->PRIVATE; IPCP_CFG_STRUCT_PTR ipcp_ptr = if_ptr->HANDLE; /* Bind the negotiated IP address to this interface */ ipcp_ptr->BIND_PARMS.ihandle = if_ptr; ipcp_ptr->BIND_PARMS.address = ipcp_ptr->LOPT.ADDR; ipcp_ptr->BIND_PARMS.network = ipcp_ptr->POPT.ADDR?ipcp_ptr->POPT.ADDR:((ipcp_ptr->LOPT.ADDR & IN_CLASSC_NET) + 1); //ipcp_ptr->BIND_PARMS.network = ipcp_ptr->POPT.ADDR; ipcp_ptr->BIND_PARMS.netmask = INADDR_ANY; RTCSCMD_smartissue(ipcp_ptr->BIND_PARMS, IPIF_bind_ppp); /* Install a default gateway */ if (ipcp_ptr->INIT.DEFAULT_ROUTE) { ipcp_ptr->GATE_PARMS.address = ipcp_ptr->POPT.ADDR?ipcp_ptr->POPT.ADDR:((ipcp_ptr->LOPT.ADDR & IN_CLASSC_NET) + 1); //ipcp_ptr->GATE_PARMS.address = ipcp_ptr->POPT.ADDR; ipcp_ptr->GATE_PARMS.network = INADDR_ANY; ipcp_ptr->GATE_PARMS.netmask = INADDR_ANY; /* Start CR 1133 */ ipcp_ptr->GATE_PARMS.locmask = 0; /* End CR 1133 */ RTCSCMD_smartissue(ipcp_ptr->GATE_PARMS, IPIF_gate_add); } /* Endif */#if RTCSCFG_ENABLE_DNS || RTCSCFG_ENABLE_LWDNS /* Set up the primary DNS server */ if (ipcp_ptr->NEG.NEG_DNS) {#if RTCSCFG_ENABLE_DNS /* Start CR 2257 */ DNS_SLIST_STRUCT slist_entry; DNS_init_slist_entry(&slist_entry); slist_entry.IPADDR = ipcp_ptr->LOPT.DNS; if (DNS_add_slist_entry(&slist_entry) != DNS_OK) return FALSE; /* End CR 2257 */#else LWDNS_server_ipaddr = ipcp_ptr->LOPT.DNS;#endif } /* Endif */#endif if (ipcp_ptr->IP_UP) { ipcp_ptr->IP_UP(ipcp_ptr->IP_PARAM); } /* Endif */ return TRUE;} /* Endbody */
Can u please tell me what does this statement " ipcp_ptr->GATE_PARMS.address = ipcp_ptr->POPT.ADDR?ipcp_ptr->POPT.ADDR:((ipcp_ptr->LOPT.ADDR & IN_CLASSC_NET) + 1); " exactly do?
when ppp_up() get executed?
Great work, Thak you so much.