Bootloader for device with SD card
Hello again, Guys,
Thanks to http://www.picbasic.co.uk/forum/imag...ine=1288665494I have a device with SD card (still not that advanced as Makrakit's one but it works) and now start thinking that having SD card already connected, it would be very nice to have an option to update firmware from it...
Will very much appreciate if someone could share a sample code for loading firmware from SD card
Thank you,
Alexey
Re: Bootloader for device with SD card
I've actually been thinking along similar lines recently since i've finally go FSSD3 working... ish...
The first question becomes, what do you want to do with the system?
I don't know much about the HEX file format, but, theoretically, the hex file could be saved to SD with a specific file name...
When the PIC boots, it looks for that specific file name on the card, loads it sector by sector into ram, and with each sector it self programs into a specific memory location.
The only issues i see, is reconfiguring the fuses... and re-configuring interrupts...
The interrupt issue, if we use DT's interrupt system as an example. All you's need to do is to define every single interrupt and give it it's own sub routine. Make sure each sub routine has it's own specific small block of memory (just enough to add in a jump to your own custom sub routine) then with each new firmware it overwrites all the interup sub routines with jumps to your own sub routines for the interrupts your actually using.
If an interrupt that your not using goes off then it jumps into an empty sub routine and then returns clearing the interrupt...
Another way of doing it, is to use one pic to program the other from the new hex... but that has it's own problems too...
Re: Bootloader for device with SD card
A friend of mine actually has something like this running. He said it is not quite ready to release into the wild. He will sooner or later.
Re: Bootloader for device with SD card
Thank you, Mackrackit, we will wait :)
Re: Bootloader for device with SD card
did some sample bootloader code using a SD eventuate for release