--- In lpc2000@yahoogroups.com, "Michal Krestan" <krestan@h...> wrote:
>
> I'm using LPC2106 in my application with gcc 4.0.0. I've compiled
all my sources in ARM mode and it works fine, but for IAP routine call
I had to use -mthumb-interwork flag for gcc. After this, my
application will crash in few sec (not on IAP call, but inside IRQ
function). The problem is in IRQ routine. When I'll make call of
function inside ISR, gcc will generate wrong code without returning
address. If i'll not use -mthumb-interwork flag, the code is compiled
correctly.
>
> Michal
>
>
> [Non-text portions of this message have been removed]
Hello,
I have used the IAP routines, and my application is ARM code entirely.
Points to note: (page references to the document below)
You have allowed space in the top of ram for IAP functions
(32bytes). page 231
Once you start programming the flash, unless you have remapped the
vectors to RAM, you must disable interrupts. Also, if you do not
disable interrupts, you must have your handler code in ram as well.
Remember the flash is not accessible while programming.
When I am erasing/programming the flash, I disable the PLL, and the
MAM and also interrupts. After the operation these are all re-enabled.
I have never had a problem, except that on the 2132, where the top
32k is a single sector. This meant I needed to use a sector near the
start of flash, in fact the second sector. The first is for startup,
vectors and any assembler functions, the second for a 4k configuration
area, and the third sector on is the rest of the code. This then meant
making a hole in the linker file, which meant using named sections
for the startup and assembler routines.
UM10120
Volume 1: LPC213x User Manual
Rev. 01 â" 24 June 2005 User manual
Dave