Greetings,

I am having trouble integrating LWIP into my embedded project due to my
inability to observe the system without adversely affecting its ability to
function within the platform. The intended target is an STM32F107 MCU +
Micrel 8041 PHY running ChibiOS/RT. The TCP/IP functionality required is
fairly light and consists of: 1) NTP or SNTP for time synchronization. 2)
HTTP client for data payload delivery.

I am still in the midst of locking down the driver code for the MAC and
other RTOS configuration issues which can affect LWIP (e.g. debug code), so
I would like to decouple development from the hardware for a moment and get
these functions to work with just LWI, then introduce the working LWIP apps
with more confidence into the resource constrained RTOS environment. The
lwip-contrib version 1.4.1 has a unix port called *unixsim* which is what I
have attempted to use but without much success in my native environment.
The README sort of describes how to make for Linux or FreeBSD (with kernel
recompile), though my host is Mac OS X 10.7.5 with
tuntap<http://tuntaposx.sourceforge.net/> because
my Ubuntu VM had failed to compile and I did not feel like digging out
FreeBSD for this task. With a little fiddling I was able to get it to
compile on OS X, though the program exits before I can tcpdump the tap0 or
otherwise probe it. I am not sure why it does this. Here is the typical
output with all the debug output options enabled from a gdb session:

> (gdb) file simhost
>
> Reading symbols for shared libraries ... done
>
> Reading symbols from
>> /STM32/Work/lwip-1.4.1/contrib/ports/unix/proj/unixsim/simhost...done.
>
> (gdb) run -d
>
> Starting program:
>> /STM32/Work/lwip-1.4.1/contrib/ports/unix/proj/unixsim/simhost -d
>
> Reading symbols for shared libraries ++.......................... done
>
> Host at 192.168.1.20 mask 255.255.255.0 gateway 192.168.1.1
>
> System initialized.
>
> netif initializing...
>
> netif initialized.
>
> TCP/IP initializing...
>
> netif_set_ipaddr: netif address being changed
>
> netif: IP address of interface  set to 192.168.1.20
>
> netif: netmask of interface  set to 255.255.255.0
>
> netif: GW address of interface  set to 192.168.1.1
>
> tapif_init: fd 3
>
> tapif_init: system("/sbin/ifconfig tap0 inet 192.168.1.1 up");
>
> netif: added interface tp IP addr 192.168.1.20 netmask 255.255.255.0 gw
>> 192.168.1.1
>
> netif: setting default interface tp
>
> tcp_bind: bind to port 80
>
> pbuf_alloc(length=42)
>
> pbuf_alloc: allocated pbuf 0x100044c10
>
> pbuf_alloc(length=42) == 0x100044c10
>
> pbuf_alloc(length=42)
>
> pbuf_alloc: allocated pbuf 0x100044b78
>
> pbuf_alloc(length=42) == 0x100044b78
>
> TCP/IP initialized.
>
> Applications started.
>
> tcpip_thread: PACKET 0x100040180
>
> pbuf_free(0x100044c10)
>
> pbuf_free: deallocating 0x100044c10
>
> tcpip_thread: PACKET 0x100040158
>
> pbuf_free(0x100044b78)
>
> pbuf_free: deallocating 0x100044b78
>
> tcpip_thread: API message 0x100586dc8
>
> tcpip_thread: API message 0x100609de8
>
> tcpip_thread: API message 0x10068bdf8
>
> tcpip_thread: API message 0x100586df8
>
> tcp_bind: bind to port 7
>
> tcpip_thread: API message 0x100609e18
>
> tcp_bind: bind to port 23
>
> tcpip_thread: API message 0x100586e08
>
> tcpip_thread: API message 0x100609e28
>
> tcpip_thread: API message 0x10068be28
>
> udp_bind(ipaddr = 0.0.0.0, port = 7)
>
> udp_bind: bound to 0.0.0.0, port 7
>
>
>> Program exited normally.
>
> (1) Any hints for porting to OS X would be greatly appreciated. For
instance, what does the above log indicate?

(2) I was able to get it to work on the Ubuntu VM after learning a bit more
about the project through my botched Darwin port. These notes may be of
interest to whomever writes the readme files for lwip-contrib's
*unixsim*project:
make ARCH=linux
Removed* -Werror* due to Warning the comparison will always evaluate to
true and set variables unused
LDFLAGS from -lpthread to -pthread

The make ARCH=linux appears to be optional on my Ubuntu VM and seemingly
introduces more warnings than without specifying ARCH (which defaults to *unix,
*IIRC).

(3) Is there a simpler or easier way to develop an embedded TCP/IP
application than the path I am on?

Cheers,
Joe Gorse

C: 440-552-0730
LI: Joe Gorse <http://www.linkedin.com/pub/joe-gorse/7/12/397>
FB: jhgiv <https://www.facebook.com/jhgiv>
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to