Skip to content

Commit

Permalink
Merge pull request #1 from jeromecoutant/REVIEW_13723
Browse files Browse the repository at this point in the history
Review 13723
  • Loading branch information
boraozgen authored Oct 9, 2020
2 parents abb5b12 + 953b503 commit 518b594
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 39 deletions.
4 changes: 4 additions & 0 deletions platform/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@
"crash-capture-enabled": true,
"fatal-error-auto-reboot-enabled": true
},
"NUCLEO_F412ZG": {
"crash-capture-enabled": true,
"fatal-error-auto-reboot-enabled": true
},
"DISCO_F413ZH": {
"crash-capture-enabled": true,
"fatal-error-auto-reboot-enabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;******************************************************************************
;* @attention
;*
;* Copyright (c) 2014-2020 STMicroelectronics.
;* Copyright (c) 2016-2020 STMicroelectronics.
;* All rights reserved.
;*
;* This software component is licensed by ST under BSD 3-Clause license,
Expand Down Expand Up @@ -60,7 +60,7 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE {
.ANY (+RW +ZI)
}

ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - RAM_FIXED_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - RAM_FIXED_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
}

ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -MBED_CONF_TARGET_BOOT_STACK_SIZE { ; Stack region growing down
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,47 @@

/* Tools provide -DMBED_ROM_START=xxx -DMBED_ROM_SIZE=xxx -DMBED_RAM_START=xxx -DMBED_RAM_SIZE=xxx */

if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = MBED_ROM_START; }
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = MBED_ROM_SIZE; }

/* [ROM = 512kb = 0x80000] */
define symbol __intvec_start__ = MBED_APP_START;
define symbol __region_ROM_start__ = MBED_APP_START;
define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;

/* [RAM = 128kb = 0x20000] Vector table dynamic copy: 102 vectors = 408 bytes (0x198) to be reserved in RAM */
define symbol __NVIC_start__ = 0x20000000;
define symbol __NVIC_end__ = 0x20000197; /* Aligned on 8 bytes */
define symbol __region_CRASH_DATA_RAM_start__ = 0x20000198;
define symbol __region_CRASH_DATA_RAM_end__ = 0x20000297;
define symbol __region_RAM_start__ = 0x20000298;
define symbol __region_RAM_end__ = 0x2001FFFF;

/* Memory regions */
define memory mem with size = 4G;
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
define region CRASH_DATA_RAM_region = mem:[from __region_CRASH_DATA_RAM_start__ to __region_CRASH_DATA_RAM_end__];
define region RAM_region = mem:[from __region_RAM_start__ to __region_RAM_end__];
define symbol VECTORS = 102; /* This value must match NVIC_NUM_VECTORS in cmsis_nvic.h */
define symbol HEAP_SIZE = 0xa000;

/* Common - Do not change */

if (!isdefinedsymbol(MBED_APP_START)) {
define symbol MBED_APP_START = MBED_ROM_START;
}

/* Define Crash Data Symbols */
define exported symbol __CRASH_DATA_RAM_START__ = __region_CRASH_DATA_RAM_start__;
define exported symbol __CRASH_DATA_RAM_END__ = __region_CRASH_DATA_RAM_end__;
if (!isdefinedsymbol(MBED_APP_SIZE)) {
define symbol MBED_APP_SIZE = MBED_ROM_SIZE;
}

/* Stack and Heap */
if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
/* This value is normally defined by the tools
to 0x1000 for bare metal and 0x400 for RTOS */
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
}
define symbol __size_cstack__ = MBED_CONF_TARGET_BOOT_STACK_SIZE;
define symbol __size_heap__ = 0x15000;
define block CSTACK with alignment = 8, size = __size_cstack__ { };
define block HEAP with alignment = 8, size = __size_heap__ { };
define block STACKHEAP with fixed order { block HEAP, block CSTACK };

initialize by copy with packing = zeros { readwrite };
/* Round up VECTORS_SIZE to 8 bytes */
define symbol VECTORS_SIZE = ((VECTORS * 4) + 7) & ~7;

define symbol CRASH_DATA_START = MBED_RAM_START + VECTORS_SIZE;
define symbol CRASH_DATA_SIZE = 0x100;
define exported symbol __CRASH_DATA_RAM_START__ = CRASH_DATA_START;

define symbol RAM_REGION_START = CRASH_DATA_START + CRASH_DATA_SIZE;
define symbol RAM_REGION_SIZE = MBED_RAM_SIZE - VECTORS_SIZE - CRASH_DATA_SIZE;

define memory mem with size = 4G;
define region ROM_region = mem:[from MBED_APP_START size MBED_APP_SIZE];
define region RAM_region = mem:[from RAM_REGION_START size RAM_REGION_SIZE];

define block CSTACK with alignment = 8, size = MBED_CONF_TARGET_BOOT_STACK_SIZE { };
define block HEAP with alignment = 8, size = HEAP_SIZE { };

initialize by copy { readwrite };
do not initialize { section .noinit };

place at address mem:__intvec_start__ { readonly section .intvec };
place at address mem: MBED_APP_START { readonly section .intvec };

place in ROM_region { readonly };
place in RAM_region { readwrite, block STACKHEAP };
place in RAM_region { readwrite,
block CSTACK, block HEAP };
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#define MBED_IRAM1_SIZE (MBED_RAM_SIZE - VECTORS_SIZE - MBED_CRASH_REPORT_RAM_SIZE)


#define RAM_FIXED_SIZE (MBED_BOOT_STACK_SIZE + VECTORS_SIZE + MBED_CRASH_REPORT_RAM_SIZE)
#define RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE + VECTORS_SIZE + MBED_CRASH_REPORT_RAM_SIZE)

LR_IROM1 MBED_APP_START MBED_APP_SIZE {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,20 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) {
}

if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
/* This value is normally defined by the tools
/* This value is normally defined by the tools
to 0x1000 for bare metal and 0x400 for RTOS */
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
}

/* Round up VECTORS_SIZE to 8 bytes */
define symbol VECTORS_SIZE = ((VECTORS * 4) + 7) & ~7;
define symbol RAM_REGION_START = MBED_RAM_START + VECTORS_SIZE;
define symbol RAM_REGION_SIZE = MBED_RAM_SIZE - VECTORS_SIZE;

define symbol CRASH_DATA_START = MBED_RAM_START + VECTORS_SIZE;
define symbol CRASH_DATA_SIZE = 0x100;
define exported symbol __CRASH_DATA_RAM_START__ = CRASH_DATA_START;

define symbol RAM_REGION_START = CRASH_DATA_START + CRASH_DATA_SIZE;
define symbol RAM_REGION_SIZE = MBED_RAM_SIZE - VECTORS_SIZE - CRASH_DATA_SIZE;

define memory mem with size = 4G;
define region ROM_region = mem:[from MBED_APP_START size MBED_APP_SIZE];
Expand Down

0 comments on commit 518b594

Please sign in to comment.