Boot a Spin program from Prop C?
propGccForMe
Posts: 2
in Propeller 1
Gents:
The Spin sd.Run allows a Spin program to boot another Spin program from the SD card. It also allows a Spin program to boot a Prop C program from the SD card. The question I have is it possible to boot a Spin program from a Prop C program? A fair amount of Google searching hasn't yielded an answer and I suspect this is because the capability doesn't exist. Given that the Spin language is interpreted it requires the interpreter to be resident in RAM in order to run a Spin program. Hence, to boot a Spin program from C would require both loading the interpreter and the desired program, thus a much more complicated boot process.
Thanks in advance for your feedback.
The Spin sd.Run allows a Spin program to boot another Spin program from the SD card. It also allows a Spin program to boot a Prop C program from the SD card. The question I have is it possible to boot a Spin program from a Prop C program? A fair amount of Google searching hasn't yielded an answer and I suspect this is because the capability doesn't exist. Given that the Spin language is interpreted it requires the interpreter to be resident in RAM in order to run a Spin program. Hence, to boot a Spin program from C would require both loading the interpreter and the desired program, thus a much more complicated boot process.
Thanks in advance for your feedback.
Comments
-Phil
http://forums.parallax.com/discussion/157563/combining-spin-and-c
I've never personally done what you're looking for (though I know it's been asked here before) but I think you might want to take a look into SpinWrap first and then if that doesn't work for you, Spin2Cpp. Spin2Cpp I'm much more familiar with, and it gives you a few different options:
1) Extract only the "DAT" section of a Spin file. This is useful if you want to use an existing PASM driver in a .spin file but then interact with it via C/C++.
2) Transpile (convert) the entire .spin file into C or C++. You then have all the options available via PropGCC for compiling the resulting C/C++ code. Many objects from the obex have been successfully utilized in projects using this method.
3) One of the newest features of spin2cpp is its ability to directly compile a .spin file into assembly (as opposed to the Spin byte codes which must be interpreted). If your reason for wanting PropGCC is because Spin isn't fast enough, then this option could be exactly what you really want.
Many thanks for the wealth of detail. I was aware of spin2cpp but didn't know about there were many other options as well.
Greg