Skip to content

STM32F7: linker scripts updates #11870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#! armcc -E
; Scatter-Loading Description File
;
; SPDX-License-Identifier: BSD-3-Clause
;******************************************************************************
;* @attention
;*
Expand All @@ -12,18 +14,28 @@
;* opensource.org/licenses/BSD-3-Clause
;*
;******************************************************************************
#include "../cmsis_nvic.h"

; STM32F746xG:
; FLASH: 1024K (0x100000) @0x08000000
; RAM1: 256K (0x40000) @0x20010000
; RAM2: 64K (0x10000) @0x20000000
; FLASH: 1024K (0x100000) @0x08000000
; SRAM1: 240K (0x3C000) @0x20010000
; SRAM2: 16K (0x4000) @0x2004C000
; DTCM-RAM: 64K (0x10000) @0x20000000
; ITCM-RAM: 16K (0x3FFF) @0x00000000

#define MBED_ROM_START 0x8000000
#define MBED_ROM_SIZE 0x100000
#define MBED_RAM_START 0x20010000
#define MBED_RAM_SIZE 0x40000
#define MBED_RAM1_START 0x20000000
#define MBED_RAM1_SIZE 0x10000

#if !defined(MBED_APP_START)
#define MBED_APP_START 0x08000000
#define MBED_APP_START MBED_ROM_START
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x100000
#define MBED_APP_SIZE MBED_ROM_SIZE
#endif

#if !defined(MBED_BOOT_STACK_SIZE)
Expand All @@ -32,14 +44,14 @@

#define Stack_Size MBED_BOOT_STACK_SIZE

#define MBED_RAM_START 0x20010000
#define MBED_RAM_SIZE 0x40000
#define MBED_VECTTABLE_RAM_START 0x20000000
#define MBED_VECTTABLE_RAM_SIZE 0x1C8
#define MBED_VECTTABLE_RAM_START (NVIC_RAM_VECTOR_ADDRESS)
#define MBED_VECTTABLE_RAM_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)

#define MBED_CRASH_REPORT_RAM_START (MBED_VECTTABLE_RAM_START + MBED_VECTTABLE_RAM_SIZE)
#define MBED_CRASH_REPORT_RAM_SIZE 0x100
#define MBED_RAM0_START (MBED_RAM_START)
#define MBED_RAM0_SIZE (MBED_RAM_SIZE)

#define MBED_RAM0_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
#define MBED_RAM0_SIZE (MBED_RAM_SIZE + MBED_RAM1_SIZE - MBED_VECTTABLE_RAM_SIZE - MBED_CRASH_REPORT_RAM_SIZE)

LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region

Expand All @@ -59,4 +71,3 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
ARM_LIB_STACK (MBED_RAM0_START+MBED_RAM0_SIZE) EMPTY -Stack_Size { ; stack
}
}

Original file line number Diff line number Diff line change
@@ -1,25 +1,59 @@
/* Linker script to configure memory regions. */

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif

STACK_SIZE = MBED_BOOT_STACK_SIZE;
/*
* SPDX-License-Identifier: BSD-3-Clause
******************************************************************************
* @attention
*
* Copyright (c) 2016-2019 STMicroelectronics.
* All rights reserved.
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
#include "../cmsis_nvic.h"

/* STM32F746xG:
FLASH: 1024K (0x100000) @0x08000000
SRAM1: 240K (0x3C000) @0x20010000
SRAM2: 16K (0x4000) @0x2004C000
DTCM-RAM: 64K (0x10000) @0x20000000
ITCM-RAM: 16K (0x3FFF) @0x00000000
*/

#define MBED_ROM_START 0x8000000
#define MBED_ROM_SIZE 0x100000
#define MBED_RAM_START 0x20010000
#define MBED_RAM_SIZE 0x40000
#define MBED_RAM1_START 0x20000000
#define MBED_RAM1_SIZE 0x10000

#if !defined(MBED_APP_START)
#define MBED_APP_START 0x08000000
#define MBED_APP_START MBED_ROM_START
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 1024K
#define MBED_APP_SIZE MBED_ROM_SIZE
#endif

M_CRASH_DATA_RAM_SIZE = 0x100;

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif
STACK_SIZE = MBED_BOOT_STACK_SIZE;

#define MBED_VECTTABLE_RAM_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
#define MBED_RAM0_START (MBED_RAM1_START + MBED_VECTTABLE_RAM_SIZE)
#define MBED_RAM0_SIZE (MBED_RAM_SIZE + MBED_RAM1_SIZE - MBED_VECTTABLE_RAM_SIZE)

