This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCSv4.1 - .vtable section definition in the default linker command files for Stellaris devices

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

  • You are correct about the alignment requirements for vtable.  Thank you for bringing this to our attention.  It will be addressed in the next release of StellarisWare, which will be in approximately one month.  In the mean time, the workaround is to modify the command file as you have suggested.

  • Joe,

    Thank you very much for handling this.
    In addition to StellarisWare update, could you please consider modifying default linker command files provided in CCSv4 directory  (\Texas Instruments\ccsv4\arm\include)?

    Thanks and regards,
    Tetsu Ohshima