XMM load without propeller-load
steddyman
Posts: 91
Is there any way to get PropGCC to output a BIN file for the code that runs in hub/cog ram along with an SD loader to load the rest of the code into either Flash or SRAM?
The reason I ask is I have a Micromite Companion (MMC) which can load BIN files, and I would like to get it to then load the XMM portion from the SD. I can created a Config file for my board type but I can't get the GCC Compiler to output a BIN and a PEX file I can put on the SD. The example I am using is generating a .COG, a .ELF and a .PEX.
If I instead compile to LMM then I get a straight BIN that the MMC will load just fine.
The reason I ask is I have a Micromite Companion (MMC) which can load BIN files, and I would like to get it to then load the XMM portion from the SD. I can created a Config file for my board type but I can't get the GCC Compiler to output a BIN and a PEX file I can put on the SD. The example I am using is generating a .COG, a .ELF and a .PEX.
If I instead compile to LMM then I get a straight BIN that the MMC will load just fine.
Comments
Yes, you can generate a .binary for LMM or CMM programs. There is no way, of course, to do that for XMM programs since the .binary loader in the Propeller chip knows nothing about external memory.
I believe the XMMC boot program is written in Spin, so it should be possible to build an version of the boot program that can be loaded from SD and executed. It should also be possible to modify the XMMC boot program to run any arbitrary PEX file on the SD card.
Now if that can be done, then it should be possible to further modify the XMMC boot program to copy the PEX file to Flash or SRAM, and execute it from there. It's just a simple matter of programming.
EDIT: It looks like David Betz responded at the same time that I was composing my message.
I have a simple SPI SRAM hooked up to the breadboard of th MMC and tested to be working using SPIN code.
I agree that the 512-byte cache line size is a problem with running from SD directly. I think the problem is actually due to there only being 16 cache lines when the cache is 8K in size, and the cache lines are 512 bytes. I think direct SD execution could be improved if the 512-byte block size where broken up into 4 128-byte cache lines. A 512-byte buffer could be used to hold the SD sector, but only 128 bytes would be used at a time. However, we didn't pursue this idea at the time when the cache driver work was being done.
I think executing from SD is still a useful thing for systems that have no other external memory, but do have an SD card.
I tried compiling sd_cache_loader and putting it on an SD card along with a test PEX file. However, the loader never got past the call to the mount routine. Even if it was able to access the SD card I don't think it would work because the caching interface has changed, and I suspect the SD driver was never updated to the new method.