We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,I want copy my RO-data and vector table to RAM, and run in RAM complete.I have two question:1. In my.sct file I specify vector table(RESET AREA) image address at 0x20000000, How to specify vector table load address at 0x08000000?2. In boot.c file How to get vector table loadaddr and imageaddr?my.sct: LR_IROM1 0x08000000 0x00010000 { ER_IROM1 0x08000000 0x00010000 { *(InRoot$$Sections) boot.o (+RO) } RW_IRAM1 0x20000000 0x00005000 { *.o (RESET, +First) .ANY (+RO) .ANY (+RW) .ANY (+ZI) } }boot.c: static void init_ro_data() { unsigned int * from = (unsigned int*)Load$$RW_IRAM1$$RO$$Base; unsigned int * to = (unsigned int*)Image$$RW_IRAM1$$RO$$Base; unsigned int * to_stop = (unsigned int*)Image$$RW_IRAM1$$RO$$Limit; while(to < to_stop) *to++ = *from++; } static void init_vector() { // TODO: copy vector table from flash to ram // TODO: SCB->VTOR = new_vector_table, should be 0x20000000 } void Reset_Handler() { init_ro_data(); // copy code and const variables to ram init_vector(); // copy vecotr table to ram and set new vecotr pointer register SystemInit(); // call STM32 SystemInit __main(); // call libc runtime init }app.c: int main(void) { printf("main at 0x%08x\n", main); while(1); }