MEMORY
{
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
RAM (rwx) : ORIGIN = 0x200001C8, LENGTH = 320K - 0x1C8
RAM (rwx) : ORIGIN = MBED_RAM0_START, LENGTH = MBED_RAM0_SIZE
}

/* Linker script to place sections and symbol values. Should be used together
Expand Down Expand Up @@ -93,7 +127,7 @@ SECTIONS

__etext = .;
_sidata = .;

.crash_data_ram :
{
. = ALIGN(8);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,61 @@
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x100000; }
/* Linker script to configure memory regions.
*
* SPDX-License-Identifier: BSD-3-Clause
******************************************************************************
* @attention
*
* Copyright (c) 2016-2019 STMicroelectronics.
* All rights reserved.
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/

/* STM32F746xG:
FLASH: 1024K (0x100000) @0x08000000
SRAM1: 240K (0x3C000) @0x20010000
SRAM2: 16K (0x4000) @0x2004C000
DTCM-RAM: 64K (0x10000) @0x20000000
ITCM-RAM: 16K (0x3FFF) @0x00000000
*/

if (!isdefinedsymbol(MBED_ROM_START)) { define symbol MBED_ROM_START = 0x8000000; }
if (!isdefinedsymbol(MBED_ROM_SIZE)) { define symbol MBED_ROM_SIZE = 0x200000; }
if (!isdefinedsymbol(MBED_RAM_START)) { define symbol MBED_RAM_START = 0x20010000; }
if (!isdefinedsymbol(MBED_RAM_START)) { define symbol MBED_RAM_SIZE = 0x40000; }
if (!isdefinedsymbol(MBED_RAM1_START)) { define symbol MBED_RAM1_START = 0x20000000; }
if (!isdefinedsymbol(MBED_RAM1_SIZE)) { define symbol MBED_RAM1_SIZE = 0x10000; }

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 = 1024kb = 0x100000] */
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 = 320kb = 0x50000] Vector table dynamic copy: 114 vectors = 456 bytes (0x1C8) to be reserved in RAM */
define symbol __NVIC_start__ = 0x20000000;
define symbol __NVIC_end__ = 0x200001C7; /* Aligned on 8 bytes */
define symbol __region_CRASH_DATA_RAM_start__ = 0x200001C8;
define symbol __region_CRASH_DATA_RAM_end__ = 0x200002C7;
define symbol __region_RAM_start__ = 0x200002C8;
define symbol __region_RAM_end__ = 0x2004FFFF;
define symbol NVIC_NUM_VECTORS = 114; /* This value must match NVIC_NUM_VECTORS in ../cmsis_nvic.h */
define symbol MBED_VECTTABLE_RAM_SIZE = ((NVIC_NUM_VECTORS * 4) + 7) & ~7;
define symbol M_CRASH_DATA_RAM_SIZE = 0x100;

define symbol __NVIC_start__ = MBED_RAM1_START;
define symbol __region_CRASH_DATA_RAM_start__ = MBED_RAM1_START + MBED_VECTTABLE_RAM_SIZE;
define symbol __NVIC_end__ = __region_CRASH_DATA_RAM_start__ - 1;
define symbol __region_RAM_start__ = __region_CRASH_DATA_RAM_start__ + M_CRASH_DATA_RAM_SIZE;
define symbol __region_CRASH_DATA_RAM_end__ = __region_RAM_start__ - 1;
define symbol __region_RAM_end__ = MBED_RAM1_START + MBED_RAM_SIZE + MBED_RAM1_SIZE - 1;

define symbol __region_ITCMRAM_start__ = 0x00000000;
define symbol __region_ITCMRAM_end__ = 0x00003FFF;

