Jump to content
Sign in to follow this  
ppulle

Field Updatable Firmware

Recommended Posts

Hi,

 

Before writing my own code, just thought I'd check to see if anyone has done this before.

 

I'm after some routines that will take a memory image from external EEPROM and write to the program memory.

 

The idea being that the application will receive a .hex file (or similiar), and write it to the EEPROM, do some checks to make sure its valid then write that EEPROM memory image to the flash program memory. This is so the application can be updated in the field.

 

Note this is NOT a bootloader because:

- the program data is first loaded onto onboard eeprom not directly to program memory

- there is no facility in hardware for the application to start in either bootload or application mode by pressing a button or other action at powerup

- bootloaders require a reasonably tech savvy person to operate, not good enough for end users

- I want the code to be received in a certain protocol that gives feedback to the user if successful or not plus maybe some simple encryption. I don't want the routines to worry about receiving the data or be restricted to serial ports, io pins or whatever else people have come up with.

 

 

Basically I'm only after routines that take the eeprom image and write to application memory...everything else I'll do.

 

Has something like this been written? Don't want to re-invent the wheel if necessary.

 

If not, then can I get a sanity check on the following requirements before I start:

- the 'image writer' would have to be in a protected block as set by configuration bits

- how do I get my updated application code to 'org' at a non protected block? Do I need to use -rb linker option? Is there an 'org' directive in Sourceboost?

- if I use the first protected block for the image writer, how does this affect interrupt and reset vectors. Will they be fixed?

- if I need to protect the first block, and the interrupt/reset vectors are fixed, how then do I make sure my interrupt routines always start at the same place?

- will writing to a protected block result in a error that needs to be caught, or can I simply ignore it safe in the knowledge the image writer wont write over itself? Will I need to make it simply ignore writes to the protected block (in which case we wouldn't need protection I suppose).

- when the app code gets the goahead to update, how can I make sure I can call the image writer code in the protected block at the pre-defined address?

 

 

Phil

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...