I am new to porting . I see that I ll have to modify the cc.h file and fill in the correct entries for the data types and print formatters and checksum algorithm and struct packing etc. I just picked up the defualt cc.h file in the unix port for x86 (the one in the unixsim for simhost), and managed to port it to the ARM device. Yes ofcourse things would nt work correctly as I expected . This is where things are going wrong .. x86 logs and ARM device logs are differring and heres the two logs for your reference. summarizing this I know things are different for these lines 1) ARM Device:tcpip_thread: API message 0x40938e7c x86 pc : tcpip_thread: API message 0x7ff49687adf0 2) ARM device : tcp_bind: bind to port 7 tcpip_thread: API message 0x40646e7c pbuf_alloc(length=65535) pbuf_free: deallocating 0x470dc pbuf_free: deallocating 0x4704c pbuf_free: deallocating 0x46fbc pbuf_free: deallocating 0x46f2c
x86 tcp_bind: bind to port 7 tcpip_thread: API message 0x7ff49787dde0 pbuf_alloc(length=90) pbuf_alloc: allocated pbuf 0x6354f0 pbuf_alloc(length=90) == 0x6354f0 pbuf_free(0x6354f0) pbuf_free: deallocating 0x6354f0 pbuf_alloc(length=54) pbuf_alloc: allocated pbuf 0x6354f0 pbuf_alloc(length=54) == 0x6354f0 tcpip_thread: PACKET 0x631640 pbuf_header: old 0x635508 new 0x635516 (-14) ip_input: iphdr->dest 0x160000e0 netif->ip_addr 0x200a8c0 (0xe0, 0xa8c0, 0x16000000) ip_input: packet not for us. ip_forward: not bouncing packets back on incoming interface. pbuf_free(0x6354f0) pbuf_free: deallocating 0x6354f0 pbuf_alloc(length=222) Now I know that the struct api_msg that is being passed by the resp functions in the code for ARM device and x86 pc size is different Also the parameter that is being passed to the pbuf_alloc is going wrong in the ARM device . It ends up asking for 65535 buff len and then runs out of pool and ends up freeing the pbuf.. whereas in the x86 its asks for less pbuf , i.e 54 and then goes on to send the packet successfully.. Is there a script or a way someone has written that will help me write the correct cc.h file so that things dont break like this ...some porting tips as to how I should judge the max pbuf pool I should set . I think I ll have to write small pieces of code to check all this , like a piece of code that tells me the pointer size in my ARM device or helps me see what struct packing works best for my ARM device etc . Is there already someone who has done things like this . Can someone plz share your Porting experience with me and give me adivce to how to port lwip for the ARM device without bugs satisfactorily. Yes , I am trying this for first time . Regards Sraddha ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- The complete logs... ARM device netif: IP address of interface ^@^@ set to 192.168.0.2 netif: netmask of interface ^@^@ set to 255.255.255.0 netif: GW address of interface ^@^@ set to 192.168.0.1 tapif_init: fd 3 tapif_init: system("/system/bin/ifconfig tap0 inet 192.168.0.1"); netif: added interface tp IP addr 192.168.0.2 netmask 255.255.255.0 gw 192.168.0.1 netif: setting default interface tp httpd_init tcp_bind: bind to port 80 TCP/IP initialized. Applications started. tcpip_thread: API message 0x40938e7c tcpip_thread: API message 0x40938e7c udp_bind(ipaddr = 0.0.0.0, port = 7) udp_bind: bound to 0.0.0.0, port 7 tcpip_thread: API message 0x40824e7c tcpip_thread: API message 0x40824e7c tcp_bind: bind to port 23 tcpip_thread: API message 0x40824e84 tcpip_thread: API message 0x40646e74 tcpip_thread: API message 0x40646e74 tcp_bind: bind to port 7 tcpip_thread: API message 0x40646e7c pbuf_alloc(length=65535) pbuf_alloc: allocated pbuf 0x470dc memp_malloc: out of memory in pool PBUF_POOL tcpip_thread: CALLBACK 0x435b8 pbuf_free(0x470dc) pbuf_free: deallocating 0x470dc pbuf_free: deallocating 0x4704c pbuf_free: deallocating 0x46fbc pbuf_free: deallocating 0x46f2c pbuf_free: deallocating 0x46e9c pbuf_free: deallocating 0x46e0c pbuf_free: deallocating 0x46d7c pbuf_free: deallocating 0x46cec x86 pc Host at 192.168.0.2 mask 255.255.255.0 gateway 192.168.0.1 System initialized. netif_set_ipaddr: netif address being changed netif: IP address of interface ^@^@ set to 192.168.0.2 netif: netmask of interface ^@^@ set to 255.255.255.0 netif: GW address of interface ^@^@ set to 192.168.0.1 tapif_init: fd 3 tapif_init: system("/sbin/ifconfig tap0 inet 192.168.0.1"); netif: added interface tp IP addr 192.168.0.2 netmask 255.255.255.0 gw 192.168.0.1 netif: setting default interface tp httpd_init tcp_bind: bind to port 80 TCP/IP initialized. Applications started. tcpip_thread: API message 0x7ff49687adf0 tcpip_thread: API message 0x7ff49687ade0 udp_bind(ipaddr = 0.0.0.0, port = 7) udp_bind: bound to 0.0.0.0, port 7 tcpip_thread: API message 0x7ff49707cdf0 tcpip_thread: API message 0x7ff49707cde0 tcp_bind: bind to port 23 tcpip_thread: API message 0x7ff49707cdf0 tcpip_thread: API message 0x7ff49787dde0 tcpip_thread: API message 0x7ff49787ddd0 tcp_bind: bind to port 7 tcpip_thread: API message 0x7ff49787dde0 pbuf_alloc(length=90) pbuf_alloc: allocated pbuf 0x6354f0 pbuf_alloc(length=90) == 0x6354f0 pbuf_free(0x6354f0) pbuf_free: deallocating 0x6354f0 pbuf_alloc(length=54) pbuf_alloc: allocated pbuf 0x6354f0 pbuf_alloc(length=54) == 0x6354f0 tcpip_thread: PACKET 0x631640 pbuf_header: old 0x635508 new 0x635516 (-14) ip_input: iphdr->dest 0x160000e0 netif->ip_addr 0x200a8c0 (0xe0, 0xa8c0, 0x16000000) ip_input: packet not for us. ip_forward: not bouncing packets back on incoming interface. pbuf_free(0x6354f0) pbuf_free: deallocating 0x6354f0 pbuf_alloc(length=222)
_______________________________________________ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users