Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 1 month ago.
LPC1549 RTOS dont run on adress other than 0x0
Hi I have a project that runs fine without RTOS on address 0x2000 (i have bootloader at adress 0x00). After import RTOS to my current project the application dont start when using address 0x2000, but if i change the address to 0x00 it runs fine.
Thanks for your help
here is a copy of my LPC1549.ld memory
LPC1549.ld
MEMORY { /* Define each memory region */ MFlash256 (rx) : ORIGIN = 0x2000, LENGTH = 0x3E000 /* 256K bytes */ Ram0_16 (rwx) : ORIGIN = 0x2000000+0x100, LENGTH = 0x4000-0x100 /* 16K bytes */ Ram1_16 (rwx) : ORIGIN = 0x2004000, LENGTH = 0x4000 /* 16K bytes */ Ram2_4 (rwx) : ORIGIN = 0x2008000, LENGTH = 0x1000 /* 4K bytes */ } /* Define a symbol for the top of each memory region */ __top_MFlash256 = 0x2000 + 0x3E000; __top_Ram0_16 = 0x2000000 + 0x4000; __top_Ram1_16 = 0x2004000 + 0x4000; __top_Ram2_4 = 0x2008000 + 0x1000;
Here a copy of my bootloader, who calls the application at address 0x2000. Remember, i use this code without RTOS and it works fine
Bootloader
// Start by disabling interrupts, before changing interrupt vectors __disable_irq(); Chip_Clock_SetMainClockSource(SYSCTL_MAINCLKSRC_IRC); //switch to IRC // Set vector table offset SCB->VTOR = 0x2000; // Note, can be anded with max allowed address, 0x3FFFFF80 // Create pointer to reset handler at new program address void (*code_ptr)(void) = (void (*)(void))(*(uint32_t*)0x2004); __set_MSP(*(__IO uint32_t*)0x2000); // Set top stack handler // Jump to user code code_ptr(); // Force the counter to be placed into memory volatile static int i = 0 ; // Enter an infinite loop, just incrementing a counter while(1) { i++ ; } return 0 ;