MEM_USE_POOLS issue

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

MEM_USE_POOLS issue

mtimm
Hello,
I have just successfully accomplished my first try with LwIP stack (v.
2.1.2). This was simple app using UDP and dynamic allocation (PBUF_RAM).
Now I would like to switch into static allocation (PBUF_POOL).

According to instructions I found on wiki page
(https://lwip.fandom.com/wiki/Custom_memory_pools) I have
defined MEM_USE_POOLSand MEMP_USE_CUSTOM_POOLS both as 1.
I also add lwippools.h and you can see it in the picture below.

My compiler stucked inside memp_priv.h. I am not sure if that file should be
in my project but it is included in memp_std.h (details in the image below).

lwip_pools_issue.png
<http://lwip.100.n7.nabble.com/file/t2311/lwip_pools_issue.png>  

Could you help me, please?




--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

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

Re: MEM_USE_POOLS issue

goldsimon@gmx.de
Am 05.11.2019 um 08:59 schrieb mtimm:

> Hello,
> I have just successfully accomplished my first try with LwIP stack (v.
> 2.1.2). This was simple app using UDP and dynamic allocation (PBUF_RAM).
> Now I would like to switch into static allocation (PBUF_POOL).
>
> According to instructions I found on wiki page
> (https://lwip.fandom.com/wiki/Custom_memory_pools) I have
> defined MEM_USE_POOLSand MEMP_USE_CUSTOM_POOLS both as 1.
> I also add lwippools.h and you can see it in the picture below.
>
> My compiler stucked inside memp_priv.h. I am not sure if that file should be
> in my project but it is included in memp_std.h (details in the image below).

What exactly do you mean by "compiler is stucked"?

>
> lwip_pools_issue.png
> <http://lwip.100.n7.nabble.com/file/t2311/lwip_pools_issue.png>
>
> Could you help me, please?

For me it works. Without knowing the compiler output, how could I say more?

Regards,
Simon

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

Re: MEM_USE_POOLS issue

mtimm
Simon,

It looks like it stucked inside memp_priv.h inside typedef
memp_pool_helper_t declaration. It is something wrong with the syntax. I am
not sure how memp_priv.h and memp_std.h work and it is hard for me to
eliminate this issue.
I would like to work with static allocation which is available by using
pools. Do I need both (memp_priv.h and memp_std.h) files including in my
project?
lwip_pools_issue_2.png
<http://lwip.100.n7.nabble.com/file/t2311/lwip_pools_issue_2.png>  



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

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

Re: MEM_USE_POOLS issue

goldsimon@gmx.de

"mtimm" <[hidden email]> wrote:
> It looks like it stucked inside memp_priv.h inside typedef
> memp_pool_helper_t declaration. It is something wrong with the syntax. I am
> not sure how memp_priv.h and memp_std.h work and it is hard for me to
> eliminate this issue.
> I would like to work with static allocation which is available by using
> pools. Do I need both (memp_priv.h and memp_std.h) files including in my
> project?

No. The error is in your lwippools.h: you need to remove the include guards.
This file gets included multiple times with different defines set.

See our example here:
http://git.savannah.nongnu.org/cgit/lwip.git/tree/contrib/examples/example_app/lwippools.h

Regards,
Simon

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

Re: MEM_USE_POOLS issue

mtimm
Simon,
Thank you. It works better ;)
One more question about purpose of using custom pools.
LwIP uses few internal pools like PBUF_POOL_base, TCP_PCB_BASE,
UDP_PCB_BASE.
What can be the reason of using additional custom pools? Is it about
preparing memory for copying data from PBUF_POOL_base for application tasks?
Could you give some example, please?



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

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

Re: MEM_USE_POOLS issue

goldsimon@gmx.de


Am 7. November 2019 08:54:25 MEZ schrieb mtimm <[hidden email]>:
>Simon,
>Thank you. It works better ;)
>One more question about purpose of using custom pools.
>LwIP uses few internal pools like PBUF_POOL_base, TCP_PCB_BASE,
>UDP_PCB_BASE.
>What can be the reason of using additional custom pools? Is it about
>preparing memory for copying data from PBUF_POOL_base for application
>tasks?
>Could you give some example, please?

That was the old way of defining custom pools for application code mainly.

Regards,
Simon

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