Skip to content

Commit

Permalink
mimxrt/boards: Fix __VECTOR_TABLE link issue with CMSIS 5.9.0.
Browse files Browse the repository at this point in the history
In CMSIS 5.9.0, the compiler headers define `__VECTOR_TABLE`, which will be
substituted with its corresponding value (e.g., `__Vectors` for gcc).
However, the linker script in this port can't include compiler headers when
it's processed, so `__VECTOR_TABLE` is used as the literal variable name,
which results in an undefined linker error.

To fix this, the two possible values of `__VECTOR_TABLE` are both defined
in the linker script.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
  • Loading branch information
iabdalkader authored and dpgeorge committed Jan 22, 2024
1 parent e2fa0c6 commit beb4459
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ports/mimxrt/boards/common.ld
Expand Up @@ -83,13 +83,14 @@ SECTIONS
/* The startup code goes first into internal RAM */
.interrupts :
{
__VECTOR_TABLE = .;
__Vectors = .;
__vector_table = .;
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} > m_interrupts

__VECTOR_RAM = __VECTOR_TABLE;
__VECTOR_RAM = __Vectors;
__RAM_VECTOR_TABLE_SIZE_BYTES = 0x0;

/* The program code and other data goes into internal RAM */
Expand Down

0 comments on commit beb4459

Please sign in to comment.