task creation results in errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY

hacksome
Posts: 14
Joined: Sat Apr 13, 2019 8:23 am

task creation results in errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY

Postby hacksome » Mon Apr 29, 2019 5:34 am

Hi all

Could do with a bit of help here please. I am using the esp32-solo-1 module (single core)

I have run into an issue. esp_get_free_heap_size() printout shows 20K of free heap when I start a task of 8K

return_status = xTaskCreatePinnedToCore( &the_task, "reader_task", STACK_SIZE_8192, NULL, DEFAULT_TASK_PRIORITY, NULL, 0 );
if( return_status != pdPASS ) {
ESP_LOGE( TAG, "Failed to create the_task Task: %d", return_status );
esp_restart();
}

Can you help me figure out what I have done wrong?

The result of make size is

Total sizes:
DRAM .data size: 10868 bytes
DRAM .bss size: 103232 bytes
Used static DRAM: 114100 bytes ( 66636 available, 63.1% used)
Used static IRAM: 65053 bytes ( 66019 available, 49.6% used)
Flash code: 617184 bytes
Flash rodata: 157096 bytes
Total image size:~ 850201 bytes (.bin may be padded larger)

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: task creation results in errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY

Postby WiFive » Mon Apr 29, 2019 6:41 am

heap_caps_get_largest_free_block

hacksome
Posts: 14
Joined: Sat Apr 13, 2019 8:23 am

Re: task creation results in errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY

Postby hacksome » Mon Apr 29, 2019 10:22 am

Thank you very much. We fixed it by reducing ram usage.

Who is online

Users browsing this forum: Bing [Bot] and 147 guests