2.1.0+contrib freertos port

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

2.1.0+contrib freertos port

Rastislav Uhrin

Hello all,

 

I am using latest lwIP version and freertos port compiled without LWIP_NOASSERT.

I have also defined

#define DEFAULT_ACCEPTMBOX_SIZE                     4

#define DEFAULT_UDP_RECVMBOX_SIZE               4

#define DEFAULT_TCP_RECVMBOX_SIZE                4

 

I am getting assert on commented line which checks size of allocated queue because size is 0.

 

err_t

sys_mbox_new(sys_mbox_t *mbox, int size)

{

  LWIP_ASSERT("mbox != NULL", mbox != NULL);

  //LWIP_ASSERT("size > 0", size > 0);

 

  mbox->mbx = xQueueCreate((UBaseType_t)size, sizeof(void *));

  if(mbox->mbx == NULL) {

    SYS_STATS_INC(mbox.err);

    return ERR_MEM;

  }

  SYS_STATS_INC_USED(mbox);

  return ERR_OK;

}

 

Interesting is that inside xQueueCreate size is correctly 4 as expected. Compiler is set to size optimization.

 

rum


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

Re: 2.1.0+contrib freertos port

goldsimon@gmx.de
On 03.10.2018 17:30, Rastislav Uhrin wrote:
[..] I have also defined

#define DEFAULT_ACCEPTMBOX_SIZE                     4

#define DEFAULT_UDP_RECVMBOX_SIZE               4

#define DEFAULT_TCP_RECVMBOX_SIZE                4

 

I am getting assert on commented line which checks size of allocated queue because size is 0.


There are other places where sys_mbox_new() is called than the ones using the 3 defines above.
At least TCPIP_MBOX_SIZE and DEFAULT_RAW_RECVMBOX_SIZE should be defined.

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

R: 2.1.0+contrib freertos port

Rastislav Uhrin

Simon,

 

I forgot to mention, of course I defined also

 

#define TCPIP_MBOX_SIZE                                                        16

 

DEFAULT_RAW_RECVMBOX_SIZE is not defined as I am using only sockets and not raw mode (in opt.h)

#define LWIP_RAW                        0

 

Thanks


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

Re: R: 2.1.0+contrib freertos port

goldsimon@gmx.de
On 04.10.2018 19:46, Rastislav Uhrin wrote:
> I forgot to mention, of course I defined also
>
> #define TCPIP_MBOX_SIZE 16
>
> DEFAULT_RAW_RECVMBOX_SIZE is not defined as I am using only sockets
> and not raw mode (in opt.h)
>
> #define LWIP_RAW                        0
>

In that case, I don't think I can help you further. Did you try a debugger?

Simon

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