Hi Champs,
The default linker command files for Stellaris devices with CCSv4.1 define .vtable section as follows:
.vtable : > SRAM
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
This allocates the .vtable section to somewhere on SRAM, but .vtable should be aligned with some boundary
according to the following rule referred from ARM Cortex-M3 TRM (NVIC table offset register):
The Vector Table Offset Register positions the vector table in CODE or SRAM space.
The default, on reset, is 0 (CODE space). When setting a position, the offset must be
aligned based on the number of exceptions in the table. This means that the minimum
alignment is 32 words that you can use for up to 16 interrupts. For more interrupts, you
must adjust the alignment by rounding up to the next power of two. For example, if you
require 21 interrupts, the alignment must be on a 64-word boundary because table size
is 37 words, next power of two is 64.
Actually in my project, .vtable section was allocated to 0x20002004 with the default linker command file,
which is not aligned. Thus the program failed to jump to a proper vector address on an interrupt.
Linker command files of other tools (e.g. EWARM) define .vtable section so that the section may be
allocated to the begin of SRAM (0x20000000).
So I hope that the default linker command file of CCS would be modifed as follows:
.vtable : > 0x20000000
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
Best regards,
Tetsu Ohshima