Load ulisp program from a file on an sd-card


#1

HI,
This is probably a stupid question but i couldn’t seem to find an answer:
Can a ulisp program stored in a say a file called main.lisp located on the sd-card of something like the adafruit feather M0 adalogger or MKR zero boards be loaded and run automatically as soon as the board is powered up?

This would be very useful in applications that involve sensor logging in very remote locations where swapping out the sd-card (with a new ulisp program on it) is much easier than reprogramming in the field.

Any help is much appreciated.

Cheers.


#2

You can’t quite do what you’re describing, but you can automatically load a Lisp image at power-on and run a particular function. The Lisp image could be read from an SD-card, or from non-volatile memory. To do this you save the image with the name of the function you want to run; see:

http://www.ulisp.com/show?3L#saveimage

You also have to compile uLisp with #define resetautorun.

You could indirectly achieve what you’ve described by making the function run from the Lisp image read a file from the SD-card and evaluate it.