Skip to content

Commit

Permalink
[Silicon Labs] Add bootloader support
Browse files Browse the repository at this point in the history
* Make memory sections configurable in linker files
* Dynamically determine vector location in flash for NVIC relocation
* Advertise bootloader support in targets.json
  • Loading branch information
asmellby authored and c1728p9 committed Jun 6, 2017
1 parent 8d6bc1d commit 5d906a7
Show file tree
Hide file tree
Showing 32 changed files with 302 additions and 71 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#! armcc -E
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x00000000 0x00100000 { ; load region size_region
ER_IROM1 0x00000000 0x00100000 { ; load address = execution address
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x00100000
#endif

LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#! armcc -E
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x00000000 0x00100000 { ; load region size_region
ER_IROM1 0x00000000 0x00100000 { ; load address = execution address
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x00100000
#endif

LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@ STACK_SIZE = 0x400;
* heap and the page heap in uVisor applications. */
HEAP_SIZE = 0x6000;

#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 1048576
#endif

MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1048576
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 131072
}
/* MBED: mbed needs to be able to dynamically set the interrupt vector table.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */

if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00100000; }

/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x000FFFFF;
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
define symbol __NVIC_start__ = 0x20000000;
define symbol __NVIC_end__ = 0x200000DB;
define symbol __ICFEDIT_region_RAM_start__ = 0x200000DC;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#! armcc -E
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x00000000 0x00010000 { ; load region size_region
ER_IROM1 0x00000000 0x00010000 { ; load address = execution address
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x00010000
#endif

LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
/* Version 4.2.0 */
/* */

#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 65536
#endif

MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 65536
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 8192
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */

if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00010000; }

/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x0000FFFF;
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
define symbol __NVIC_start__ = 0x20000000;
define symbol __NVIC_end__ = 0x20000093;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000094;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#! armcc -E
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x00000000 0x00040000 { ; load region size_region
ER_IROM1 0x00000000 0x00040000 { ; load address = execution address
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x00040000
#endif

LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#! armcc -E
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x00000000 0x00040000 { ; load region size_region
ER_IROM1 0x00000000 0x00040000 { ; load address = execution address
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x00040000
#endif

LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
/* Version 4.2.0 */
/* */

#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 262144
#endif

MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 262144
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 32768
}
/* MBED: mbed needs to be able to dynamically set the interrupt vector table.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */

if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00040000; }

/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF;
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
define symbol __NVIC_start__ = 0x20000000;
define symbol __NVIC_end__ = 0x200000DF;
define symbol __ICFEDIT_region_RAM_start__ = 0x200000E0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#! armcc -E
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x00000000 0x00040000 { ; load region size_region
ER_IROM1 0x00000000 0x00040000 { ; load address = execution address
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x00040000
#endif

LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#! armcc -E
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x00000000 0x00040000 { ; load region size_region
ER_IROM1 0x00000000 0x00040000 { ; load address = execution address
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x00040000
#endif

LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
/* Version 4.2.0 */
/* */

#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 262144
#endif

MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 262144
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 32768
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */

if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00040000; }

/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF;
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
define symbol __NVIC_start__ = 0x20000000;
define symbol __NVIC_end__ = 0x200000C7;
define symbol __ICFEDIT_region_RAM_start__ = 0x200000C8;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#! armcc -E
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x00000000 0x00100000 { ; load region size_region
ER_IROM1 0x00000000 0x00100000 { ; load address = execution address
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x00100000
#endif

LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
/* Version 5.1.2 */
/* */

#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 1048576
#endif

MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1048576
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 262144
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/* Version 5.1.1 */

/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00100000; }

/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x00100000-1);
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
define symbol __NVIC_start__ = 0x20000000;
define symbol __NVIC_end__ = 0x2000010B;
define symbol __ICFEDIT_region_RAM_start__ = 0x2000010C;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#! armcc -E
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x00000000 0x00040000 { ; load region size_region
ER_IROM1 0x00000000 0x00040000 { ; load address = execution address
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x00040000
#endif

LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#! armcc -E
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x00000000 0x00040000 { ; load region size_region
ER_IROM1 0x00000000 0x00040000 { ; load address = execution address
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x00000000
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x00040000
#endif

LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
Expand Down
Loading

0 comments on commit 5d906a7

Please sign in to comment.