Register / Login  |  Desktop view  |  Jump to bottom of page

tcMenu Arduinio library » menuMgr.load() Crash

Author: Lee_X
02/05/2022 10:24:14
Hi, I would like to save the menu across boots but it's not working. I'm saving it with

menuMgr.save(); or menuMgr.save(0xd00d);

and then loading it with either

menuMgr.load(); or menuMgr.load(0xd00d);


but as soon as I try to load, it crashes and it goes in a boot loop. According to the nokia5110 example this should be the correct way to same/load the menu?

I'm using ESP32-S2

Please let me know thanks!

Author: davetcc
03/05/2022 08:14:39
Have you set the EEPROM abstraction up somewhere? Either from the code generator settings in designer or at the top of your sketch before calling load?

https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/menu-eeprom-integrations/

Please could you provide an isolated sketch that re-creates this issue, along with the version of tcMenu, IoAbstraction, TaskManagerIO and SimpleCollections libraries that are installed?

The best way to get version info is from Help / Diagnostics menu in the designer.

Author: Lee_X
05/05/2022 14:20:20
Hi Dave,

On ESP32-S2 I get this during compilation

'AvrEeprom' does not name a type; did you mean 'NoEeprom'?

Is AVR mode supposed to work with ESP32-S2?

Author: Lee_X
05/05/2022 14:38:25
tried the 3rd option in the designer and this is my setup:

EEPROM.begin(EEPROM_SIZE);
  
  setupMenu();
  menuMgr.setEepromRef(menuMgr.getEepromAbstraction());
  menuMgr.load(0xfade);


the save is done when I change one BooleanMenuItem

void CALLBACK_FUNCTION onBoolChanged(int id) {
    Serial.println("onBoolChanged");
    menuMgr.save(0xfade);
    EEPROM.commit();
}


Seems to work for now. Let me know if I'm using it incorrectly

Author: davetcc
06/05/2022 08:45:02
Nothing actually wrong. But you should be able to drop this line, you could try commenting out and should still run:

menuMgr.setEepromRef(menuMgr.getEepromAbstraction())


Reason: it shouldn't be needed, it will already have been set within setupMenu(). You just need to make sure that any EEPROM usage is after setupMenu() is called as it's not initialized before that.

Author: Lee_X
06/05/2022 08:46:05
thanks!




Register / Login  |  Desktop view  |  Jump to top of page