MBED OS : 6.0
Board: STM32F746G-DISCO discovery board (32F746GDISCOVERY)
When I try to allocate a large memory block on the heap of MBED OS, it fails and malloc return NULL. Even it has sufficient heap space available.
uint8_t *camera_buffer = nullptr;
camera_buffer = (uint8_t *) malloc(57000 );
if(camera_buffer == NULL)
printf(“Memory not allocated.”);
Here is my code Log :
When I try allocate memory using C malloc, it returns NULL.
My Heap size : 89444 / 195312 bytes
allocating memory to file_buffer of 57000.
Memory not allocated.
Current heap Size 89444 + New malloc size is 57000 = 14,6444 (Expected Total memory size), Which less than 19,5312 byte.
Why it failed to allocate memory?
I believe its BUG of MBED OS.