__attribute__((section(".bss.$RESERVED"))) int const TableReserve[] = {// save space for relocated vector table 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0 }; >>>> next, insert my vector table ahead of the program's vector table. Where there's 0x1234 will actually be the hex data for the assembly instructions to either remap the vector table to RAM or a long list of redirects for every bloody vector. After that will be more padding to push the program's vector table to address 0x0000 1000 which is the start of sector 1 in the FLASH. __attribute__ ((section(".isr_vector"))) int const BootVectors[] = { (int)&_vStackTop, // The initial stack pointer 0x100, // The reset handler 0,0,0,0,0,0,// all null vectors 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0x1234// boot routine }; Once all this is done, I can get back to useful coding since I have to ship this product THIS COMING WEEK! |