Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Working with two Applications (Boot and MainApp)

2004-08-24 by embeddedjanitor

Having just done a bootloader thing like this I can give some 
comments.

The memory map I use is as follows:

0x0000 - 0x3FFFF = 16kB "boot monitor"
0x4000 - to top of flash = "application area"

When the device boots the "boot monitor" does a checksum check on 
the "application" and also checks for a serial break. If the checksum 
fails or there is a break then the monitor executes to allow the 
application area to be reflashed, otherwise the execution jumps to 
0x4000 (the start of the application).

The purpose of this is twofold: firstly it provides an upgrade 
mechanism and secondly it provides better checksumming than the 
Philips method.

The boot monitor is built as a fairly regular application. I don't 
use interrupts, but you could (you'd have to turn interrupts off 
before jumping to the app. I don't use thumb either, but again you 
could so long as you turn it off.

The application has a reasonably normal crt0.s. Since it is not at 
address 0, you need to use memmap for the vectors. Make sure that 
the .data and .bss are only located from address 0x40000040 up to 
keep the vector space for the vectors.

I found I had to craft my own ldscripts to get what I want.

The most important thing is to check the map files to make sure 
everything is where it needs to be. Map is your friend.

Hope that helps...

-- Charles

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.