Skip to content

Settings in NVM EEPROM and config.h

Eric Stockenstrom edited this page Nov 25, 2021 · 7 revisions

When a new board is booted for the first time after flashing the firmware, parameters and other settings configured by the user in config.h are saved into the non-volatile-memory (NVM / EEPROM) of the Mav2PT translator, and persist after rebooting.

Similarly (from version 2.67.6), if the firmware version does not match the NVM settings version, settings configured by the user in config.h are saved into the NVM of the Mav2PT translator, and persist after rebooting.

Board variants without WiFi capability, like the Teensy 3.2 or RP2040, simply use the default settings defined in config.h

Board variants with WiFi capability, like those with ESP32 or ESP8266 MCUs, support a web interface. The web interface allows for the real-time management and change of general settings in non-volatile memory. Any changes take effect immediately (after an automatic reboot) on close of the web interface. Again, the settings persist after being changed. Unless the version designation of the firmware has been changed, changes made to settings in config.h, even after compiling and re-flashing, will not reflect in non-volatile memory of previously used boards with web support enabled! The existing NVM settings will prevail.

Should the user require the NVM settings to be refreshed under these circumstances, after bootup hold the pin designated resetEepromPin HIGH (3.3V) for 10 seconds, the refresh will take place and the board will reboot. The resetEepromPin is defined for your board variant in config.h. (Do not jumper the resetEepromPin permanently high, or the NVM will be reset every 10 seconds).

Another, but somewhat tedious, alternative is to temporarily enable the following setting, near the top of config.h:

#define Reset_EEPROM // Reset EEPROM settings to config.h

Compile, flash and run to reset the NVM, then deactivate (comment out) the setting, compile, and flash again, otherwise the EEPROM settings will be re-written on every boot and cause unnecessary ageing of the EEPROM.