Problem with IAP and GCC

Started by titi_toon May 13, 2008
Hello,

I am using GCC on a LPC2138. Did someone manage to have the IAP work
with GCC ?

Thank you very much.

Jerome

An Engineer's Guide to the LPC2100 Series

--- In l..., "titi_toon" wrote:
>
> Hello,
>
> I am using GCC on a LPC2138. Did someone manage to have the IAP work
> with GCC ?
>

Yes. Rowley Crossworks, (GCC), with 2129. I use IAP in my secondary
bootloader to blow new code images. Works OK.

Rgds,
Martin

Hello Martin,
I managed to have the IAP work with GCC. But about your secondary bootloader, how do you copy it to ram and then execute it ?

Thank You,
Jerome

--- On Tue, 5/13/08, mjames_doveridge <m...@tuthill.com> wrote:
From: mjames_doveridge <m...@tuthill.com>
Subject: [lpc2000] Re: Problem with IAP and GCC
To: l...
Date: Tuesday, May 13, 2008, 6:14 PM

--- In lpc2000@yahoogroups .com, "titi_toon" <titi_toon@. ..> wrote:

>

> Hello,

>

> I am using GCC on a LPC2138. Did someone manage to have the IAP work

> with GCC ?

>

Yes. Rowley Crossworks, (GCC), with 2129. I use IAP in my secondary

bootloader to blow new code images. Works OK.

Rgds,

Martin


--- In l..., Titi Toon wrote:
>
> Hello Martin,
> I managed to have the IAP work with GCC. But about your secondary
bootloader, how do you copy it to ram and then execute it ?
>
> Thank You,
> Jerome
>

My bootloader blows the app code into flash and calls its start
address through a function pointer. The app itself copies its vectors
into RAM, remaps the vectors, sets up its own threads/stacks etc = it
does not rely on the bootloader for anything except providing it with
initial execution.

I have to have the interrupt vectors in RAM so that the secondary boot
code vectors are not used again until a reset removes the RAM mapping,
so allowing the secondary bootloader to run again. The rest of the
app code can sit happily in flash. In fact, I have enough flash in my
2129 to keep two banks of code - the boot code can run either:


name="LOADVEC" />
name="APPBOOT" />
name="APPDATAA" />
access="ReadOnly" name="BANKABIN" />
name="APPDATAB" />
access="ReadOnly" name="BANKBBIN" />
name="APPBOOTE" />
name="LOADBOOT" />

name="SVECTORS" />
name="DEBUGRAM" />
access="Read/Write" name="SRAM" />
name="IAPSPACE" />


There is an 'SRAM_EXCEPTIONS' preprocessor definition - set it in the
project properties/options. This enables code in the startup.s to
copy the interrupt vectors etc. to the bottom of RAM and enable the
remapping. Build your app at a flash location and link/store it in
whatever format is needed by your secondary loader. I use a simple
sector, shared by the app and boot, to allow the boot code to know
what version it has loaded and its start address.

Rgds,
Martin