Idea: Using unused OTA partition for data storage?

illumenaughty_420
Posts: 1
Joined: Tue Apr 01, 2025 5:38 am

Idea: Using unused OTA partition for data storage?

Postby illumenaughty_420 » Tue Apr 01, 2025 5:52 am

<t>Hi <br/>
Im very new to this forum so apologies if i made any mistakes.<br/>
<br/>
I have a large project that uses ESP32-Wroom32 with 4MB flash. the devices im working on are largely kept in isolated locations. They are internet connected. These devices use an SD card for logging and recently we observed that the SD cards have been failing and logging isnt working. these logs are used for improving the firmware. Since we cannot go and replace thousands of SD cards, we thought of an idea: to use the unused OTA partition. <br/>
We are using the min_spiffs partition <br/>
<br/>
# Name, Type, SubType, Offset, Size, Flags<br/>
nvs, data, nvs, 0x9000, 0x5000,<br/>
otadata, data, ota, 0xe000, 0x2000,<br/>
app0, app, ota_0, 0x10000, 0x1E0000,<br/>
app1, app, ota_1, 0x1F0000,0x1E0000,<br/>
spiffs, data, spiffs, 0x3D0000,0x20000,<br/>
coredump, data, coredump,0x3F0000,0x10000,<br/>
<br/>
as you can see SPIFFS is very limited and my program size is about 1.89 MB (using BLE and WiFi). since at any time, app0/app1 is used by the bootloader to load the program, i thought i could use the remaining 1.9Mb for logging and when i do an OTA update, itll format this space and then do the OTA update, switch the flag in bootloader and then format the other partition for logging. <br/>
<br/>
has this been done before? am i walking into any potential hazards by doing this? Ive gotten it working somewhat but before we go ahead and think about deploying and spending time fixing the bugs, i wanted to know if this is even a good idea to implement? or is there any other way i can go about this. <br/>
<br/>
thanks so much in advance</t>

Who is online

Users browsing this forum: No registered users and 3 guests