If it were me, I would also try changing the put as well.
Code:
state ping() {
Serial.println("pong");
testWord = USBSERIAL.parameter(0);
EEPROM.put(0,testWord);
}
That is the underlying system will see you passed in a pointer to string and maybe decide it is 4 bytes long...
When I was debugging some of the EEPROM stuff on T4 and T4.1 beta, I did a sketch that dumped out the EEPROM data, but the values and actual underlying data...
Also I would probably add in a little debug code to get an idea of what was really written... What I think was written was the address of your variable...
So again if it were me, I would first try simple test to see what was really output to EEPROM. Like:
Code:
state ping() {
Serial.println("pong");
testWord = USBSERIAL.parameter(0);
EEPROM.put(0,testWord);
// Output debug information.
Serial.println(testWord);
Serial.println((uint32_t)&testWord, HEX);
#define eeprom_size 64 // not the actual real size, but limit to only 64 bytes to start.
for (uint16_t i = 0; i < eeprom_size; i++) {
Serial.printf("%x:%x ", i, EEPROM.read(i));
if ((i & 0xf) == 0xf) Serial.println();
}
}
And if desired you could also output the ascii with the above prints, something like:
Code:
for (uint16_t i = 0; i < eeprom_size; i++) {
uint8_t ch = EEPROM.read(i);
Serial.printf("%x:%x ", i, (ch >= ' ' && ch <= '~')? ch : '.', ch);
if ((i & 0xf) == 0xf) Serial.println();
}
Again typed in on fly but should be reasonably close...
And again I think it will show the actual data written is not what you think it is...