I am developing KEA-128 application with S32 Design Studio. I need relocate the vector table and the corresponding ISR routines to SRAM for quicker response. Although I am aware to configure the default linker file SKEAZ_flash.ld to link the target code into SRAM, and assume that I must copy the code from Flash to SRAM before execution, I am not sure how to do it? Can anybody help me or point me to some example code?
Appreciate your help so much.
Assuming that your RAM were to start at 0x1fff8000 and your vectors are in Flash at their default location, and the interrupt vector table were 0x200 in length you can do it with simple code as follows. In the linker script you can defined 0x200 bytes to keep free at the start of SRAM.
SCB_VTOR = 0x1fff8000; // set the location of interrupt vectors to the start of SRAM
memcpy((void *)0x1fff8000, 0x00000000, 0x200); // copy the fixed vectors to SRAM
S32 Design Studio: http://www.utasker.com/kinetis/compilers.html#S32
Professional Kinetis support, one-on-one training and complete fast-track project solutions: http://www.utasker.com/support.html