LPC 2478 IAP

Started by mike_schwarzer March 8, 2010
Hi to Everyone,

I would need some hints, information, templates in using IAP with LPC2478.

I have written a Application using IAR Workbench, using LPC2478, TFT,
external RAM, .... I'm also using IAP Functions to store some Data in the Processor Flash.

Now I like to use IAP to update my Application.
As far as i have found out, there seems to bee to possibilities:
1. Building 2 Projects, One for Updating und one as application
2. Defining a specific Adress Range (Flash Sectors) for the Update Function.

My question is now, how to setup such specific Adress Ranges in IAR
Workbench.
Has someone such Setup Template, knows the exact Command Syntax for IAR or has some Idea where i can find such Informations.

mfg
Mike

An Engineer's Guide to the LPC2100 Series

Hi Mike

Check out the uTasker project for LPC2xxx - it includes firmware upload support for the LPC24xx via Ethernet (FTP or HTTP post), optionally encrypted.

- http://www.utasker.com/docs/uTasker/uTaskerBoot_003.PDF
- setups for GCC, Rowley, IAR, Keil

Regards

Mark

http://www.uTasker.com
--- In l..., "mike_schwarzer" wrote:
>
> Hi to Everyone,
>
> I would need some hints, information, templates in using IAP with LPC2478.
>
> I have written a Application using IAR Workbench, using LPC2478, TFT,
> external RAM, .... I'm also using IAP Functions to store some Data in the Processor Flash.
>
> Now I like to use IAP to update my Application.
> As far as i have found out, there seems to bee to possibilities:
> 1. Building 2 Projects, One for Updating und one as application
> 2. Defining a specific Adress Range (Flash Sectors) for the Update Function.
>
> My question is now, how to setup such specific Adress Ranges in IAR
> Workbench.
> Has someone such Setup Template, knows the exact Command Syntax for IAR or has some Idea where i can find such Informations.
>
> mfg
> Mike
>

Hi M.J.

> Check out the uTasker project for LPC2xxx - it includes firmware
upload support for the LPC24xx via Ethernet (FTP or HTTP post),
optionally encrypted.
>
> - http://www.utasker.com/docs/uTasker/uTaskerBoot_003.PDF
> - setups for GCC, Rowley, IAR, Keil
Thanks for your Replay,
But that was not exactly for what I'm searching.
If possible I would like to put some of my Functions at a spezific
Adress in Chip Flash
(like the @ "SomeWehre" Directive for Variables).
In Case of Update these Functions take over and do the Update, as there
Adresses
are known, they can protect themself during Update and then restart the
Processor.

My trouble is, I dont know how to tell the IAR Workbench/Linker which
Function shall
be at such a Adress.
I would like to have something like

void UpDate(void) @ 0x0007 8000 - 0X0007 8FFF // Sektor 22 of LPC2478

mfg

Mike
Hi Mike

I misunderstood.

Try the following:

void fnFunction( void) @ "ICODE"
{
}

where ICODE is declared in the linker script with -Z(CODE)ICODE plus the area.

This used to be valid for IAR4 but IAR5 works rather differently - maybe a block or region with that name would control it(?)

Regards

Mark

--- In l..., "mike_schwarzer" wrote:
>

> If possible I would like to put some of my Functions at a spezific
> Adress in Chip Flash
> (like the @ "SomeWehre" Directive for Variables).
> In Case of Update these Functions take over and do the Update, as there
> Adresses
> are known, they can protect themself during Update and then restart the
> Processor.
>
> My trouble is, I dont know how to tell the IAR Workbench/Linker which
> Function shall
> be at such a Adress.
> I would like to have something like
>
> void UpDate(void) @ 0x0007 8000 - 0X0007 8FFF // Sektor 22 of LPC2478
>
> mfg
>
> Mike
>

Hi M.J.,

> I misunderstood.
Never mind, I think my bad english was the reason
(I'm not an nativ english speaker).

> Try the following:
> void fnFunction( void) @ "ICODE"
> {
> }
Exactly that was my first try :-).
But for whatever reason, that dont works with code.
With Varibles the '@' is working fine, I use ist in
my project to put a lot of data in the external SDRam.

But as soon as code is involved, i can write the '@'
directive in (I think meanwhile) any form, with just
2 Results:
1. Complete Ignoring
2. Compiler Error
.....
So I think for Code there must be some other Command

mfg
Mike

--- In l..., "mike_schwarzer" wrote:
>
> Hi to Everyone,
>
> I would need some hints, information, templates in using IAP with LPC2478.
>
> I have written a Application using IAR Workbench, using LPC2478, TFT,
> external RAM, .... I'm also using IAP Functions to store some Data in the Processor Flash.
>
> Now I like to use IAP to update my Application.
> As far as i have found out, there seems to bee to possibilities:
> 1. Building 2 Projects, One for Updating und one as application
> 2. Defining a specific Adress Range (Flash Sectors) for the Update Function.
>
> My question is now, how to setup such specific Adress Ranges in IAR
> Workbench.
> Has someone such Setup Template, knows the exact Command Syntax for IAR or has some Idea where i can find such Informations.
>
> mfg
> Mike
>

Hi Mike,
If you look under the linker category in the project options dialog you will find linker configuration file edit box. There should be a .icf file listed in the editbox that tells the linker about the memory map of the particular device your using. Click the edit button and the dialog box that pops up will let you set the start and end addresses for the FLASH. You can have one .icf file for the main project and another for the loader project. Just set the start of flash of one project to the end of FLASH from the other project so you won't have overlap. You will also need to decide which project has the default exception handlers and how the two projects will interact.
You can also edit the linker configuration file manually and setup multiple regions in the FLASH for one project. Then you can place the project code in one region and the loader code in another region using the "#pragma section" directive. The IAR documentation describes this pretty well.
Good Luck.

Frank

Hi Frank,

> Hi Mike,
> If you look under the linker category in the project options
> dialog you will find linker configuration file edit box.
> There should be a .icf file listed in the editbox that tells the
> linker about the memory map of the particular device your using.

Clear :-)
Here I have also defined the SDRam Region

> Then you can place the project code in one region and the loader
> code in another region using the "#pragma section" directive.
> The IAR documentation describes this pretty well.
> Good Luck.
>
> Frank
>
Thanks a Lot, the '#pragma section' directive was my missing link.
I have searched the IAR Docu a 100... Times, but was not able to
find it, but now as i know the right name ...
Thanks.

mfg
mike

--- In l..., "mike_schwarzer"
wrote:
>
> Hi Frank,
>
> > Hi Mike,
> > If you look under the linker category in the project options
> > dialog you will find linker configuration file edit box.
> > There should be a .icf file listed in the editbox that tells the
> > linker about the memory map of the particular device your using.
>
> Clear :-)
> Here I have also defined the SDRam Region
> > Then you can place the project code in one region and the loader
> > code in another region using the "#pragma section" directive.
> > The IAR documentation describes this pretty well.
> > Good Luck.
> >
> > Frank
> >
> Thanks a Lot, the '#pragma section' directive was my missing link.
> I have searched the IAR Docu a 100... Times, but was not able to
> find it, but now as i know the right name ...
> Thanks.
>
> mfg
> mike
>
Hi Mike,

Glad to help The document where this information is found is the "IAR
C/C++ Development Guide Compiling and linking for Advanced RISC Machines
Ltd's ARM Cores" It can be viewed from the help menu "C/C++
Development Guide" in the event you need more information in the future.

Regards,

Frank