calloc fails even when free heap is large enough
Posted: Thu May 09, 2019 12:21 pm
On a ESP-CAM module with external RAM this allocation fails
p= calloc(80, 240);
This smaller request works ok:
p= calloc(60, 240);
But these functions report that there's sufficient heap space available:
xPortGetFreeHeapSize(): 3456208
heap_caps_get_largest_free_block(MALLOC_CAP_8BIT): 3426256
Why does calloc fail even when there's enough RAM available?
Is there a workaround available?
I am using: ESP-IDF v3.3-beta2-18-g0f927791b-dirty
p= calloc(80, 240);
This smaller request works ok:
p= calloc(60, 240);
But these functions report that there's sufficient heap space available:
xPortGetFreeHeapSize(): 3456208
heap_caps_get_largest_free_block(MALLOC_CAP_8BIT): 3426256
Why does calloc fail even when there's enough RAM available?
Is there a workaround available?
I am using: ESP-IDF v3.3-beta2-18-g0f927791b-dirty