EmbeddedRelated.com
Forums

LPC2220 - Bootloader and Application

Started by wiosna_grosella August 25, 2009
Hello, I am so newbie in this world, that I have read many post related to bootloader and I have an idea about how to solve my problem but I do not have clear how to implement it.

I am using a LPC2220, Keil compiler and a JTAG.

I have the program "Mybootloader" at 0x80000000. This program at certain time jumps to another program "Application", which is at 0x80010000. Both are independent, and before the jump, I disable the interruptions.

I reach the main of "Application" but, depends on the code, "Application" does nothing or the system is restarted and I am again at "Mybootloader".

The problem can be in relation with a mess in the VIC of both programs? Any detailed idea about how to solve it (I am not familiar with assember code).

Thanks in advance,

Susana

An Engineer's Guide to the LPC2100 Series

Here is solved the question I proposed last week.
It was necessary to map interruption vectors of the Application program (which is at 0x80010000) to RAM memory.

The solution to my question is at AN10835 (LPC secondary bootloader for code update using IAP). In that document, among other subjects, it is detailed how to map interruption vectors to RAM memory.

Basically, it is necessary to store the interruption vectors in RAM,

IF :DEF:VECINT_RAM
ADR R8, Vectors
LDR R9, =RAM_BASE
LDMIA R8!, {R0-R7}
STMIA R9!, {R0-R7}
LDMIA R8!, {R0-R7}
STMIA R9!, {R0-R7}
ENDIF

And to set MEMMAP to 2 in the Startup.s

LDR R0, =MEMMAP
IF:DEF:VECINT_RAM
MOV R1, #2
ELSE
MOV R1, #1
ENDIF
STR R1, [R0]

Where RAM_BASE is defined as RAM_BASE EQU 0x40000000

And VECINT_RAM is defined (using keil) at Project > Options for Target xxx>ASM>Define

In the Project>Options for Target it is interesting to reserve space for interruption vectors in RAM. The IRAM start address should be 0x40000040 to keep the first 64 bytes for the interruption vectors.

Grosella