/* Memory regions */
define memory mem with size = 4G;
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
define region RAM_region = mem:[from __region_RAM_start__ to __region_RAM_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 region ITCMRAM_region = mem:[from __region_ITCMRAM_start__ to __region_ITCMRAM_end__];

/* Define Crash Data Symbols */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#! armcc -E
; Scatter-Loading Description File
;
; SPDX-License-Identifier: BSD-3-Clause
;******************************************************************************
;* @attention
;*
Expand All @@ -12,18 +14,28 @@
;* opensource.org/licenses/BSD-3-Clause
;*
;******************************************************************************
#include "../cmsis_nvic.h"

; STM32F756xG:
; FLASH: 1024K (0x100000) @0x08000000
; RAM1: 256K (0x40000) @0x20010000
; RAM2: 64K (0x10000) @0x20000000
; FLASH: 1024K (0x100000) @0x08000000
; SRAM1: 240K (0x3C000) @0x20010000
; SRAM2: 16K (0x4000) @0x2004C000
; DTCM-RAM: 64K (0x10000) @0x20000000
; ITCM-RAM: 16K (0x3FFF) @0x00000000

#define MBED_ROM_START 0x8000000
#define MBED_ROM_SIZE 0x100000
#define MBED_RAM_START 0x20010000
#define MBED_RAM_SIZE 0x40000
#define MBED_RAM1_START 0x20000000
#define MBED_RAM1_SIZE 0x10000

#if !defined(MBED_APP_START)
#define MBED_APP_START 0x08000000
#define MBED_APP_START MBED_ROM_START
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x100000
#define MBED_APP_SIZE MBED_ROM_SIZE
#endif

#if !defined(MBED_BOOT_STACK_SIZE)
Expand All @@ -32,14 +44,14 @@

#define Stack_Size MBED_BOOT_STACK_SIZE

#define MBED_RAM_START 0x20010000
#define MBED_RAM_SIZE 0x40000
#define MBED_VECTTABLE_RAM_START 0x20000000
#define MBED_VECTTABLE_RAM_SIZE 0x1C8
#define MBED_VECTTABLE_RAM_START (NVIC_RAM_VECTOR_ADDRESS)
#define MBED_VECTTABLE_RAM_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)

#define MBED_CRASH_REPORT_RAM_START (MBED_VECTTABLE_RAM_START + MBED_VECTTABLE_RAM_SIZE)
#define MBED_CRASH_REPORT_RAM_SIZE 0x100
#define MBED_RAM0_START (MBED_RAM_START)
#define MBED_RAM0_SIZE (MBED_RAM_SIZE)

#define MBED_RAM0_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
#define MBED_RAM0_SIZE (MBED_RAM_SIZE + MBED_RAM1_SIZE - MBED_VECTTABLE_RAM_SIZE - MBED_CRASH_REPORT_RAM_SIZE)

LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region

Expand All @@ -59,4 +71,3 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
ARM_LIB_STACK (MBED_RAM0_START+MBED_RAM0_SIZE) EMPTY -Stack_Size { ; stack
}
}

Original file line number Diff line number Diff line change
@@ -1,25 +1,59 @@
/* Linker script to configure memory regions. */

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif

STACK_SIZE = MBED_BOOT_STACK_SIZE;
/*
* SPDX-License-Identifier: BSD-3-Clause
******************************************************************************
* @attention
*
* Copyright (c) 2016-2019 STMicroelectronics.
* All rights reserved.
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
#include "../cmsis_nvic.h"

/* STM32F756xG:
FLASH: 1024K (0x100000) @0x08000000
SRAM1: 240K (0x3C000) @0x20010000
SRAM2: 16K (0x4000) @0x2004C000
DTCM-RAM: 64K (0x10000) @0x20000000
ITCM-RAM: 16K (0x3FFF) @0x00000000
*/

#define MBED_ROM_START 0x8000000
#define MBED_ROM_SIZE 0x100000
#define MBED_RAM_START 0x20010000
#define MBED_RAM_SIZE 0x40000
#define MBED_RAM1_START 0x20000000
#define MBED_RAM1_SIZE 0x10000

#if !defined(MBED_APP_START)
#define MBED_APP_START 0x08000000
#define MBED_APP_START MBED_ROM_START
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 1024K
#define MBED_APP_SIZE MBED_ROM_SIZE
#endif

M_CRASH_DATA_RAM_SIZE = 0x100;

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif
STACK_SIZE = MBED_BOOT_STACK_SIZE;

#define MBED_VECTTABLE_RAM_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
#define MBED_RAM0_START (MBED_RAM1_START + MBED_VECTTABLE_RAM_SIZE)
#define MBED_RAM0_SIZE (MBED_RAM_SIZE + MBED_RAM1_SIZE - MBED_VECTTABLE_RAM_SIZE)

MEMORY
{
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
RAM (rwx) : ORIGIN = 0x200001C8, LENGTH = 320K - 0x1C8
RAM (rwx) : ORIGIN = MBED_RAM0_START, LENGTH = MBED_RAM0_SIZE
}

/* Linker script to place sections and symbol values. Should be used together
Expand Down Expand Up @@ -93,7 +127,7 @@ SECTIONS

__etext = .;
_sidata = .;

.crash_data_ram :
{
. = ALIGN(8);
Expand Down
Loading