Maxwin
11-16-2010, 02:00 PM
My latest endeavour is to create a bootloader in PropBasic which can read/write firmware updates to eeprom via a gsm connection.
Something simple like:
doUpdate("http://www.myserver.com/update.binary")
As with my previous building-block tasks, posting here should help me to "keep at it". It is always preferable to finish what I start, and rewarding to share at the same time! If anyone has already started or finished something similar, I would be really interested to learn more.
This is the basic plan so far:
1. Prop starts up and loads "bootloader code" from first 32k of eeprom. (as usual)
2. Bootloader detects "upgrade" IO pin state..
If high, download(gsm) new firmware into ram
(and if checksum correct, copy to eeprom).
If low, copy top half of eeprom into ram and execute.
(checksum needed, if image is bad bootloader must attempt to re-download)
3. Device reboots to load the new firmware (or try again if it failed).
--
The GSM/GPRS comms is working fine using serial AT commands to an old modem. I have stable success "dialing up" to my server and downloading entirely useless bytes!
Now I start work on the I2C routines, and understanding what addresses to write the received bytes to in the eeprom will be my first hurdle.
Previously (during an early pondering phase) I received some good advice, and was referred to the ybox2 project by Mike Green (http://forums.parallax.com/showthread.php?t=120743). I have since bought the ybox2, so will study that along with the various obex & forum codes for spin bootloaders.
Should be fun ! (.. will be fun !)
Something simple like:
doUpdate("http://www.myserver.com/update.binary")
As with my previous building-block tasks, posting here should help me to "keep at it". It is always preferable to finish what I start, and rewarding to share at the same time! If anyone has already started or finished something similar, I would be really interested to learn more.
This is the basic plan so far:
1. Prop starts up and loads "bootloader code" from first 32k of eeprom. (as usual)
2. Bootloader detects "upgrade" IO pin state..
If high, download(gsm) new firmware into ram
(and if checksum correct, copy to eeprom).
If low, copy top half of eeprom into ram and execute.
(checksum needed, if image is bad bootloader must attempt to re-download)
3. Device reboots to load the new firmware (or try again if it failed).
--
The GSM/GPRS comms is working fine using serial AT commands to an old modem. I have stable success "dialing up" to my server and downloading entirely useless bytes!
Now I start work on the I2C routines, and understanding what addresses to write the received bytes to in the eeprom will be my first hurdle.
Previously (during an early pondering phase) I received some good advice, and was referred to the ybox2 project by Mike Green (http://forums.parallax.com/showthread.php?t=120743). I have since bought the ybox2, so will study that along with the various obex & forum codes for spin bootloaders.
Should be fun ! (.. will be fun !)