Yahoo Groups archive

Lpc2000

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

Thread

Code Loader

Code Loader

2005-02-01 by Richard

I am working on a scheme to update the code in an LPC2106 via
Ethernet.  The application is done and working, I have connection to
the host via ethernet.  I have been asked to allow code updates via
the ethernet.  I have IAP calls functioning.  Our code will remain
under 64KB so there will be room for new code in on-chip flash.  Right
now my plan is to:

Build the loader into the existing code.  This will, when prompted by
the host, prepare and erase upper sectors, accept a chunk (512B or
8KB?) of the new code from the host, and store it in RAM.

Each chunk of new code will be programmed to the blank sectors after a
CRC check.

When done, a global CRC will be performed.

Questions:

How to transfer execution to the new code segment?  

What about the vector table?

Other ignorance on my part?

Thanks

Rich

Re: [lpc2000] Code Loader

2005-02-01 by Robert Adsett

At 10:19 PM 2/1/05 +0000, you wrote:
>Build the loader into the existing code.  This will, when prompted by
>the host, prepare and erase upper sectors, accept a chunk (512B or
>8KB?) of the new code from the host, and store it in RAM.
>
>Each chunk of new code will be programmed to the blank sectors after a
>CRC check.
>
>When done, a global CRC will be performed.
>
>Questions:
>
>How to transfer execution to the new code segment?


Jump table?  If you place a vector table of functions at a fixed place in 
the download area it can be replaced repeatedly.  I suspect you will need a 
fixed boot block in any case so this would fit quite well.

>What about the vector table?


There's not a great deal to be concerned about there I think.  The IRQ is 
vectored through the VIC so it's code won't change.  That leaves the 
startup vector which should always go to the boot block so it's fixed. The 
FIQ might be an issue if you really need a high performance FIQ.  I suppose 
you could jump to a fixed location if you needed to.  The other exceptions 
can either be dealt with in the boot block or though the above mentioned 
jump table,  Most of them will probably be fatal in any case.

>Other ignorance on my part?


Some way to verify that the active (non-boot block) program is valid.

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

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.