Query on the ESP32's internal DRAM
Posted: Tue Dec 15, 2020 9:44 am
Hi,
I've compiled a firmware and had it run on multiple devices without any sort of issue, but have found 1 which was stuck in a continuous reset loop.
On further investigation the cause was found. When a particular task was created using the xTaskCreatePinnedToCore() function, an error code of -1 would be returned. The firmware is designed to reset whenever a task cannot be created, assuming that something went wrong during program execution.
I've run heap_caps_get_largest_free_block(MALLOC_CAP_8BIT|MALLOC_CAP_INTERNAL) to find out how much contiguous internal DRAM I have available for stack allocation and have found it to be low. Reducing the stack depth of the task the RTOS is attempting to create solves the reset issue.
What's puzzling me is why this happened on a single device, but not on the rest. I've had 3 other devices undergoing extensive testing and none gave any hint of such an issue. Is there something I'm missing, such as perhaps variances in the order of a few kB in the available internal DRAM between one ESP32 and another?
I've compiled a firmware and had it run on multiple devices without any sort of issue, but have found 1 which was stuck in a continuous reset loop.
On further investigation the cause was found. When a particular task was created using the xTaskCreatePinnedToCore() function, an error code of -1 would be returned. The firmware is designed to reset whenever a task cannot be created, assuming that something went wrong during program execution.
I've run heap_caps_get_largest_free_block(MALLOC_CAP_8BIT|MALLOC_CAP_INTERNAL) to find out how much contiguous internal DRAM I have available for stack allocation and have found it to be low. Reducing the stack depth of the task the RTOS is attempting to create solves the reset issue.
What's puzzling me is why this happened on a single device, but not on the rest. I've had 3 other devices undergoing extensive testing and none gave any hint of such an issue. Is there something I'm missing, such as perhaps variances in the order of a few kB in the available internal DRAM between one ESP32 and another?