Boot code from SD
BTX
Posts: 674
Hi all.
I would like to boot some different propeller code using "fsrw with safe_spi" like Kye did it in his "SD-MMC_FATEngine" code.
The point of why I can't use the Kye code is, that is so slow reading blocks of data from SD for my application, instead fsrw let me enough speed, but it has not bootpartition rutine...
Anybody has some code of what I ask for ?
All obex bootloaders I saw, use another slow code/methods.. unless I miss some...
Thinking in modify the safe_spi (which could be a nightmare for me), where should I read about to load propeller RAM for launch code ?
Thx in advance.
I would like to boot some different propeller code using "fsrw with safe_spi" like Kye did it in his "SD-MMC_FATEngine" code.
The point of why I can't use the Kye code is, that is so slow reading blocks of data from SD for my application, instead fsrw let me enough speed, but it has not bootpartition rutine...
Anybody has some code of what I ask for ?
All obex bootloaders I saw, use another slow code/methods.. unless I miss some...
Thinking in modify the safe_spi (which could be a nightmare for me), where should I read about to load propeller RAM for launch code ?
Thx in advance.
Comments
As far as I remember the later versions of SDSPI really need all of the COG-RAM, so you can't add the boot-code to that directly. I'd simply write some own PASM code which uses SDSPI to load an EEPROM-file.
1. A little change is needed in popen which needs to return the first sector of the file: Just search for the if (mode =="r") and I think the return has been changed from 0 to datablock.
2. The PASM code has to stop all COGs that are running except the sdspi-COG and itself of course
3. the PASM code needs to reimplement this simple piece of code from the sdspi-driver So, you need to add some simple getter functions to fsrw and the spi-driver, which return the base address of those SPI-variables.
4. Having a loop which calls this function 64 times with incrementing sector (the one you got from popen) and an incrementing HUB-RAM-address will load the whole file into HUB-RAM
5. Then it has to stop the SDSPI COG and start a COG with the SPIN interpreter running the loaded code
Example can be found in SDSPIFemto