EmbDev.net

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


Author: Rick (Guest)
Posted on:

Rate this post
0 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

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 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).

Author: Jonathan Dumaresq (dumarjo)
Posted on:

Rate this post
0 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

Author: Andy Kunz (andykunz)
Posted on:

Rate this post
0 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

Author: Jonathan Dumaresq (dumarjo)
Posted on:

Rate this post
0 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

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.