From ee3ee049e44320d61f3d74f638cd572b2a55c16f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Wed, 1 Jul 2015 22:20:13 +0200 Subject: [PATCH] cc2538: Set the entry point to the CCA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No entry point was defined, so it defaulted to the beginning of the .text output section where the vector table is located by default in Contiki. Actually, the vector table may be located elsewhere, and the ROM-based boot loader first reads the CCA to find the vector table. Consequently, this commit sets the entry point to the CCA, which fixes both the entry point and the initial symbol reference, so this commit also removes the now-unneeded "__used__" and "KEEP" keywords from the CCA. Signed-off-by: Benoît Thébaudeau --- cpu/cc2538/cc2538.lds | 3 ++- cpu/cc2538/startup-gcc.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cpu/cc2538/cc2538.lds b/cpu/cc2538/cc2538.lds index 60a37c796..adb7f6ccd 100644 --- a/cpu/cc2538/cc2538.lds +++ b/cpu/cc2538/cc2538.lds @@ -59,6 +59,7 @@ MEMORY #endif } +ENTRY(flash_cca_lock_page) SECTIONS { .text : @@ -110,6 +111,6 @@ SECTIONS .flashcca : { - KEEP(*(.flashcca)) + *(.flashcca) } > FLASH_CCA } diff --git a/cpu/cc2538/startup-gcc.c b/cpu/cc2538/startup-gcc.c index d3d6ec401..d01aefa50 100644 --- a/cpu/cc2538/startup-gcc.c +++ b/cpu/cc2538/startup-gcc.c @@ -262,7 +262,7 @@ void(*const vectors[])(void) = default_handler, /* 162 MACTimer */ }; /*---------------------------------------------------------------------------*/ -__attribute__((__section__(".flashcca"), __used__)) +__attribute__((__section__(".flashcca"))) const flash_cca_lock_page_t flash_cca_lock_page = { FLASH_CCA_BOOTLDR_CFG, /* Boot loader backdoor configuration */ FLASH_CCA_IMAGE_VALID, /* Image valid */