最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c - LWIP relocate a custom malloc mempool - Stack Overflow

programmeradmin1浏览0评论

I have defined the following in lwipopts.h:

#define MEM_USE_POOLS 1
#define MEMP_USE_CUSTOM_POOLS 1
#define MEMP_NUM_PBUF DRV_ETH_LWIP_BUF_TX_NUM
#define MEMP_NUM_TCP_SEG TCP_SND_QUEUELEN

In lwippools.h I have:

/// @file lwippools.h
/// 

/// Define three pools with sizes 256, 512, and DRV_ETH_LWIP_BUF_RX_SIZE bytes
LWIP_MALLOC_MEMPOOL_START
LWIP_MALLOC_MEMPOOL(35, 256)
LWIP_MALLOC_MEMPOOL(30, 512)
LWIP_MALLOC_MEMPOOL(9, DRV_ETH_LWIP_BUF_RX_SIZE)
LWIP_MALLOC_MEMPOOL_END

/*
/// Enable below if sys arch uses memory pools
LWIP_MEMPOOL(SYS_MBOX, 22, sizeof(struct sys_mbox_struct), "SYS_MBOX")
LWIP_MEMPOOL(SYS_SEM, 12, sizeof(struct sys_sem_struct), "SYS_SEM")
*/

How can I relocate the MALLOC pool into my custom section .eth_lwip_heap_section? I need to do so for DMA reasons.

I tried to use __attribute__((section(".eth_lwip_heap_section"))) extern u8_t memp_memory_MALLOC_base[]; but it doesn't work. There must be a different way to do it with the malloc pool. Simply defining LWIP_RAM_HEAP_POINTER does not work either.

I am also unsure if I need a custom PBUF pool too if I have the malloc pool.

发布评论

评论列表(0)

  1. 暂无评论