EEPROM on ESP8266 doesn't EEPROM.commit();

I'v been stuck on this for days now and reached the point where I ordered new modules while I get on the forums. I'm trying to use EEPROM on the ESP8266 to store the info that i might change once i close my project up but am having problems committing the data to EEPROM for recovery during a power cycle. The code runs on an Arduino uno clone but once i try running it on the ESP when I power cycle, i get a stack dump. I vaguely get that the ESP doesn't have EEPROM built in but is simulated. the code that I'm including is using the ESP_EEPROM.h lib since just using the standard EEPROM.h lib didn't highlight "commit" in orange which I found suspect.

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <WiFiUdp.h>
#include <ESP_EEPROM.h>

  String ssid = "";
  String pass = "";  
  String city = "";
  String country = "";
  int actionCode = 0;
void setup() {
  EEPROM.begin(512);
  Serial.begin(9600);
  Serial.println();
  Serial.println("Start!");
  while(!Serial.available());
  actionCode = Serial.parseInt();
 
  if(actionCode == 100){
    enterWifiStuff();
  }

  int wifiLen = EEPROM.read(0);
  char wifiGet[wifiLen];
  for(int i = 0; i < wifiLen; i++){
    wifiGet[i] =char(EEPROM.read(i + 1));
  }
  Serial.print(wifiGet);
  parseCharArray(wifiGet);
  Serial.println();
  Serial.print("ssid: ");
  Serial.println(ssid);
  Serial.print("password: ");
  Serial.println(pass);
  Serial.print("city: ");
  Serial.println(city);
  Serial.print("country: ");
  Serial.println(country);
  Serial.println("");

  WiFi.begin(ssid,pass);
  Serial.print("connecting");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("WiFi Connected");
  printWiFiStatus();

  Serial.print("xxCONECTEDxx");

  actionCode = 0;
}
void loop(){
  
  int actionCode = Serial.parseInt();
  if(actionCode == 100){
    Serial.print("xxCONECTEDxx");
  }
  
  
  }

  void printWiFiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}


void parseCharArray(char string[]){
  
  int count1 = 0;
  int count2 = 0;
  int startWord = 0;
    while(count1 < 4){
    if(string[count2] == 'x' && string[count2 + 1] == 'x'){
      count2 += 2;
      count1++;
      startWord = count2;
    }
    else{
      if(count1 == 0){
        ssid += string[count2];
      }
      else{
        if(count1 == 1){
        pass += string[count2];
        }
        else{
          if(count1 == 2){
            city += string[count2];
          }
          else{
            country += string[count2];
          }
        }
      }
      count2++;
    }
  }
}




void enterWifiStuff(){
      Serial.println();
    delay(1000);
    while(Serial. read() >= 0) ; 
    Serial.print("SSID: ");
    while(!Serial.available()){}
    String ssid = Serial.readString();
    int lens = ssid.length();
    Serial.print(lens);
    Serial.println(ssid);
    
    Serial.print("Password: ");
    while(!Serial.available()){}
    String pass = Serial.readString();
    Serial.println(pass);
    
    Serial.print("City: ");
    while(!Serial.available()){}
    String city = Serial.readString();
    Serial.println(city);
    
    Serial.print("Country code: ");
    while(!Serial.available()){}
    String country = Serial.readString();
    Serial.println(country);
    
    String msg = ssid + 'x' + 'x' + pass + 'x' + 'x' + city + 'x' + 'x' + country + 'x' + 'x';
    ssid = "";
    pass = "";
    city = "";
    country = "";
    int len = msg.length();
    Serial.println(len);
    Serial.print("THIS IS MY DUMP");
    Serial.println(msg);
    int wifiLen = msg.length() + 1;
    char wifiPut[wifiLen];
    msg.toCharArray(wifiPut, wifiLen);
    EEPROM.write(0, wifiLen);
    for(int i = 0; i < wifiLen; i++){
      EEPROM.write(i + 1, wifiPut[i]);
    }
    boolean ok = EEPROM.commit();
    Serial.println((ok) ? "Commit OK" : "Commit failed");

}

