Page 1 of 1

Calling SPIFFS.begin(true) -> esp_vfs_spiffs_register returns with ESP_ERR_NO_MEM

Posted: Wed Jan 11, 2023 4:25 pm
by rob_bits
I have a complex firmware with lot of functionality for a unique design board withESP32-WROVER-IE-N16R8. Now as I merge different functions together I ran into issue with SPIFFS.

Especially calling SPIFFS.begin(true) funtion, it returns with ESP_ERR_NO_MEM. Previously it was working well with webserver + ethernet but now when I am using webserver + wifi + spi I ran into this issue.

What can be the issue? How can allocate more memory for that?

When building the code I have this memory usage:
kép_2023-01-11_172204298.png
kép_2023-01-11_172204298.png (4.06 KiB) Viewed 1663 times
Any idea will be welcomed.

Thanks!

Re: Calling SPIFFS.begin(true) -> esp_vfs_spiffs_register returns with ESP_ERR_NO_MEM

Posted: Wed Jan 11, 2023 5:28 pm
by lbernstone
SPIFFS.begin is a bool, it returns true or false. What do you mean by this?
If you are getting out of memory messages, those are about active RAM, not firmware space. Use ESP.getFreeHeap() or heap_caps_get_free_size() to find out how much memory is available.

Re: Calling SPIFFS.begin(true) -> esp_vfs_spiffs_register returns with ESP_ERR_NO_MEM

Posted: Thu Jan 12, 2023 7:05 am
by rob_bits
Thanks for the suggestion! I will definitely try this out.
Yes, you are right. SPIFFS.begin returns bool. The esp_vfs_spiffs_register() function returns with the error and SPIFFS.begin just prints the error before it returns.

Re: Calling SPIFFS.begin(true) -> esp_vfs_spiffs_register returns with ESP_ERR_NO_MEM

Posted: Thu Jan 12, 2023 12:27 pm
by rob_bits
The heap was running out... There was a dummy 32kB static allocation in my code that consumed too much memory. After removing that dummy array from the code the webserver + wifi + spi are wokring well.