sys_mbox_post gets wron parameter

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

sys_mbox_post gets wron parameter

Matthias Weisser
Hi

today I started to test around with the socket interface of lwip and wanted to implement a simple echo server and failed :-)

I saw that socket() never returned and debugged it to sys_mbox_post never returned from posting the message to the mailbox. This is because the mbox parameter (which is a typedefed int) is wrong. The only mailbox which is created returns 2119 (id from the os) to the lwip stack but then the sys_mbox_post is called with 0 as mbox parameter. Thanks for any help.


Regards,
Matthias



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: sys_mbox_post gets wron parameter

Jonathan Larmour
Matthias Weisser wrote:

> Hi
>
> today I started to test around with the socket interface of lwip and
> wanted to implement a simple echo server and failed :-)
>
> I saw that socket() never returned and debugged it to sys_mbox_post
> never returned from posting the message to the mailbox. This is because
> the mbox parameter (which is a typedefed int) is wrong. The only mailbox
> which is created returns 2119 (id from the os) to the lwip stack but
> then the sys_mbox_post is called with 0 as mbox parameter. Thanks for
> any help.

This sounds like a problem in your port. In your sources you should find
tcpip.c inside which is a function tcpip_apimsg() which is posting to
"mbox", which is a static defined as:

  static sys_mbox_t mbox;

I bet this is the reason for the 0 parameter.

But as you will also see in that file, there is a function tcpip_init,
which initialises that mbox. I suspect your port is not calling this
function. Or, you are accessing the lwIP functions before the port
initialisation has occurred.

Jifl
--
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------      Opinions==mine


_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Antw: Re: sys_mbox_post gets wron parameter

Matthias Weisser
>>> Jonathan Larmour <[hidden email]> schrieb am 30.05.2007 um 17:23:
> Matthias Weisser wrote:
>> Hi
>>
>> today I started to test around with the socket interface of lwip and
>> wanted to implement a simple echo server and failed :-)
>>
>> I saw that socket() never returned and debugged it to sys_mbox_post
>> never returned from posting the message to the mailbox. This is because
>> the mbox parameter (which is a typedefed int) is wrong. The only mailbox
>> which is created returns 2119 (id from the os) to the lwip stack but
>> then the sys_mbox_post is called with 0 as mbox parameter. Thanks for
>> any help.
>
> This sounds like a problem in your port. In your sources you should find

I am sure it is a problem in my port :-)

> tcpip.c inside which is a function tcpip_apimsg() which is posting to
> "mbox", which is a static defined as:
>
>   static sys_mbox_t mbox;
>
> I bet this is the reason for the 0 parameter.

Yes, it is. I used an existing port which called ip_init(), tcp_init() and udp_init() but not tcpip_init(). After changing this I have now a working echo server. Thanks a lot.


Matthias



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users