this is the serial output

Start!

SSID: 5funny
Password: stuff
City: in
Country code: us
22
THIS IS MY DUMPfunnyxxstuffxxinxxusxx
Commit failed      //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<this line
funnyxxstuffxxinxxusxx
ssid: funny
password: stuff
city: in
country: us

connecting........0⸮~⸮4⸮!⸮⸮⸮⸮OAqr⸮⸮
Start!
⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮?⸮⸮⸮?
Exception (3):
epc1=0x40201134 epc2=0x00000000 epc3=0x00000000 excvaddr=0x40000000 depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffffdc0 end: 3fffffc0 offset: 01a0
3fffff60:  00000000 3fffff80 3ffee438 3fffff80  
3fffff70:  00000000 3fffff80 3ffee438 40201458  
3fffff80:  feefeffe feefeffe feefeffe feefeffe  
3fffff90:  feefeffe feefeffe feefeffe 3ffee4b0  
3fffffa0:  3fffdad0 00000000 3ffee470 40203034  
3fffffb0:  feefeffe feefeffe 3ffe84e8 40100be1  
<<<stack<<<
bBʦ⸮!⸮⸮1⸮1⸮⸮
Start!

I snagged a bit of code from the ESP_EEPROM.h examples. i tried running those as well and it gives me the same result of "commit failed".

just to be clear, the first time the code is run I enter 100 to get to the input portion. the second time after the power cycle i enter 200 (or any number other than 100) to skip the input. this is when it reads garbage from EEPROM.

i don't see an EEPROM.commit() in your code. It needs to be done after one or more .writes()

it's there in the enterWifiStuff() function at the bottom, it's the last thing in the sketch really

boolean ok = EEPROM.commit();
    Serial.println((ok) ? "Commit OK" : "Commit failed");

I snagged a bit of code from the ESP_EEPROM.h examples. i tried running those as well and it gives me the same result of "commit failed".

Your first order of business is to get the basic library examples working. If you can not, then its no used placing it in your code.

the code that I'm including is using the ESP_EEPROM.h lib since just using the standard EEPROM.h lib didn't highlight "commit" in orange which I found suspect.

keyword highlighting is not a good indicator of anything. My advice would be to work with the standard EEPROM.h library.

so i tried the example for EEPROM under the generic ESP8266 drop down (see attached) and it still says it fails.

/*
   EEPROM Write

   Stores values read from analog input 0 into the EEPROM.
   These values will stay in the EEPROM when the board is
   turned off and may be retrieved later by another sketch.
*/

#include <EEPROM.h>

// the current address in the EEPROM (i.e. which byte
// we're going to write to next)
int addr = 0;

void setup() {
  Serial.begin(115200);
  EEPROM.begin(512);
}

void loop() {
  // need to divide by 4 because analog inputs range from
  // 0 to 1023 and each byte of the EEPROM can only hold a
  // value from 0 to 255.
  int val = analogRead(A0) / 4;

  // write the value to the appropriate byte of the EEPROM.
  // these values will remain there when the board is
  // turned off.
  EEPROM.write(addr, val);

  // advance to the next address.  there are 512 bytes in
  // the EEPROM, so go back to 0 when we hit 512.
  // save all changes to the flash.
  addr = addr + 1;
  if (addr == 512) {
    addr = 0;
    if (EEPROM.commit()) {
      Serial.println("EEPROM successfully committed");
    } else {
      Serial.println("ERROR! EEPROM commit failed");
    }
  }

  delay(100);
}

now what, because i'm lost on this. I've seen other examples on the web where this seems to work. is my module just bad or what?

I have a Wemos D1 and the sketch runs properly when compiled for and loaded on that module.

When I try to compile and upload the code for a "generic" esp8266 it won't load, so I can't test under your conditions.

I can't really help you further.

yup, just playing with the settings for the board right now but it doesn't look good, i think i need another module. i sware the chip says esp8265, it's just so small P(