AnsweredAssumed Answered

Giving access to a program residing at different location

Question asked by AKHIL JOY on Jan 30, 2019
Latest reply on Jan 31, 2019 by jeremyzhou

HI ,

 

Am developing a secondary bootloader for LPC1517. 

 

Current status: Able to load new firmware from UART to the location 0x8000. Now i have to give access to the new firmware. Currently, the code is written as below 

 

 

asm volatile("ldr r0, =0x8000");
asm volatile("ldr r0, [r0]");
asm volatile("mov sp, r0");

/* Load program counter with application reset vector address, located at
second word of application area. */
asm volatile("ldr r0, =0x8004");
asm volatile("ldr r0, [r0]");
asm volatile("mov pc, r0");

 

 

 

Bootloader linker memory code

 

 

MEMORY
{
/* Define each memory region */
MFlash256 (rx) : ORIGIN = 0x0, LENGTH = 0x8000 /* 256K bytes (alias Flash) */
Ram0_16 (rwx) : ORIGIN = 0x2000000, LENGTH = 0x4000 /* 16K bytes (alias RAM) */
Ram1_16 (rwx) : ORIGIN = 0x2004000, LENGTH = 0x4000 /* 16K bytes (alias RAM2) */
Ram2_4 (rwx) : ORIGIN = 0x2008000, LENGTH = 0x1000 /* 4K bytes (alias RAM3) */
}

/* Define a symbol for the top of each memory region */
__base_MFlash256 = 0x0 ; /* MFlash256 */
__base_Flash = 0x0 ; /* Flash */
__top_MFlash256 = 0x0 + 0x2000 ; /* 256K bytes */
__top_Flash = 0x0 + 0x2000 ; /* 256K bytes */

 

 

Application code linker 

 

 

/* Define each memory region */
MFlash64 (rx) : ORIGIN = 0x8000, LENGTH = 0x8000 /* 64K bytes */
Ram0_4 (rwx) : ORIGIN = 0x2000000, LENGTH = 0x1000 /* 4K bytes */
Ram1_4 (rwx) : ORIGIN = 0x2001000, LENGTH = 0x1000 /* 4K bytes */
Ram2_4 (rwx) : ORIGIN = 0x2004000, LENGTH = 0x1000 /* 4K bytes */


}
/* Define a symbol for the top of each memory region */
__top_MFlash64 = 0x8000 + 0x8000;
__top_Ram0_4 = 0x2000000 + 0x1000;
__top_Ram1_4 = 0x2001000 + 0x1000;
__top_Ram2_4 = 0x2004000 + 0x1000;

 

 

Following things done :

 

1) Unticked managed linked script.

 

 

1)is there anything additional to be done, to give access to the program at 0x8000 ? 

Outcomes