I'm finding my app occasionally rebooting while writing to NVS storage. The backtrace doesn't immediately reveal anything obvious that I'm doing wrong.
Code: Select all
0x4009682f:0x3ffb8b00 esp_clear_watchpoint
0x40096987:0x3ffb8b20 esp_clear_watchpoint
0x4010cc66:0x3ffb8b40 esp_ota_get_boot_partition
0x400efa3c:0x3ffb8b60 is_safe_write_address
0x40084b16:0x3ffb8b80 spi_flash_write
0x401d6703:0x3ffb8be0 Page::findItem
0x401d673d:0x3ffb8c10 Page::findItem
0x401d6a5a:0x3ffb8c30 Page::findItem
0x401d5b16:0x3ffb8ca0 nvs_get_used_entry_count
0x401d57fe:0x3ffb8d00 nvs_set_str
You have to read it from bottom to top. It looks like it's crashing while getting the current boot partition. I guess it's trying to make sure you don't write to the boot partition. If it's a stack overflow issue I usually see something that indicates that. Plus after 12 hours of run time the task calling the NVS write indicates a stack high water mark of 1K. And it writes this particular value (a float in string) to NVS every 10 minutes. I'm thinking of preventing the write if the value doesn't change much (it's the current temperature). But the counterpoint is if writing to NVS can occasionally crash the app I should investigate why.
Obviously I haven't given you any code to read. And I doubt it would help because it's a big application. But I'm throwing it out for ideas in case this rings a bell with anyone or they've seen the issue too. I'm not really confident that I haven't caused this somehow as it seems to just have popped up recently.