Any progress on EEPROM Writes?
...
that would be - negative. This is as far I've gotten 'in a very not specific hand wavy sort of way' - maybe there is a better solution?::
> throttle down the clocks - go to runmode=0 normal
> perform the EEPROM writes
> {optional} RESTART { or } repeat what PJRC does in mk20dx128.c to: Set runmode=3 HSRUN again, restore/bring up the needed clocks.
In the process any in progress I/O or bus work will be messed up, and the buses themselves may need restarted once back up to speed.
So the safest way would be to scrub the speed and leave HSRUN, as long as RAM stays intact, update the EEPROM from RAM values and restart fresh.
I'm not sure if pretending to do a DUFF SNOOZE to VLPR leaves RAM intact dropping to a some low speed? I saw Manitou has tested Snooze to work, but I've not gotten to that myself. Maybe just getting the CPU under 120 MHz and setting HSRUN(0) would work? To write 4KB safely at this point a few hundred ms would not be an issue as long as it works to get the right data stored for use on restart.
Then writing the needed EEPROM updates, and asking for an MCU restart to Normal HSRUN mode where the new EEPROM values would be ready for use?
This would be DRASTIC - but better than "going OFFLINE":: writing the data to SD card or USB_Serial to save it - load a low speed write sketch - program the EEPROM ( SD or data in from USB/HID like TeensyTransfer or manual transfer } then reload the target sketch. And as long as this can work for the 'end use' - it would allow some value in the EEPROM as long as the need to change it was RARE enough
Other wise it would involve duct taping an I2C EEPROM to the bottom of a T_3.6 and using SDA3/SCL3 pins - or similar solution maybe with SPI2 to have usable EEPROM space.
From the Serial# work in this code I learned that the MCU and PINS are not ready for use - so the device cannot pause before HSRUN is set - read the data from anywhere ( RAM is BLANK at best - from what I read/inferred the "C" startup for USER code has not even executed. ) and push the update to EEPROM and then got to HSRUN, because it isn't until the MCU hits HSRUN that the rest of the T_3.6 is initialized and brought online: Clocks/Interrupts/RAM etc.