EmbDev.net

Forum: ARM programming with GCC/GNU tools lwip TCP sockets


von Rick (Guest)


Rate this post
useful
not useful
I am using lwip for my microcontroller (AT91SAM7x256).
The webserver is running good.
Now I like a communication by TCP sockets.
When using   lwip-1.1.0/src/api/sockets.c , I have to add this to my
makefile.
Where must I add this?

I did the following:

LWIP_THUMB_SRC= \
................
 lwip-1.1.0/src/api/sockets.c \              (I added this)
.........

Now I get 152 compiler warnings and the OS hangs.
How can I solve this?

Regards, Rick

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Rick wrote:
> I am using lwip for my microcontroller (AT91SAM7x256).
> The webserver is running good.
> Now I like a communication by TCP sockets.
> When using   lwip-1.1.0/src/api/sockets.c , I have to add this to my
> makefile.
> Where must I add this?
>
> I did the following:
>
> LWIP_THUMB_SRC= \
> ................
>  lwip-1.1.0/src/api/sockets.c \              (I added this)
> .........
>
> Now I get 152 compiler warnings and the OS hangs.
> How can I solve this?

Not enough information.

Paste at least the beginning of the output including the 15 first
warning. Maybe you have just missed to add the additional
include-directorys to the include-search-path (extraincdirs in WinARM
sample-makefiles).

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Martin Thomas wrote:
> Rick wrote:
>> I am using lwip for my microcontroller (AT91SAM7x256).
>> The webserver is running good.
>> Now I like a communication by TCP sockets.
>> When using   lwip-1.1.0/src/api/sockets.c , I have to add this to my
>> makefile.
>> Where must I add this?
>>
>> I did the following:
>>
>> LWIP_THUMB_SRC= \
>> ................
>>  lwip-1.1.0/src/api/sockets.c \              (I added this)
>> .........
>>
>> Now I get 152 compiler warnings and the OS hangs.
>> How can I solve this?
>
> Not enough information.
>
> Paste at least the beginning of the output including the 15 first
> warning. Maybe you have just missed to add the additional
> include-directorys to the include-search-path (extraincdirs in WinARM
> sample-makefiles).

If you have the webserver running, i don't see why you need to add
something in the make file?, since the webserver use TCP, everything
sould be there

Jonathan

von Andy K. (andykunz)


Rate this post
useful
not useful
> If you have the webserver running, i don't see why you need to add
> something in the make file?, since the webserver use TCP, everything
> sould be there

It's because the webserver doesn't use sockets.h - it uses the API.

I have coded several programs using both methods (in the same app -
works fine).  The sockets form is useful when starting from standard
applications, but it does not perform any of the checks (or support
timeouts) as you would probably want.  The API form means you have much
more to code, but your code can be much more robust.

As to why it isn't working, we need to see a bit more information.  I
simply added sockets.h (and other .h files) until the compiler was able
to find all the pieces it needed.

Make sure you get the path correct for the file you are including.  Make
sure it is actually there, too.

Andy

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Andy Kunz wrote:
>> If you have the webserver running, i don't see why you need to add
>> something in the make file?, since the webserver use TCP, everything
>> sould be there
>
> It's because the webserver doesn't use sockets.h - it uses the API.
>
> I have coded several programs using both methods (in the same app -
> works fine).  The sockets form is useful when starting from standard
> applications, but it does not perform any of the checks (or support
> timeouts) as you would probably want.  The API form means you have much
> more to code, but your code can be much more robust.
>
> As to why it isn't working, we need to see a bit more information.  I
> simply added sockets.h (and other .h files) until the compiler was able
> to find all the pieces it needed.
>
> Make sure you get the path correct for the file you are including.  Make
> sure it is actually there, too.
>
> Andy


I see now.

thanks for the info Andy.

Jonathan

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.