[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 

menuMgr.load() Crash RSS feed
Forum Index » tcMenu Arduinio library
Author Message
Lee_X


Joined: Apr 29, 2022
Messages: 22
Offline
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!
davetcc


Joined: Jan 19, 2019
Messages: 628
Offline
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.
Lee_X


Joined: Apr 29, 2022
Messages: 22
Offline
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?
Lee_X


Joined: Apr 29, 2022
Messages: 22
Offline
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
davetcc


Joined: Jan 19, 2019
Messages: 628
Offline
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.
Lee_X


Joined: Apr 29, 2022
Messages: 22
Offline
thanks!
 
Forum Index » tcMenu Arduinio library
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.