NVS erased after OTA

m.couvet
Posts: 2
Joined: Fri Oct 27, 2023 1:33 pm

NVS erased after OTA

Postby m.couvet » Fri Oct 27, 2023 1:40 pm

Hi, I'm working on a project with esp32 esp-idf framework which use encrypted NVS features and firmwares encryption features. It's been one year i worked on this project and this week a realy weird problemes happend, while doing an OTA from on firmware to another, all the NVS partition of the ESP had been wiped, thus the device is unable to load it's parametter.. Fortunately i'm still in encryption dev mode, i can keep flashing firmware / NVS partition, but the goal is to send the device on site and being sure this will not happen again. So far i've checked the code, the partition table, and no clue about what can produce the compelte deletion of NVSs partitions on this OTA. If you have been in this kind of situation, have some clue about what happened, please help me understand ... Any flags that reset the NVS at boot ? ...

mzincali
Posts: 46
Joined: Wed Jun 08, 2022 7:23 am

Re: NVS erased after OTA

Postby mzincali » Mon Oct 30, 2023 8:29 am

Is it possible that the size of your firmware changed, and it is overwriting your old NVS?

m.couvet
Posts: 2
Joined: Fri Oct 27, 2023 1:33 pm

Re: NVS erased after OTA

Postby m.couvet » Mon Oct 30, 2023 9:18 am

Nope, both firmwares are the same size (1 970 176Mo), i was wondering if the build process is looking at both nvs.csv file which helps generating the partition. From one firmware to another, one of the partition have a line updated frome "foo:"http"" -> "foo:"https[...]"". Even if this file isn't part of the firmware, if it's taken in account during the build process may be this can leads to an variation of the NVS size ? But the NVS is modified inside the esp32 while it's living (updating some configuraiton parameter etc) so that's realy weird if it is what happend. So i'll test that n the day, but i'm not convinced about that.

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

Re: NVS erased after OTA

Postby mbratch » Mon Oct 30, 2023 12:48 pm

Are you able to reproduce this scenario?

martins
Posts: 51
Joined: Tue Aug 24, 2021 8:58 am

Re: NVS erased after OTA

Postby martins » Mon Oct 30, 2023 1:08 pm

Reminds me of situation that happened to me - debug firmware build with virtual efuses (therefore no physical encryption) was OTA uploaded to fully secured device with HW efuses, secure boot and encryprions. NVS was rendered unreadable and if using example NVS init procedures it would be wiped by default.

Who is online

Users browsing this forum: Baidu [Spider] and 77 guests