EEPROM functions not working with Adafruit metro m4

I am trying to work on an Arduino project and for some reason, I cannot get it to store the data on the Adafruit metro m4 controller or data logger shield (saving so that when reconnected the data entered would still be there). I have an SD card for the TFT LCD, I would appreciate any help, not sure what I'm missing. Thank you!

Here is basically what I have so far related to EEPROM functions and it seems to compile without errors but does not work for EEPROM. If I run it on a different board (Arduino Uno) it seems to activate but then the issue is that the code is intended to run only on SAMD21 or SAMD51 boards. Is there a way to adapt the EEPROM functions for the metro m4 or if any changes can be made to get it functional? Please let me know if any questions, appreciate any and all help!

for example:

void readAllConfiguration() {
  readLogs();
  AveragePeriodDuration = EEPROM.read(ADDR_AVERAGE_DAYS);
  LogId = EEPROM.read(ADDR_LOGGED_COUNT);
  Serial.print("Lod ID mem: ");
  Serial.println(LogId);
  if(LogId > 100)
    LogId = 0;
  if(AveragePeriodDuration > 100)
    AveragePeriodDuration = 28;
}

It's possible that the problem comes from the chip used on the Adafruit Metro M4 not having any EEPROM.

If you want EEPROM you could add an external EEPROM chip.

As SAMD has no EEPROM, to simulate EEPROM using flash, you can use my library

Just be sure to read

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.