EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

IAP command

Started by ronak bhalani July 9, 2010
Hello All,

I am using IAP command to write into the flash of lpc2103. Is it necessary to disable all the interrupts before calling IAP routine? If so then how i can disable and unable the interrupts.

An Engineer's Guide to the LPC2100 Series

Yes, you need to disable all interrupts to white in flash with IAP.
To do this you must save the state of the interrupts and then restore.

Code Exemple:

unsigned long int enabled_interrupts;

enabled_interrupts = VICIntEnable; //disable all interrupts
VICIntEnClr = enabled_interrupts;

....

VICIntEnable = enabled_interrupts; //restore interrupt enable register

2010/7/9 ronak bhalani

> Hello All,
>
> I am using IAP command to write into the flash of lpc2103. Is it
> necessary to disable all the interrupts before calling IAP routine? If so
> then how i can disable and unable the interrupts.
>
>
>
       It is mentioned in the manual that top 32 bytes of RAM should not be used by application program while using IAP command. So, how I can make these locations free. I am using gcc compiler. Is there any setting required to be done in the linker file. Please guide on this since i am still not able to write into the flash memory of lpc2103.

--- On Fri, 9/7/10, Jonatan Vieira wrote:

From: Jonatan Vieira
Subject: Re: [lpc2000] IAP command
To: l...
Date: Friday, 9 July, 2010, 6:31 PM

 

Yes, you need to disable all interrupts to white in flash with IAP.
To do this you must
save the state of the interrupts and then restore.

Code Exemple:

unsigned long int enabled_interrupts;

enabled_interrupts = VICIntEnable;      //disable all interrupts
VICIntEnClr        = enabled_interrupts;
....

VICIntEnable = enabled_interrupts;  //restore interrupt enable register

2010/7/9 ronak bhalani

 

Hello All,

          I am using IAP command to write into the flash of lpc2103. Is it necessary to disable all the interrupts before calling IAP routine? If so then how i can disable and unable the interrupts.
Do you have a linker script file ? *.ld ?

Something like (taken from a perhaps different processor, just as example !)

MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00010000
}

How about reducing the LENGTH of SRAM by 32 ?

Best regards,

Martin

--- In l..., ronak bhalani wrote:
>
>        It is mentioned in the manual that top 32 bytes of RAM should not be used by application program while using IAP command. So, how I can make these locations free. I am using gcc compiler. Is there any setting required to be done in the linker file. Please guide on this since i am still not able to write into the flash memory of lpc2103.
>
> --- On Fri, 9/7/10, Jonatan Vieira wrote:
>
> From: Jonatan Vieira
> Subject: Re: [lpc2000] IAP command
> To: l...
> Date: Friday, 9 July, 2010, 6:31 PM
>
>
>
>
>
>
>
>  
>
>
>
>
>
>
>
>
>
> Yes, you need to disable all interrupts to white in flash with IAP.
> To do this you must
> save the state of the interrupts and then restore.
>
> Code Exemple:
>
> unsigned long int enabled_interrupts;
>
> enabled_interrupts = VICIntEnable;      //disable all interrupts
> VICIntEnClr        = enabled_interrupts;
>
>
> ....
>
> VICIntEnable = enabled_interrupts;  //restore interrupt enable register
>
> 2010/7/9 ronak bhalani
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>  
>
>
>
>
>
>
>
>
>
> Hello All,
>
>           I am using IAP command to write into the flash of lpc2103. Is it necessary to disable all the interrupts before calling IAP routine? If so then how i can disable and unable the interrupts.
>

--- In l..., "capiman26061973" wrote:
>
> Do you have a linker script file ? *.ld ?
>
> Something like (taken from a perhaps different processor, just as example !)
>
> MEMORY
> {
> FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
> SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00010000
> }

ronak,

You can also look at your map file from the compile/link.
( .map)

It will tell you how much SRAM you are using.
I doubt that you have used up all your SRAM and are having a conflict between the IAP functions and your application.

The 2103 has 8K SRAM, how many variables have you created, how much stack have your defined.

Please post that text from the map file here.

Have you read? http://www.nxp.com/documents/application_note/AN10256.pdf

good luck

don


The 2024 Embedded Online Conference