Can I prevent IDF from updating my NVS version?

errantsignal
Posts: 1
Joined: Fri Jun 24, 2022 5:53 pm

Can I prevent IDF from updating my NVS version?

Postby errantsignal » Fri Jun 24, 2022 6:33 pm

Hi all,

We're having a problem where new versions of ESP-IDF appear to be updating our NVS partition to a new version, which is breaking our ability to firmware update devices in the field.

We have some firmware developed on IDF version 3.1.2, that we're working on porting to the latest version, 4.4.1. Our device has two programs on the flash, the main firmware, and a tiny "updater" program that handles firmware updates. Both programs read settings from a shared NVS partition.

When I flash our new main firmware compiled with the latest IDF version, it seems to do something to the NVS partition that makes it completely unreadable by our updater program - it reports ESP_ERR_NVS_NEW_VERSION_FOUND.

Presumably if we recompiled the updater program with the latest IDF version as well, this problem would go away. However, we have no way of updating the updater program on devices already in the field without risking bricking the device if the power goes out or something during the update - the whole point of the updater was that it would always be there in the event that the main firmware was damaged during an update. Essentially, once our device gets a firmware update to a v4.4.1 build, we lose our ability to firmware-update the device again, because the updater program will crash when it tries to read the NVS partition.

So, I'm trying to figure out how to get the NVS library to stop updating the NVS partition and use it as-is.

Some digging has suggested to me that this problem has something to do with the CONFIG_MP_BLOB_SUPPORT option that used to be available under v3.1, which was *disabled* by default. I understand that it is now not only *enabled* by default, but the option to disable it has been removed. It would seem that a library compiled without MP blob support cannot read a partition created by one compiled with MP blob support. But, I don't know what I can do about this; there doesn't seem to be any setting or function call that would prevent the firmware from updating a "mp-blob-unsupported" NVS partition to an "mp-blob-supported partition". It's unclear to me why the ability to disable MP-BLOB support was dropped.

I'm considering trying to "override" the NVS component in the new IDF version with the version of the library included with the old IDF version, but I don't know if that will work or cause other problems.

Has anyone else run into this who might have some advice on how to deal with this?

Who is online

Users browsing this forum: pmoneta and 145 guests