Hi Simon,
Thanks for you Reply!
We are working on designing Low power Wireless SoC. We have few restrictions concerning the memory usage.
Our memory system is divided in:
- Instructions memory
- Data memory
- Frame memory
Incoming and Outgoing frames should be saved in frame memory. However LwIP uses the data memory to create the pools and process incoming frames using PBUF_POOL pools created by LWIP_PBUF_MEMPOOL() and outgoing frames using PBUF_RAM pools created by LWIP_MALLOC_MEMPOOL(). In this case I have to copy the incoming frames from frame memory to data memory (by allocating pbuf of type PBUF_POOL) and I have to copy the outgoing frames from data memory (pbuf of type PBUF_RAM) to frame memory.
My goal is to avoid:
- Wasting the data memory by LwIP memory Pools (especially the pools of type PBUF_POOL used for incoming frames and the pools of type PBUF_RAM used for Outgoing frames)
- Copying from data memory to frame memory and vice versa which consumes power and time
That's why I am using the PBUF_ROM with payload pointer pointing to the actual data in the frame memory. What I know is PBUF_ROM doesn't mean the actual ROM (stable for very long) but it means that the data is immutable and it is located in memory which is not managed by the pbuf system. Am I wrong? Do you have another Solution?
Concerning the issue listed in the previous email, you suggested to "create a new ROM pbuf referencing the same data, which would prevent copying", so I have to add some instructions inside the LwIP code, right?
Regards,
Amena