Dear All,
I use LPC1778 and try to divide internal flash memory for my handmade bootloader and firmware. And when i set another IROM1 start address for my firmware (for example 0x1000) i see SWD Communication Failure message in window "Building Output". After that i can't debug or update my mcu. Can use only ISP. Why changing IROM1 start address is stopping MCU? What i have to do to run my code from any address? P.S. When i use LPC2367 there is no these problems. P.P.S. My version 4.53
I trying apply RAM_MODE, REMAP commands for my startup file. But doesn't work. With best regards, Vladimir.
Did you program the Vector Table Offset Register and start your Firmware from your bootloader?
The addresses need to be changed:
// <h> Vector Table // ================= // // <o0> Vector Table Base Address // Vector Table Base Address // Default: 0x90000 // #define NVIC_VectTab_FLASH 0x90000 #define SP_OFFS 0 #define RESET_OFFS 4 // </h> int main() { void (*user_code_entry)(void); register uint32_t MSP __ASM("msp"); // put bootloader stuff here SCB->VTOR = NVIC_VectTab_FLASH; user_code_entry = (void (*)(void))(( *((unsigned int *)(NVIC_VectTab_FLASH + RESET_OFFS))) ); MSP = *((unsigned int *)(NVIC_VectTab_FLASH + SP_OFFS)); user_code_entry(); while(1); // should never reach this ... }
Sorry if i said incorrectly. There is no bootloader at this moment. It's possible to run programm from another address without bootloader? Or i have to write it, for normal work?
With regards, Vladimir.
Then you must set the Regs via .ini file. See any Cortex-M RAM project in Boards\ folder.
View all questions in Keil forum