Unable to allocate memory in DRAM
Posted: Wed Apr 05, 2017 5:58 pm
I've recently updated our project to the latest SDK in master as of April 3rd. Since then, the project consistently crashes on calls to malloc(). The issue seems to be that no memory is free to be allocated, and I noticed I now have a few more heap regions listed on boot.
The first region with 0KiB available is what I assume is causing the failure. Calling pvPortMallocTagged(size, 1), to allocate inside D/IRAM seems fine (but I later get crashes in system functions like snprintf, which I assume rely on standard malloc).
I've looked through the configuration options and can't see anything obvious that would affect heap initialization. I was also under the impression that if a region has 0KB available, it should check the next region with the same tag. Is this a bug or an error on my part?
Thanks
Code: Select all
I (0) cpu_start: App cpu up.
I (1632) heap_alloc_caps: Initializing. RAM available for dynamic allocation:
I (1655) heap_alloc_caps: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (1675) heap_alloc_caps: At 3FFC8028 len 00017FD8 (95 KiB): DRAM
I (1696) heap_alloc_caps: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (1717) heap_alloc_caps: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1739) heap_alloc_caps: At 4009B924 len 000046DC (17 KiB): IRAM
I (1760) cpu_start: Pro cpu start user code
I (1822) cpu_start: Starting scheduler on PRO CPU.
I (211) cpu_start: Starting scheduler on APP CPU.
I've looked through the configuration options and can't see anything obvious that would affect heap initialization. I was also under the impression that if a region has 0KB available, it should check the next region with the same tag. Is this a bug or an error on my part?
Thanks