On 14.03.2018 16:42, Giuseppe Modugno wrote:
I was experimenting with lwip memory allocator. I defined:

#define MEM_LIBC_MALLOC  0
#define MEM_USE_POOLS      0
#define MEM_SIZE  (32 * 1024)
#define LWIP_RAM_HEAP_POINTER  ( (void *)0x2007C000 )

I'm using LPC1768 that has a 32kB SRAM block starting from address
0x2007C000. However I have a Hard Fault error during mem_init(), because
ram_end is initialized to 0x2007C000 + (32*1024), that is over the
available memory.

So MEM_SIZE should be smaller than available heap memory.

Is that a question? Or an action request? To my understanding, the comment above #ifndef LWIP_RAM_HEAP_POINTER in mem.c clearly states that enough memory is required. It does NOT say that amount is MEM_SIZE. If you want, create a patch with a better documentation and we could apply it.

Simon

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

Reply via email to