guidance with firmware update

OP #1207355
Hi,

Let me start by presenting my problem, and then hopefully someone can 
give some guidance on how to approach it :)

I am working with a Keil MCB2300 board with SD interface (which I 
configured by using the code from Martin Thomas and ChaN's FAT-Module). 
I also have a GSM modem connected to the UART port, from which I receive 
an update on the firmware.

This update (hex file) is stored into the SD card, and at this point I 
am supposed to do an upgrade of the firmware (my application is 
bare-metal, at this point I am not using any embedded OS).

Could you give me some hints on which steps would you follow in order to 
perform the upgrading? Any input that you can provide would be more than 
welcome.

Many thanks in advance!

Kind regards,
Jeroen
Moderator #1207734
I have played a little bit with update from SD-card with other 
controllers and this ist the basic concept I have used:

- Try to add some extra checksum/crc/similar and version information in 
a second file or use a extra record in the hex-file. In my experiments I 
have used a "metadatafile" with CRC16-Checksum, Version, Numb. of bytes 
and filename of a binary file on the card which contains the 
application's code. I have used raw-binary to avoid parsing of hex-files 
in the firmware.

Some kind of Bootloader with functions to read and browse the SD-card 
should be installed at the start-address of the internal flash. The real 
application is located "behind" this.

Bootloader:
- retrieve the version of the current version, could be a number located 
at a "fixed" address
- browse the files on sd-card to find the latest firmware code-version
- if latest firmware on card ist same or older than the on ein flash, 
continue normal operation
- no newer version available verify that the checksum/crc of the file on 
the card is correct
- if correct start the update procedure, if not jump to main application
- update procedure: parse the content of the hex-file and convert it in 
binary-data, upload the binary data to the internal flash using the IAP 
functions documented in the LPC23xx manual. Keep the memory layout in 
mind (sectors, pages). Write the version to the "fixed" address.

The main application should copy it's exceptions vectors in RAM and 
Remap since the start of the flash is already occupied by the exceptions 
vectors of the Bootloader. The main application should be linked to an 
adress behind the bootloader. The bootloader can be started from the 
main application by watchdog-reset or maybe by a simple "branch to 0x0"

Hope this give at least a rough idea.

Reply

A question of your own? This thread is over 17 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.