So could the compact/rearrange occur during the first eval ? I am not sure if this is the problem, as even if I reboot and try to eval the code later it still fails. So what I was doing originally was
Save bootloader from IDE (not using Save on Send so should be all in RAM ?)
Bootloader runs code ver 1 by eval (This was previously written to storage by bootloader)
Code ver is running, is notified of software update so reboots to bootloader (E.enableWatchdog(1); while(1);)
Bootloader receives code v2 via serial port, writes to Storage
Bootloader eval code v2 but fails due to code errors. Even if I reboot it still fails.
If I delete code v1 before writing v2 to Storage, it works. Not sure if that shows something I am missing.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
So could the compact/rearrange occur during the first eval ? I am not sure if this is the problem, as even if I reboot and try to eval the code later it still fails. So what I was doing originally was
If I delete code v1 before writing v2 to Storage, it works. Not sure if that shows something I am missing.
I will try your suggestion of eval to RAM as well