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

rob_bits
Posts: 16
Joined: Wed Jun 13, 2018 5:15 am

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

Postby rob_bits » Wed Jan 11, 2023 4:25 pm

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 1664 times
Any idea will be welcomed.

Thanks!

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

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

Postby lbernstone » Wed Jan 11, 2023 5:28 pm

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.

rob_bits
Posts: 16
Joined: Wed Jun 13, 2018 5:15 am

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

Postby rob_bits » Thu Jan 12, 2023 7:05 am

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.

rob_bits
Posts: 16
Joined: Wed Jun 13, 2018 5:15 am

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

Postby rob_bits » Thu Jan 12, 2023 12:27 pm

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.

Who is online

Users browsing this forum: Google [Bot] and 69 guests