How do you deal with images?


#1

Hi,

I often use save-image/load-image and resetautorun. And it’s great! However - when I upgrade uLisp to new version - usually MCU goes into some infinite loop or crashes in this way or another. I do understand that image format changes, it’s not big problem. But what I end up doing is:

  1. Boot MCU with old uLisp I want to upgrade.
  2. makunbound all stuff (because resetautorun is ON by default on my boards).
  3. save-image when workspace is empty to kind of erase old image.
  4. Disconnect terminal and proceed with upgrade.

This makunbounding all definitions is bit boring. So my question is:

  • whould it be possible to add erase-image?

or…

  • maybe add version ID to image, and not load it when it was saved with older version?

Or perhaps I’m doing something wrong? How do you deal with images when upgrading uLisp?

Best regards,

rsm


#2

I agree that the way it works at the moment doesn’t handle resetautorun very gracefully, but I think there’s an easier way to do what you want to achieve:

  • Upload the new version of uLisp with resetautorun off.

  • Do a save-image.

  • Upload again with resetautorun on.

Now you can save an image which will autorun without crashing on the new version.

Also, I think the documentation of save-image should be improved because it implies that resetautorun always causes a function in the saved image to be run, but actually this is optional depending on whether you specify one when you save the image. I assume that’s all working OK for you?

I’ll think about your suggestion of adding a version number so uLisp can tell if a saved image is valid - thanks!