mirror of https://github.com/ARMmbed/mbed-os.git
STM32L4 baremetal support
parent
ba7deb4660
commit
0a447ac798
|
@ -1,61 +1,53 @@
|
||||||
#! armcc -E
|
#! armcc -E
|
||||||
; Scatter-Loading Description File
|
; Scatter-Loading Description File
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
; Copyright (c) 2015, STMicroelectronics
|
|
||||||
; All rights reserved.
|
|
||||||
;
|
;
|
||||||
; Redistribution and use in source and binary forms, with or without
|
; SPDX-License-Identifier: BSD-3-Clause
|
||||||
; modification, are permitted provided that the following conditions are met:
|
;******************************************************************************
|
||||||
;
|
;* @attention
|
||||||
; 1. Redistributions of source code must retain the above copyright notice,
|
;*
|
||||||
; this list of conditions and the following disclaimer.
|
;* Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
; 2. Redistributions in binary form must reproduce the above copyright notice,
|
;* All rights reserved.
|
||||||
; this list of conditions and the following disclaimer in the documentation
|
;*
|
||||||
; and/or other materials provided with the distribution.
|
;* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
; 3. Neither the name of STMicroelectronics nor the names of its contributors
|
;* the "License"; You may not use this file except in compliance with the
|
||||||
; may be used to endorse or promote products derived from this software
|
;* License. You may obtain a copy of the License at:
|
||||||
; without specific prior written permission.
|
;* opensource.org/licenses/BSD-3-Clause
|
||||||
;
|
;*
|
||||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
;******************************************************************************
|
||||||
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
#include "../cmsis_nvic.h"
|
||||||
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 0x40000
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
|
||||||
|
|
||||||
; 256KB FLASH (0x40000) + 64KB SRAM (0x10000)
|
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
|
|
||||||
|
|
||||||
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
|
ER_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||||
*.o (RESET, +First)
|
*.o (RESET, +First)
|
||||||
*(InRoot$$Sections)
|
*(InRoot$$Sections)
|
||||||
.ANY (+RO)
|
.ANY (+RO)
|
||||||
}
|
}
|
||||||
|
|
||||||
; Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
|
RW_IRAM1 (MBED_RAM_START + VECTORS_SIZE) { ; RW data
|
||||||
RW_IRAM1 (0x20000000+0x188) (0x00010000-0x188-Stack_Size) {
|
.ANY (+RW +ZI)
|
||||||
.ANY (+RW +ZI)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ARM_LIB_STACK (0x20000000+0x00010000) EMPTY -Stack_Size { ; stack
|
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE + MBED_RAM1_SIZE - MBED_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
|
||||||
|
}
|
||||||
|
|
||||||
|
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE + MBED_RAM1_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; Stack region growing down
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +1,44 @@
|
||||||
|
/* Linker script to configure memory regions. */
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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"
|
||||||
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 256k
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
STACK_SIZE = MBED_BOOT_STACK_SIZE;
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
|
||||||
|
|
||||||
/* Linker script to configure memory regions. */
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
||||||
SRAM1 (rwx) : ORIGIN = 0x20000188, LENGTH = 64k - 0x188
|
RAM (rwx) : ORIGIN = MBED_RAM_START + VECTORS_SIZE, LENGTH = MBED_RAM_SIZE + MBED_RAM1_SIZE - VECTORS_SIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Linker script to place sections and symbol values. Should be used together
|
/* Linker script to place sections and symbol values. Should be used together
|
||||||
|
@ -54,6 +76,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
KEEP(*(.isr_vector))
|
KEEP(*(.isr_vector))
|
||||||
*(.text*)
|
*(.text*)
|
||||||
|
|
||||||
KEEP(*(.init))
|
KEEP(*(.init))
|
||||||
KEEP(*(.fini))
|
KEEP(*(.fini))
|
||||||
|
|
||||||
|
@ -111,7 +134,6 @@ SECTIONS
|
||||||
KEEP(*(.init_array))
|
KEEP(*(.init_array))
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
PROVIDE_HIDDEN (__init_array_end = .);
|
||||||
|
|
||||||
|
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
/* finit data */
|
/* finit data */
|
||||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||||
|
@ -125,7 +147,20 @@ SECTIONS
|
||||||
__data_end__ = .;
|
__data_end__ = .;
|
||||||
_edata = .;
|
_edata = .;
|
||||||
|
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
|
/* Uninitialized data section
|
||||||
|
* This region is not initialized by the C/C++ library and can be used to
|
||||||
|
* store state across soft reboots. */
|
||||||
|
.uninitialized (NOLOAD):
|
||||||
|
{
|
||||||
|
. = ALIGN(32);
|
||||||
|
__uninitialized_start = .;
|
||||||
|
*(.uninitialized)
|
||||||
|
KEEP(*(.keep.uninitialized))
|
||||||
|
. = ALIGN(32);
|
||||||
|
__uninitialized_end = .;
|
||||||
|
} > RAM
|
||||||
|
|
||||||
.bss :
|
.bss :
|
||||||
{
|
{
|
||||||
|
@ -137,16 +172,16 @@ SECTIONS
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
__bss_end__ = .;
|
__bss_end__ = .;
|
||||||
_ebss = .;
|
_ebss = .;
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
.heap (COPY):
|
.heap (COPY):
|
||||||
{
|
{
|
||||||
__end__ = .;
|
__end__ = .;
|
||||||
end = __end__;
|
PROVIDE(end = .);
|
||||||
*(.heap*)
|
*(.heap*)
|
||||||
. = ORIGIN(SRAM1) + LENGTH(SRAM1) - STACK_SIZE;
|
. = ORIGIN(RAM) + LENGTH(RAM) - MBED_BOOT_STACK_SIZE;
|
||||||
__HeapLimit = .;
|
__HeapLimit = .;
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
/* .stack_dummy section doesn't contains any symbols. It is only
|
/* .stack_dummy section doesn't contains any symbols. It is only
|
||||||
* used for linker to calculate size of stack sections, and assign
|
* used for linker to calculate size of stack sections, and assign
|
||||||
|
@ -154,13 +189,13 @@ SECTIONS
|
||||||
.stack_dummy (COPY):
|
.stack_dummy (COPY):
|
||||||
{
|
{
|
||||||
*(.stack*)
|
*(.stack*)
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
/* Set stack top to end of RAM, and stack limit move down by
|
/* Set stack top to end of RAM, and stack limit move down by
|
||||||
* size of stack_dummy section */
|
* size of stack_dummy section */
|
||||||
__StackTop = ORIGIN(SRAM1) + LENGTH(SRAM1);
|
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
|
||||||
_estack = __StackTop;
|
_estack = __StackTop;
|
||||||
__StackLimit = __StackTop - STACK_SIZE;
|
__StackLimit = __StackTop - MBED_BOOT_STACK_SIZE;
|
||||||
PROVIDE(__stack = __StackTop);
|
PROVIDE(__stack = __StackTop);
|
||||||
|
|
||||||
/* Check if data + heap + stack exceeds RAM limit */
|
/* Check if data + heap + stack exceeds RAM limit */
|
||||||
|
|
|
@ -1,37 +1,59 @@
|
||||||
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
|
/* Linker script to configure memory regions.
|
||||||
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x40000; }
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* Device specific values */
|
||||||
|
|
||||||
/* [ROM = 256kb = 0x40000] */
|
/* Tools provide -DMBED_ROM_START=xxx -DMBED_ROM_SIZE=xxx -DMBED_RAM_START=xxx -DMBED_RAM_SIZE=xxx */
|
||||||
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 = 48kb + 16kb = 0x10000] */
|
define symbol VECTORS = 99; /* This value must match NVIC_NUM_VECTORS in cmsis_nvic.h */
|
||||||
/* Vector table dynamic copy: Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM */
|
define symbol HEAP_SIZE = 0x2000;
|
||||||
define symbol __NVIC_start__ = 0x20000000;
|
|
||||||
define symbol __NVIC_end__ = 0x20000187; /* Aligned on 8 bytes (392 = 98 x 4) */
|
|
||||||
define symbol __region_SRAM1_start__ = 0x20000188;
|
|
||||||
define symbol __region_SRAM1_end__ = 0x2000FFFF;
|
|
||||||
|
|
||||||
/* Memory regions */
|
/* Common - Do not change */
|
||||||
define memory mem with size = 4G;
|
|
||||||
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
|
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||||
define region SRAM1_region = mem:[from __region_SRAM1_start__ to __region_SRAM1_end__];
|
define symbol MBED_APP_START = MBED_ROM_START;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||||
|
define symbol MBED_APP_SIZE = MBED_ROM_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
||||||
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
||||||
}
|
}
|
||||||
|
|
||||||
define symbol __size_cstack__ = MBED_BOOT_STACK_SIZE;
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
define symbol __size_heap__ = 0x4000;
|
define symbol VECTORS_SIZE = ((VECTORS * 4) + 7) & ~7;
|
||||||
define block CSTACK with alignment = 8, size = __size_cstack__ { };
|
define symbol RAM_REGION_START = MBED_RAM_START + VECTORS_SIZE;
|
||||||
define block HEAP with alignment = 8, size = __size_heap__ { };
|
define symbol RAM_REGION_SIZE = MBED_RAM_SIZE + MBED_RAM1_SIZE - VECTORS_SIZE;
|
||||||
define block STACKHEAP with fixed order { block HEAP, block CSTACK };
|
|
||||||
|
|
||||||
initialize by copy with packing = zeros { readwrite };
|
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_BOOT_STACK_SIZE { };
|
||||||
|
define block HEAP with alignment = 8, size = HEAP_SIZE { };
|
||||||
|
|
||||||
|
initialize by copy { readwrite };
|
||||||
do not initialize { section .noinit };
|
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 ROM_region { readonly };
|
||||||
place in SRAM1_region { readwrite, block STACKHEAP };
|
place in RAM_region { readwrite,
|
||||||
|
block CSTACK, block HEAP };
|
||||||
|
|
|
@ -1,40 +1,47 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
*******************************************************************************
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
* Copyright (c) 2015, STMicroelectronics
|
******************************************************************************
|
||||||
* All rights reserved.
|
* @attention
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* <h2><center>© Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* All rights reserved.</center></h2>
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
* this list of conditions and the following disclaimer.
|
* the "License"; You may not use this file except in compliance with the
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
* License. You may obtain a copy of the License at:
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
* opensource.org/licenses/BSD-3-Clause
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
******************************************************************************
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
*/
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MBED_CMSIS_NVIC_H
|
#ifndef MBED_CMSIS_NVIC_H
|
||||||
#define MBED_CMSIS_NVIC_H
|
#define MBED_CMSIS_NVIC_H
|
||||||
|
|
||||||
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
|
#if !defined(MBED_ROM_START)
|
||||||
// MCU Peripherals: 82 vectors = 328 bytes from 0x40 to 0x187
|
#define MBED_ROM_START 0x8000000
|
||||||
// Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
|
#endif
|
||||||
#define NVIC_NUM_VECTORS 98
|
|
||||||
#define NVIC_RAM_VECTOR_ADDRESS SRAM1_BASE // Vectors positioned at start of SRAM1
|
#if !defined(MBED_ROM_SIZE)
|
||||||
|
#define MBED_ROM_SIZE 0x40000 // 256 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_START)
|
||||||
|
#define MBED_RAM_START 0x20000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_SIZE)
|
||||||
|
#define MBED_RAM_SIZE 0xc000 // 48 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_START)
|
||||||
|
#define MBED_RAM1_START 0x10000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_SIZE)
|
||||||
|
#define MBED_RAM1_SIZE 0x4000 // 16 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define NVIC_NUM_VECTORS 99
|
||||||
|
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM_START
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,61 +1,53 @@
|
||||||
#! armcc -E
|
#! armcc -E
|
||||||
; Scatter-Loading Description File
|
; Scatter-Loading Description File
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
; Copyright (c) 2015, STMicroelectronics
|
|
||||||
; All rights reserved.
|
|
||||||
;
|
;
|
||||||
; Redistribution and use in source and binary forms, with or without
|
; SPDX-License-Identifier: BSD-3-Clause
|
||||||
; modification, are permitted provided that the following conditions are met:
|
;******************************************************************************
|
||||||
;
|
;* @attention
|
||||||
; 1. Redistributions of source code must retain the above copyright notice,
|
;*
|
||||||
; this list of conditions and the following disclaimer.
|
;* Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
; 2. Redistributions in binary form must reproduce the above copyright notice,
|
;* All rights reserved.
|
||||||
; this list of conditions and the following disclaimer in the documentation
|
;*
|
||||||
; and/or other materials provided with the distribution.
|
;* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
; 3. Neither the name of STMicroelectronics nor the names of its contributors
|
;* the "License"; You may not use this file except in compliance with the
|
||||||
; may be used to endorse or promote products derived from this software
|
;* License. You may obtain a copy of the License at:
|
||||||
; without specific prior written permission.
|
;* opensource.org/licenses/BSD-3-Clause
|
||||||
;
|
;*
|
||||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
;******************************************************************************
|
||||||
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
#include "../cmsis_nvic.h"
|
||||||
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 0x40000
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
|
||||||
|
|
||||||
; 256KB FLASH (0x40000) + 64KB SRAM (0x10000)
|
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
|
|
||||||
|
|
||||||
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
|
ER_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||||
*.o (RESET, +First)
|
*.o (RESET, +First)
|
||||||
*(InRoot$$Sections)
|
*(InRoot$$Sections)
|
||||||
.ANY (+RO)
|
.ANY (+RO)
|
||||||
}
|
}
|
||||||
|
|
||||||
; Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
|
RW_IRAM1 (MBED_RAM_START + VECTORS_SIZE) { ; RW data
|
||||||
RW_IRAM1 (0x20000000+0x188) (0x00010000-0x188-Stack_Size) {
|
.ANY (+RW +ZI)
|
||||||
.ANY (+RW +ZI)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ARM_LIB_STACK (0x20000000+0x00010000) EMPTY -Stack_Size { ; stack
|
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE + MBED_RAM1_SIZE - MBED_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
|
||||||
|
}
|
||||||
|
|
||||||
|
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE + MBED_RAM1_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; Stack region growing down
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +1,44 @@
|
||||||
|
/* Linker script to configure memory regions. */
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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"
|
||||||
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 256k
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
STACK_SIZE = MBED_BOOT_STACK_SIZE;
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
|
||||||
|
|
||||||
/* Linker script to configure memory regions. */
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
||||||
SRAM1 (rwx) : ORIGIN = 0x20000188, LENGTH = 64k - 0x188
|
RAM (rwx) : ORIGIN = MBED_RAM_START + VECTORS_SIZE, LENGTH = MBED_RAM_SIZE + MBED_RAM1_SIZE - VECTORS_SIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Linker script to place sections and symbol values. Should be used together
|
/* Linker script to place sections and symbol values. Should be used together
|
||||||
|
@ -54,6 +76,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
KEEP(*(.isr_vector))
|
KEEP(*(.isr_vector))
|
||||||
*(.text*)
|
*(.text*)
|
||||||
|
|
||||||
KEEP(*(.init))
|
KEEP(*(.init))
|
||||||
KEEP(*(.fini))
|
KEEP(*(.fini))
|
||||||
|
|
||||||
|
@ -111,7 +134,6 @@ SECTIONS
|
||||||
KEEP(*(.init_array))
|
KEEP(*(.init_array))
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
PROVIDE_HIDDEN (__init_array_end = .);
|
||||||
|
|
||||||
|
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
/* finit data */
|
/* finit data */
|
||||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||||
|
@ -125,7 +147,20 @@ SECTIONS
|
||||||
__data_end__ = .;
|
__data_end__ = .;
|
||||||
_edata = .;
|
_edata = .;
|
||||||
|
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
|
/* Uninitialized data section
|
||||||
|
* This region is not initialized by the C/C++ library and can be used to
|
||||||
|
* store state across soft reboots. */
|
||||||
|
.uninitialized (NOLOAD):
|
||||||
|
{
|
||||||
|
. = ALIGN(32);
|
||||||
|
__uninitialized_start = .;
|
||||||
|
*(.uninitialized)
|
||||||
|
KEEP(*(.keep.uninitialized))
|
||||||
|
. = ALIGN(32);
|
||||||
|
__uninitialized_end = .;
|
||||||
|
} > RAM
|
||||||
|
|
||||||
.bss :
|
.bss :
|
||||||
{
|
{
|
||||||
|
@ -137,16 +172,16 @@ SECTIONS
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
__bss_end__ = .;
|
__bss_end__ = .;
|
||||||
_ebss = .;
|
_ebss = .;
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
.heap (COPY):
|
.heap (COPY):
|
||||||
{
|
{
|
||||||
__end__ = .;
|
__end__ = .;
|
||||||
end = __end__;
|
PROVIDE(end = .);
|
||||||
*(.heap*)
|
*(.heap*)
|
||||||
. = ORIGIN(SRAM1) + LENGTH(SRAM1) - STACK_SIZE;
|
. = ORIGIN(RAM) + LENGTH(RAM) - MBED_BOOT_STACK_SIZE;
|
||||||
__HeapLimit = .;
|
__HeapLimit = .;
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
/* .stack_dummy section doesn't contains any symbols. It is only
|
/* .stack_dummy section doesn't contains any symbols. It is only
|
||||||
* used for linker to calculate size of stack sections, and assign
|
* used for linker to calculate size of stack sections, and assign
|
||||||
|
@ -154,13 +189,13 @@ SECTIONS
|
||||||
.stack_dummy (COPY):
|
.stack_dummy (COPY):
|
||||||
{
|
{
|
||||||
*(.stack*)
|
*(.stack*)
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
/* Set stack top to end of RAM, and stack limit move down by
|
/* Set stack top to end of RAM, and stack limit move down by
|
||||||
* size of stack_dummy section */
|
* size of stack_dummy section */
|
||||||
__StackTop = ORIGIN(SRAM1) + LENGTH(SRAM1);
|
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
|
||||||
_estack = __StackTop;
|
_estack = __StackTop;
|
||||||
__StackLimit = __StackTop - STACK_SIZE;
|
__StackLimit = __StackTop - MBED_BOOT_STACK_SIZE;
|
||||||
PROVIDE(__stack = __StackTop);
|
PROVIDE(__stack = __StackTop);
|
||||||
|
|
||||||
/* Check if data + heap + stack exceeds RAM limit */
|
/* Check if data + heap + stack exceeds RAM limit */
|
||||||
|
|
|
@ -1,37 +1,59 @@
|
||||||
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
|
/* Linker script to configure memory regions.
|
||||||
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x40000; }
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* Device specific values */
|
||||||
|
|
||||||
/* [ROM = 256kb = 0x40000] */
|
/* Tools provide -DMBED_ROM_START=xxx -DMBED_ROM_SIZE=xxx -DMBED_RAM_START=xxx -DMBED_RAM_SIZE=xxx */
|
||||||
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 = 48kb + 16kb = 0x10000] */
|
define symbol VECTORS = 99; /* This value must match NVIC_NUM_VECTORS in cmsis_nvic.h */
|
||||||
/* Vector table dynamic copy: Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM */
|
define symbol HEAP_SIZE = 0x2000;
|
||||||
define symbol __NVIC_start__ = 0x20000000;
|
|
||||||
define symbol __NVIC_end__ = 0x20000187; /* Aligned on 8 bytes (392 = 98 x 4) */
|
|
||||||
define symbol __region_SRAM1_start__ = 0x20000188;
|
|
||||||
define symbol __region_SRAM1_end__ = 0x2000FFFF;
|
|
||||||
|
|
||||||
/* Memory regions */
|
/* Common - Do not change */
|
||||||
define memory mem with size = 4G;
|
|
||||||
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
|
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||||
define region SRAM1_region = mem:[from __region_SRAM1_start__ to __region_SRAM1_end__];
|
define symbol MBED_APP_START = MBED_ROM_START;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||||
|
define symbol MBED_APP_SIZE = MBED_ROM_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
||||||
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
||||||
}
|
}
|
||||||
|
|
||||||
define symbol __size_cstack__ = MBED_BOOT_STACK_SIZE;
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
define symbol __size_heap__ = 0x4000;
|
define symbol VECTORS_SIZE = ((VECTORS * 4) + 7) & ~7;
|
||||||
define block CSTACK with alignment = 8, size = __size_cstack__ { };
|
define symbol RAM_REGION_START = MBED_RAM_START + VECTORS_SIZE;
|
||||||
define block HEAP with alignment = 8, size = __size_heap__ { };
|
define symbol RAM_REGION_SIZE = MBED_RAM_SIZE + MBED_RAM1_SIZE - VECTORS_SIZE;
|
||||||
define block STACKHEAP with fixed order { block HEAP, block CSTACK };
|
|
||||||
|
|
||||||
initialize by copy with packing = zeros { readwrite };
|
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_BOOT_STACK_SIZE { };
|
||||||
|
define block HEAP with alignment = 8, size = HEAP_SIZE { };
|
||||||
|
|
||||||
|
initialize by copy { readwrite };
|
||||||
do not initialize { section .noinit };
|
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 ROM_region { readonly };
|
||||||
place in SRAM1_region { readwrite, block STACKHEAP };
|
place in RAM_region { readwrite,
|
||||||
|
block CSTACK, block HEAP };
|
||||||
|
|
|
@ -1,40 +1,47 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
*******************************************************************************
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
* Copyright (c) 2015, STMicroelectronics
|
******************************************************************************
|
||||||
* All rights reserved.
|
* @attention
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* <h2><center>© Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* All rights reserved.</center></h2>
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
* this list of conditions and the following disclaimer.
|
* the "License"; You may not use this file except in compliance with the
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
* License. You may obtain a copy of the License at:
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
* opensource.org/licenses/BSD-3-Clause
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
******************************************************************************
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
*/
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MBED_CMSIS_NVIC_H
|
#ifndef MBED_CMSIS_NVIC_H
|
||||||
#define MBED_CMSIS_NVIC_H
|
#define MBED_CMSIS_NVIC_H
|
||||||
|
|
||||||
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
|
#if !defined(MBED_ROM_START)
|
||||||
// MCU Peripherals: 82 vectors = 328 bytes from 0x40 to 0x187
|
#define MBED_ROM_START 0x8000000
|
||||||
// Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
|
#endif
|
||||||
#define NVIC_NUM_VECTORS 98
|
|
||||||
#define NVIC_RAM_VECTOR_ADDRESS SRAM1_BASE // Vectors positioned at start of SRAM1
|
#if !defined(MBED_ROM_SIZE)
|
||||||
|
#define MBED_ROM_SIZE 0x40000 // 256 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_START)
|
||||||
|
#define MBED_RAM_START 0x20000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_SIZE)
|
||||||
|
#define MBED_RAM_SIZE 0xc000 // 48 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_START)
|
||||||
|
#define MBED_RAM1_START 0x10000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_SIZE)
|
||||||
|
#define MBED_RAM1_SIZE 0x4000 // 16 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define NVIC_NUM_VECTORS 99
|
||||||
|
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM_START
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,69 +1,37 @@
|
||||||
#! armcc -E
|
#! armcc -E
|
||||||
; Scatter-Loading Description File
|
; Scatter-Loading Description File
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
; Copyright (c) 2020, STMicroelectronics
|
|
||||||
; All rights reserved.
|
|
||||||
;
|
;
|
||||||
; Redistribution and use in source and binary forms, with or without
|
; SPDX-License-Identifier: BSD-3-Clause
|
||||||
; modification, are permitted provided that the following conditions are met:
|
;******************************************************************************
|
||||||
;
|
;* @attention
|
||||||
; 1. Redistributions of source code must retain the above copyright notice,
|
;*
|
||||||
; this list of conditions and the following disclaimer.
|
;* Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
; 2. Redistributions in binary form must reproduce the above copyright notice,
|
;* All rights reserved.
|
||||||
; this list of conditions and the following disclaimer in the documentation
|
;*
|
||||||
; and/or other materials provided with the distribution.
|
;* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
; 3. Neither the name of STMicroelectronics nor the names of its contributors
|
;* the "License"; You may not use this file except in compliance with the
|
||||||
; may be used to endorse or promote products derived from this software
|
;* License. You may obtain a copy of the License at:
|
||||||
; without specific prior written permission.
|
;* opensource.org/licenses/BSD-3-Clause
|
||||||
;
|
;*
|
||||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
;******************************************************************************
|
||||||
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
#include "../cmsis_nvic.h"
|
||||||
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
; 512KB FLASH (0x80000)
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 0x80000
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
|
||||||
|
|
||||||
; 128KB SRAM (0x20000) + 32KB SRAM (0x8000)
|
|
||||||
#if !defined(MBED_RAM_START)
|
|
||||||
#define MBED_RAM_START 0x20000000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
; RW data 128k L4-SRAM1
|
|
||||||
#if !defined(MBED_RAM_SIZE)
|
|
||||||
#define MBED_RAM_SIZE 0x20000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(MBED_RAM2_START)
|
|
||||||
#define MBED_RAM2_START 0x10000000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
; RW data 32k L4-ECC-SRAM2 retained in standby
|
|
||||||
#if !defined(MBED_RAM2_SIZE)
|
|
||||||
#define MBED_RAM2_SIZE 0x8000
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
; Total: 99 vectors = 396 bytes (0x18C+0x4) to be reserved in RAM
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
#if !defined(VECTOR_SIZE)
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
|
||||||
#define VECTOR_SIZE 0x190
|
|
||||||
#endif
|
|
||||||
|
|
||||||
; Crash report is enabled as default
|
; Crash report is enabled as default
|
||||||
#if !defined(MBED_CRASH_REPORT_RAM_SIZE)
|
#if !defined(MBED_CRASH_REPORT_RAM_SIZE)
|
||||||
|
@ -71,9 +39,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
;Vectors + Crash report - Fixed at start of RAM2 in sequence
|
;Vectors + Crash report - Fixed at start of RAM2 in sequence
|
||||||
#define MBED_IRAM2_SIZE (MBED_RAM2_SIZE - VECTOR_SIZE - MBED_CRASH_REPORT_RAM_SIZE)
|
#define MBED_IRAM2_SIZE (MBED_RAM1_SIZE - VECTORS_SIZE - MBED_CRASH_REPORT_RAM_SIZE)
|
||||||
|
|
||||||
#define MBED_CRASH_REPORT_RAM_START (MBED_RAM2_START + VECTOR_SIZE)
|
#define MBED_CRASH_REPORT_RAM_START (MBED_RAM1_START + VECTORS_SIZE)
|
||||||
#define MBED_IRAM2_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
|
#define MBED_IRAM2_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
|
||||||
|
|
||||||
; Minimum heap should be larger then smallest RAM bank (else can use
|
; Minimum heap should be larger then smallest RAM bank (else can use
|
||||||
|
@ -81,30 +49,28 @@
|
||||||
#define MINIMUM_HEAP 0x10000
|
#define MINIMUM_HEAP 0x10000
|
||||||
#define RAM_FIXED_SIZE MBED_BOOT_STACK_SIZE
|
#define RAM_FIXED_SIZE MBED_BOOT_STACK_SIZE
|
||||||
|
|
||||||
;Splitting the RW and ZI section in IRAM1 (MBED_RAM_SIZE-MINIMUM_HEAP = 0x10000 available)
|
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||||
;and IRAM2 (MBED_IRAM2_SIZE = 0x7D70 available)
|
|
||||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
|
|
||||||
|
|
||||||
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
|
ER_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||||
*.o (RESET, +First)
|
*.o (RESET, +First)
|
||||||
*(InRoot$$Sections)
|
*(InRoot$$Sections)
|
||||||
.ANY (+RO)
|
.ANY (+RO)
|
||||||
}
|
}
|
||||||
|
|
||||||
RW_m_crash_data MBED_CRASH_REPORT_RAM_START EMPTY MBED_CRASH_REPORT_RAM_SIZE { ; RW data
|
RW_m_crash_data MBED_CRASH_REPORT_RAM_START EMPTY MBED_CRASH_REPORT_RAM_SIZE { ; RW data
|
||||||
}
|
}
|
||||||
|
|
||||||
RW_IRAM1 MBED_RAM_START (MBED_RAM_SIZE-MINIMUM_HEAP) { ; RW data
|
RW_IRAM1 MBED_RAM_START (MBED_RAM_SIZE - MINIMUM_HEAP) { ; RW data
|
||||||
.ANY (+RW +ZI)
|
.ANY (+RW +ZI)
|
||||||
}
|
}
|
||||||
|
|
||||||
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) {
|
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
|
||||||
}
|
}
|
||||||
|
|
||||||
RW_IRAM2 MBED_IRAM2_START MBED_IRAM2_SIZE {
|
RW_IRAM2 MBED_IRAM2_START MBED_IRAM2_SIZE {
|
||||||
.ANY (+RW +ZI)
|
.ANY (+RW +ZI)
|
||||||
}
|
}
|
||||||
|
|
||||||
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; stack
|
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; Stack region growing down
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,47 @@
|
||||||
|
/* Linker script to configure memory regions. */
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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"
|
||||||
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 512k
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
M_CRASH_DATA_RAM_SIZE = 0x100;
|
M_CRASH_DATA_RAM_SIZE = 0x100;
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
STACK_SIZE = MBED_BOOT_STACK_SIZE;
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
|
||||||
|
|
||||||
/* Linker script to configure memory regions. */
|
|
||||||
/* 0x18C resevered for vectors; 8-byte aligned = 0x190 (0x18C + 0x4)*/
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
||||||
SRAM2 (rwx) : ORIGIN = 0x10000190, LENGTH = 32k - (0x18C+0x4)
|
SRAM2 (rwx) : ORIGIN = MBED_RAM1_START + VECTORS_SIZE, LENGTH = MBED_RAM1_SIZE - VECTORS_SIZE
|
||||||
SRAM1 (rwx) : ORIGIN = 0x20000000, LENGTH = 128k
|
SRAM1 (rwx) : ORIGIN = MBED_RAM_START, LENGTH = 0x20000
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Linker script to place sections and symbol values. Should be used together
|
/* Linker script to place sections and symbol values. Should be used together
|
||||||
|
@ -58,6 +79,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
KEEP(*(.isr_vector))
|
KEEP(*(.isr_vector))
|
||||||
*(.text*)
|
*(.text*)
|
||||||
|
|
||||||
KEEP(*(.init))
|
KEEP(*(.init))
|
||||||
KEEP(*(.fini))
|
KEEP(*(.fini))
|
||||||
|
|
||||||
|
@ -115,7 +137,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
__StackLimit = .;
|
__StackLimit = .;
|
||||||
*(.stack*);
|
*(.stack*);
|
||||||
. += STACK_SIZE - (. - __StackLimit);
|
. += MBED_BOOT_STACK_SIZE - (. - __StackLimit);
|
||||||
} > SRAM2
|
} > SRAM2
|
||||||
|
|
||||||
/* Set stack top to end of RAM, and stack limit move down by
|
/* Set stack top to end of RAM, and stack limit move down by
|
||||||
|
|
|
@ -1,40 +1,47 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
*******************************************************************************
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
* Copyright (c) 2015, STMicroelectronics
|
******************************************************************************
|
||||||
* All rights reserved.
|
* @attention
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* <h2><center>© Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* All rights reserved.</center></h2>
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
* this list of conditions and the following disclaimer.
|
* the "License"; You may not use this file except in compliance with the
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
* License. You may obtain a copy of the License at:
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
* opensource.org/licenses/BSD-3-Clause
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
******************************************************************************
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
*/
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MBED_CMSIS_NVIC_H
|
#ifndef MBED_CMSIS_NVIC_H
|
||||||
#define MBED_CMSIS_NVIC_H
|
#define MBED_CMSIS_NVIC_H
|
||||||
|
|
||||||
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
|
#if !defined(MBED_ROM_START)
|
||||||
// MCU Peripherals: 82 vectors = 328 bytes from 0x40 to 0x18b
|
#define MBED_ROM_START 0x8000000
|
||||||
// Total: 99 vectors = 396 bytes (0x18c) to be reserved in RAM
|
#endif
|
||||||
#define NVIC_NUM_VECTORS 99
|
|
||||||
#define NVIC_RAM_VECTOR_ADDRESS SRAM2_BASE // Vectors positioned at start of SRAM1
|
#if !defined(MBED_ROM_SIZE)
|
||||||
|
#define MBED_ROM_SIZE 0x80000 // 512 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_START)
|
||||||
|
#define MBED_RAM_START 0x20000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_SIZE)
|
||||||
|
#define MBED_RAM_SIZE 0x20000 // 128 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_START)
|
||||||
|
#define MBED_RAM1_START 0x10000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_SIZE)
|
||||||
|
#define MBED_RAM1_SIZE 0x8000 // 32 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define NVIC_NUM_VECTORS 101
|
||||||
|
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM1_START
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,69 +1,38 @@
|
||||||
#! armcc -E
|
#! armcc -E
|
||||||
; Scatter-Loading Description File
|
; Scatter-Loading Description File
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
; Copyright (c) 2015, STMicroelectronics
|
|
||||||
; All rights reserved.
|
|
||||||
;
|
;
|
||||||
; Redistribution and use in source and binary forms, with or without
|
; SPDX-License-Identifier: BSD-3-Clause
|
||||||
; modification, are permitted provided that the following conditions are met:
|
;******************************************************************************
|
||||||
;
|
;* @attention
|
||||||
; 1. Redistributions of source code must retain the above copyright notice,
|
;*
|
||||||
; this list of conditions and the following disclaimer.
|
;* Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
; 2. Redistributions in binary form must reproduce the above copyright notice,
|
;* All rights reserved.
|
||||||
; this list of conditions and the following disclaimer in the documentation
|
;*
|
||||||
; and/or other materials provided with the distribution.
|
;* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
; 3. Neither the name of STMicroelectronics nor the names of its contributors
|
;* the "License"; You may not use this file except in compliance with the
|
||||||
; may be used to endorse or promote products derived from this software
|
;* License. You may obtain a copy of the License at:
|
||||||
; without specific prior written permission.
|
;* opensource.org/licenses/BSD-3-Clause
|
||||||
;
|
;*
|
||||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
;******************************************************************************
|
||||||
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
#include "../cmsis_nvic.h"
|
||||||
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
; 1MB FLASH (0x100000)
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 0x100000
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
|
||||||
|
|
||||||
; 128KB SRAM (0x20000)
|
|
||||||
#if !defined(MBED_RAM_START)
|
|
||||||
#define MBED_RAM_START 0x20000000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
; RW data 96k L4-SRAM1
|
|
||||||
#if !defined(MBED_RAM_SIZE)
|
|
||||||
#define MBED_RAM_SIZE 0x18000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(MBED_RAM2_START)
|
|
||||||
#define MBED_RAM2_START 0x10000000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
; RW data 32k L4-ECC-SRAM2
|
|
||||||
#if !defined(MBED_RAM2_SIZE)
|
|
||||||
#define MBED_RAM2_SIZE 0x8000
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
; Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
#if !defined(VECTOR_SIZE)
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
|
||||||
#define VECTOR_SIZE 0x188
|
|
||||||
#endif
|
|
||||||
|
|
||||||
; Crash report enabled as default
|
; Crash report enabled as default
|
||||||
#if !defined(MBED_CRASH_REPORT_RAM_SIZE)
|
#if !defined(MBED_CRASH_REPORT_RAM_SIZE)
|
||||||
|
@ -71,40 +40,39 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
;Vectors + Crash report - Fixed at start of RAM2 in sequence
|
;Vectors + Crash report - Fixed at start of RAM2 in sequence
|
||||||
#define MBED_IRAM2_SIZE (MBED_RAM2_SIZE - VECTOR_SIZE - MBED_CRASH_REPORT_RAM_SIZE)
|
#define MBED_IRAM2_SIZE (MBED_RAM1_SIZE - VECTORS_SIZE - MBED_CRASH_REPORT_RAM_SIZE)
|
||||||
|
|
||||||
#define MBED_CRASH_REPORT_RAM_START (MBED_RAM2_START + VECTOR_SIZE)
|
#define MBED_CRASH_REPORT_RAM_START (MBED_RAM1_START + VECTORS_SIZE)
|
||||||
#define MBED_IRAM2_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
|
#define MBED_IRAM2_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
|
||||||
|
|
||||||
; Minimum heap should be larger then smallest RAM bank (else can use
|
; Minimum heap should be larger then smallest RAM bank (else can use
|
||||||
; that bank for heap) and less then largest RAM bank.
|
; that bank for heap) and less then largest RAM bank.
|
||||||
#define MINIMUM_HEAP 0x12000
|
#define MINIMUM_HEAP 0x12000
|
||||||
#define RAM_FIXED_SIZE MBED_BOOT_STACK_SIZE
|
|
||||||
|
|
||||||
;Splitting the RW and ZI section in IRAM1 (MBED_RAM_SIZE-MINIMUM_HEAP = 0x6000 available)
|
;Splitting the RW and ZI section in IRAM1 (MBED_RAM_SIZE-MINIMUM_HEAP = 0x6000 available)
|
||||||
;and IRAM2 (MBED_IRAM2_SIZE = 0x7D78 available)
|
;and IRAM2 (MBED_IRAM2_SIZE = 0x7D78 available)
|
||||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
|
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
|
||||||
|
|
||||||
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
|
ER_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||||
*.o (RESET, +First)
|
*.o (RESET, +First)
|
||||||
*(InRoot$$Sections)
|
*(InRoot$$Sections)
|
||||||
.ANY (+RO)
|
.ANY (+RO)
|
||||||
}
|
}
|
||||||
|
|
||||||
RW_m_crash_data MBED_CRASH_REPORT_RAM_START EMPTY MBED_CRASH_REPORT_RAM_SIZE { ; RW data
|
RW_m_crash_data MBED_CRASH_REPORT_RAM_START EMPTY MBED_CRASH_REPORT_RAM_SIZE { ; RW data
|
||||||
}
|
}
|
||||||
|
|
||||||
RW_IRAM1 MBED_RAM_START (MBED_RAM_SIZE-MINIMUM_HEAP) { ; RW data
|
RW_IRAM1 MBED_RAM_START (MBED_RAM_SIZE - MINIMUM_HEAP) { ; RW data
|
||||||
.ANY (+RW +ZI)
|
.ANY (+RW +ZI)
|
||||||
}
|
}
|
||||||
|
|
||||||
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) {
|
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
RW_IRAM2 MBED_IRAM2_START MBED_IRAM2_SIZE {
|
RW_IRAM2 MBED_IRAM2_START MBED_IRAM2_SIZE {
|
||||||
.ANY (+RW +ZI)
|
.ANY (+RW +ZI)
|
||||||
}
|
}
|
||||||
|
|
||||||
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; stack
|
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; stack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +1,47 @@
|
||||||
|
/* Linker script to configure memory regions. */
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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"
|
||||||
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 1024k
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
M_CRASH_DATA_RAM_SIZE = 0x100;
|
M_CRASH_DATA_RAM_SIZE = 0x100;
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
STACK_SIZE = MBED_BOOT_STACK_SIZE;
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
|
||||||
|
|
||||||
/* Linker script to configure memory regions. */
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
||||||
SRAM2 (rwx) : ORIGIN = 0x10000188, LENGTH = 32k - 0x188
|
SRAM2 (rwx) : ORIGIN = MBED_RAM1_START + VECTORS_SIZE, LENGTH = MBED_RAM1_SIZE - VECTORS_SIZE
|
||||||
SRAM1 (rwx) : ORIGIN = 0x20000000, LENGTH = 96k
|
SRAM1 (rwx) : ORIGIN = MBED_RAM_START, LENGTH = MBED_RAM_SIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Linker script to place sections and symbol values. Should be used together
|
/* Linker script to place sections and symbol values. Should be used together
|
||||||
|
@ -57,6 +79,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
KEEP(*(.isr_vector))
|
KEEP(*(.isr_vector))
|
||||||
*(.text*)
|
*(.text*)
|
||||||
|
|
||||||
KEEP(*(.init))
|
KEEP(*(.init))
|
||||||
KEEP(*(.fini))
|
KEEP(*(.fini))
|
||||||
|
|
||||||
|
@ -114,7 +137,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
__StackLimit = .;
|
__StackLimit = .;
|
||||||
*(.stack*);
|
*(.stack*);
|
||||||
. += STACK_SIZE - (. - __StackLimit);
|
. += MBED_BOOT_STACK_SIZE - (. - __StackLimit);
|
||||||
} > SRAM2
|
} > SRAM2
|
||||||
|
|
||||||
/* Set stack top to end of RAM, and stack limit move down by
|
/* Set stack top to end of RAM, and stack limit move down by
|
||||||
|
@ -155,7 +178,6 @@ SECTIONS
|
||||||
KEEP(*(.init_array))
|
KEEP(*(.init_array))
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
PROVIDE_HIDDEN (__init_array_end = .);
|
||||||
|
|
||||||
|
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
/* finit data */
|
/* finit data */
|
||||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/* Linker script to configure memory regions.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
|
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
|
||||||
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x100000; }
|
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x100000; }
|
||||||
|
|
||||||
|
|
|
@ -1,40 +1,47 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
*******************************************************************************
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
* Copyright (c) 2017, STMicroelectronics
|
******************************************************************************
|
||||||
* All rights reserved.
|
* @attention
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* <h2><center>© Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* All rights reserved.</center></h2>
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
* this list of conditions and the following disclaimer.
|
* the "License"; You may not use this file except in compliance with the
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
* License. You may obtain a copy of the License at:
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
* opensource.org/licenses/BSD-3-Clause
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
******************************************************************************
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
*/
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MBED_CMSIS_NVIC_H
|
#ifndef MBED_CMSIS_NVIC_H
|
||||||
#define MBED_CMSIS_NVIC_H
|
#define MBED_CMSIS_NVIC_H
|
||||||
|
|
||||||
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
|
#if !defined(MBED_ROM_START)
|
||||||
// MCU Peripherals: 82 vectors = 328 bytes from 0x40 to 0x187
|
#define MBED_ROM_START 0x8000000
|
||||||
// Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_ROM_SIZE)
|
||||||
|
#define MBED_ROM_SIZE 0x100000 // 1.0 MB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_START)
|
||||||
|
#define MBED_RAM_START 0x20000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_SIZE)
|
||||||
|
#define MBED_RAM_SIZE 0x18000 // 96 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_START)
|
||||||
|
#define MBED_RAM1_START 0x10000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_SIZE)
|
||||||
|
#define MBED_RAM1_SIZE 0x8000 // 32 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NVIC_NUM_VECTORS 98
|
#define NVIC_NUM_VECTORS 98
|
||||||
#define NVIC_RAM_VECTOR_ADDRESS 0x10000000 // Vectors positioned at start of SRAM2
|
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM1_START // Vectors positioned at start of SRAM2
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,77 +1,77 @@
|
||||||
#! armcc -E
|
#! armcc -E
|
||||||
; Scatter-Loading Description File
|
; Scatter-Loading Description File
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
; Copyright (c) 2015, STMicroelectronics
|
|
||||||
; All rights reserved.
|
|
||||||
;
|
;
|
||||||
; Redistribution and use in source and binary forms, with or without
|
; SPDX-License-Identifier: BSD-3-Clause
|
||||||
; modification, are permitted provided that the following conditions are met:
|
;******************************************************************************
|
||||||
;
|
;* @attention
|
||||||
; 1. Redistributions of source code must retain the above copyright notice,
|
;*
|
||||||
; this list of conditions and the following disclaimer.
|
;* Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
; 2. Redistributions in binary form must reproduce the above copyright notice,
|
;* All rights reserved.
|
||||||
; this list of conditions and the following disclaimer in the documentation
|
;*
|
||||||
; and/or other materials provided with the distribution.
|
;* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
; 3. Neither the name of STMicroelectronics nor the names of its contributors
|
;* the "License"; You may not use this file except in compliance with the
|
||||||
; may be used to endorse or promote products derived from this software
|
;* License. You may obtain a copy of the License at:
|
||||||
; without specific prior written permission.
|
;* opensource.org/licenses/BSD-3-Clause
|
||||||
;
|
;*
|
||||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
;******************************************************************************
|
||||||
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
#include "../cmsis_nvic.h"
|
||||||
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 0x100000
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MBED_RAM_START 0x20000000
|
|
||||||
#define MBED_RAM_SIZE 0x00018000
|
|
||||||
#define MBED_CRASH_REPORT_RAM_START (MBED_RAM_START)
|
|
||||||
#define MBED_CRASH_REPORT_RAM_SIZE 0x100
|
|
||||||
#define MBED_RAM0_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
|
|
||||||
#define MBED_RAM0_SIZE (MBED_RAM_SIZE - MBED_CRASH_REPORT_RAM_SIZE)
|
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
|
||||||
|
|
||||||
; 1MB FLASH (0x100000) + 128KB SRAM (0x20000)
|
; Crash report enabled as default
|
||||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
|
#if !defined(MBED_CRASH_REPORT_RAM_SIZE)
|
||||||
|
#define MBED_CRASH_REPORT_RAM_SIZE 0x100
|
||||||
|
#endif
|
||||||
|
|
||||||
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
|
;Vectors + Crash report - Fixed at start of RAM2 in sequence
|
||||||
|
#define MBED_IRAM2_SIZE (MBED_RAM1_SIZE - VECTORS_SIZE - MBED_CRASH_REPORT_RAM_SIZE)
|
||||||
|
|
||||||
|
#define MBED_CRASH_REPORT_RAM_START (MBED_RAM1_START + VECTORS_SIZE)
|
||||||
|
#define MBED_IRAM2_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
|
||||||
|
|
||||||
|
; Minimum heap should be larger then smallest RAM bank (else can use
|
||||||
|
; that bank for heap) and less then largest RAM bank.
|
||||||
|
#define MINIMUM_HEAP 0x12000
|
||||||
|
|
||||||
|
;Splitting the RW and ZI section in IRAM1 (MBED_RAM_SIZE-MINIMUM_HEAP = 0x6000 available)
|
||||||
|
;and IRAM2 (MBED_IRAM2_SIZE = 0x7D78 available)
|
||||||
|
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)
|
*.o (RESET, +First)
|
||||||
*(InRoot$$Sections)
|
*(InRoot$$Sections)
|
||||||
.ANY (+RO)
|
.ANY (+RO)
|
||||||
}
|
}
|
||||||
|
|
||||||
RW_m_crash_data MBED_CRASH_REPORT_RAM_START EMPTY MBED_CRASH_REPORT_RAM_SIZE { ; RW data
|
RW_m_crash_data MBED_CRASH_REPORT_RAM_START EMPTY MBED_CRASH_REPORT_RAM_SIZE { ; RW data
|
||||||
}
|
}
|
||||||
|
|
||||||
RW_IRAM1 MBED_RAM0_START MBED_RAM0_SIZE-Stack_Size { ; RW data 96k L4-SRAM1
|
RW_IRAM1 MBED_RAM_START (MBED_RAM_SIZE - MINIMUM_HEAP) { ; RW data
|
||||||
.ANY (+RW +ZI)
|
.ANY (+RW +ZI)
|
||||||
}
|
}
|
||||||
|
|
||||||
; Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
|
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
|
||||||
RW_IRAM2 (0x10000000+0x188) (0x08000-0x188) { ; RW data 32k L4-ECC-SRAM2 retained in standby
|
}
|
||||||
|
|
||||||
|
RW_IRAM2 MBED_IRAM2_START MBED_IRAM2_SIZE {
|
||||||
.ANY (+RW +ZI)
|
.ANY (+RW +ZI)
|
||||||
}
|
}
|
||||||
|
|
||||||
ARM_LIB_STACK (MBED_RAM0_START+MBED_RAM0_SIZE) EMPTY -Stack_Size { ; stack
|
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; stack
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,47 @@
|
||||||
|
/* Linker script to configure memory regions. */
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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"
|
||||||
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 1024k
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
M_CRASH_DATA_RAM_SIZE = 0x100;
|
M_CRASH_DATA_RAM_SIZE = 0x100;
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
STACK_SIZE = MBED_BOOT_STACK_SIZE;
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
|
||||||
|
|
||||||
/* Linker script to configure memory regions. */
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
||||||
SRAM2 (rwx) : ORIGIN = 0x10000188, LENGTH = 32k - 0x188
|
SRAM2 (rwx) : ORIGIN = MBED_RAM1_START + VECTORS_SIZE, LENGTH = MBED_RAM1_SIZE - VECTORS_SIZE
|
||||||
SRAM1 (rwx) : ORIGIN = 0x20000000, LENGTH = 96k
|
SRAM1 (rwx) : ORIGIN = MBED_RAM_START, LENGTH = MBED_RAM_SIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Linker script to place sections and symbol values. Should be used together
|
/* Linker script to place sections and symbol values. Should be used together
|
||||||
|
@ -57,6 +79,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
KEEP(*(.isr_vector))
|
KEEP(*(.isr_vector))
|
||||||
*(.text*)
|
*(.text*)
|
||||||
|
|
||||||
KEEP(*(.init))
|
KEEP(*(.init))
|
||||||
KEEP(*(.fini))
|
KEEP(*(.fini))
|
||||||
|
|
||||||
|
@ -114,7 +137,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
__StackLimit = .;
|
__StackLimit = .;
|
||||||
*(.stack*);
|
*(.stack*);
|
||||||
. += STACK_SIZE - (. - __StackLimit);
|
. += MBED_BOOT_STACK_SIZE - (. - __StackLimit);
|
||||||
} > SRAM2
|
} > SRAM2
|
||||||
|
|
||||||
/* Set stack top to end of RAM, and stack limit move down by
|
/* Set stack top to end of RAM, and stack limit move down by
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/* Linker script to configure memory regions.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
|
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
|
||||||
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x100000; }
|
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x100000; }
|
||||||
|
|
||||||
|
|
|
@ -1,40 +1,47 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
*******************************************************************************
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
* Copyright (c) 2015, STMicroelectronics
|
******************************************************************************
|
||||||
* All rights reserved.
|
* @attention
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* <h2><center>© Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* All rights reserved.</center></h2>
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
* this list of conditions and the following disclaimer.
|
* the "License"; You may not use this file except in compliance with the
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
* License. You may obtain a copy of the License at:
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
* opensource.org/licenses/BSD-3-Clause
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
******************************************************************************
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
*/
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MBED_CMSIS_NVIC_H
|
#ifndef MBED_CMSIS_NVIC_H
|
||||||
#define MBED_CMSIS_NVIC_H
|
#define MBED_CMSIS_NVIC_H
|
||||||
|
|
||||||
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
|
#if !defined(MBED_ROM_START)
|
||||||
// MCU Peripherals: 82 vectors = 328 bytes from 0x40 to 0x187
|
#define MBED_ROM_START 0x8000000
|
||||||
// Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_ROM_SIZE)
|
||||||
|
#define MBED_ROM_SIZE 0x100000 // 1.0 MB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_START)
|
||||||
|
#define MBED_RAM_START 0x20000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_SIZE)
|
||||||
|
#define MBED_RAM_SIZE 0x18000 // 96 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_START)
|
||||||
|
#define MBED_RAM1_START 0x10000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_SIZE)
|
||||||
|
#define MBED_RAM1_SIZE 0x8000 // 32 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NVIC_NUM_VECTORS 98
|
#define NVIC_NUM_VECTORS 98
|
||||||
#define NVIC_RAM_VECTOR_ADDRESS 0x10000000 // Vectors positioned at start of SRAM2
|
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM1_START // Vectors positioned at start of SRAM2
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,77 +1,77 @@
|
||||||
#! armcc -E
|
#! armcc -E
|
||||||
; Scatter-Loading Description File
|
; Scatter-Loading Description File
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
; Copyright (c) 2015, STMicroelectronics
|
|
||||||
; All rights reserved.
|
|
||||||
;
|
;
|
||||||
; Redistribution and use in source and binary forms, with or without
|
; SPDX-License-Identifier: BSD-3-Clause
|
||||||
; modification, are permitted provided that the following conditions are met:
|
;******************************************************************************
|
||||||
;
|
;* @attention
|
||||||
; 1. Redistributions of source code must retain the above copyright notice,
|
;*
|
||||||
; this list of conditions and the following disclaimer.
|
;* Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
; 2. Redistributions in binary form must reproduce the above copyright notice,
|
;* All rights reserved.
|
||||||
; this list of conditions and the following disclaimer in the documentation
|
;*
|
||||||
; and/or other materials provided with the distribution.
|
;* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
; 3. Neither the name of STMicroelectronics nor the names of its contributors
|
;* the "License"; You may not use this file except in compliance with the
|
||||||
; may be used to endorse or promote products derived from this software
|
;* License. You may obtain a copy of the License at:
|
||||||
; without specific prior written permission.
|
;* opensource.org/licenses/BSD-3-Clause
|
||||||
;
|
;*
|
||||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
;******************************************************************************
|
||||||
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
#include "../cmsis_nvic.h"
|
||||||
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 0x100000
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MBED_RAM_START 0x20000000
|
|
||||||
#define MBED_RAM_SIZE 0x00018000
|
|
||||||
#define MBED_CRASH_REPORT_RAM_START (MBED_RAM_START)
|
|
||||||
#define MBED_CRASH_REPORT_RAM_SIZE 0x100
|
|
||||||
#define MBED_RAM0_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
|
|
||||||
#define MBED_RAM0_SIZE (MBED_RAM_SIZE - MBED_CRASH_REPORT_RAM_SIZE)
|
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
|
||||||
|
|
||||||
; 1MB FLASH (0x100000) + 128KB SRAM (0x20000)
|
; Crash report enabled as default
|
||||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
|
#if !defined(MBED_CRASH_REPORT_RAM_SIZE)
|
||||||
|
#define MBED_CRASH_REPORT_RAM_SIZE 0x100
|
||||||
|
#endif
|
||||||
|
|
||||||
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
|
;Vectors + Crash report - Fixed at start of RAM2 in sequence
|
||||||
|
#define MBED_IRAM2_SIZE (MBED_RAM1_SIZE - VECTORS_SIZE - MBED_CRASH_REPORT_RAM_SIZE)
|
||||||
|
|
||||||
|
#define MBED_CRASH_REPORT_RAM_START (MBED_RAM1_START + VECTORS_SIZE)
|
||||||
|
#define MBED_IRAM2_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
|
||||||
|
|
||||||
|
; Minimum heap should be larger then smallest RAM bank (else can use
|
||||||
|
; that bank for heap) and less then largest RAM bank.
|
||||||
|
#define MINIMUM_HEAP 0x12000
|
||||||
|
|
||||||
|
;Splitting the RW and ZI section in IRAM1 (MBED_RAM_SIZE-MINIMUM_HEAP = 0x6000 available)
|
||||||
|
;and IRAM2 (MBED_IRAM2_SIZE = 0x7D78 available)
|
||||||
|
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)
|
*.o (RESET, +First)
|
||||||
*(InRoot$$Sections)
|
*(InRoot$$Sections)
|
||||||
.ANY (+RO)
|
.ANY (+RO)
|
||||||
}
|
}
|
||||||
|
|
||||||
RW_m_crash_data MBED_CRASH_REPORT_RAM_START EMPTY MBED_CRASH_REPORT_RAM_SIZE { ; RW data
|
RW_m_crash_data MBED_CRASH_REPORT_RAM_START EMPTY MBED_CRASH_REPORT_RAM_SIZE { ; RW data
|
||||||
}
|
}
|
||||||
|
|
||||||
RW_IRAM1 MBED_RAM0_START MBED_RAM0_SIZE-Stack_Size { ; RW data 96k L4-SRAM1
|
RW_IRAM1 MBED_RAM_START (MBED_RAM_SIZE - MINIMUM_HEAP) { ; RW data
|
||||||
.ANY (+RW +ZI)
|
.ANY (+RW +ZI)
|
||||||
}
|
}
|
||||||
|
|
||||||
; Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
|
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
|
||||||
RW_IRAM2 (0x10000000+0x188) (0x08000-0x188) { ; RW data 32k L4-ECC-SRAM2 retained in standby
|
}
|
||||||
|
|
||||||
|
RW_IRAM2 MBED_IRAM2_START MBED_IRAM2_SIZE {
|
||||||
.ANY (+RW +ZI)
|
.ANY (+RW +ZI)
|
||||||
}
|
}
|
||||||
|
|
||||||
ARM_LIB_STACK (MBED_RAM0_START+MBED_RAM0_SIZE) EMPTY -Stack_Size { ; stack
|
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; stack
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,47 @@
|
||||||
|
/* Linker script to configure memory regions. */
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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"
|
||||||
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 1024k
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
M_CRASH_DATA_RAM_SIZE = 0x100;
|
M_CRASH_DATA_RAM_SIZE = 0x100;
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
STACK_SIZE = MBED_BOOT_STACK_SIZE;
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
|
||||||
|
|
||||||
/* Linker script to configure memory regions. */
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
||||||
SRAM2 (rwx) : ORIGIN = 0x10000188, LENGTH = 32k - 0x188
|
SRAM2 (rwx) : ORIGIN = MBED_RAM1_START + VECTORS_SIZE, LENGTH = MBED_RAM1_SIZE - VECTORS_SIZE
|
||||||
SRAM1 (rwx) : ORIGIN = 0x20000000, LENGTH = 96k
|
SRAM1 (rwx) : ORIGIN = MBED_RAM_START, LENGTH = MBED_RAM_SIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Linker script to place sections and symbol values. Should be used together
|
/* Linker script to place sections and symbol values. Should be used together
|
||||||
|
@ -57,6 +79,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
KEEP(*(.isr_vector))
|
KEEP(*(.isr_vector))
|
||||||
*(.text*)
|
*(.text*)
|
||||||
|
|
||||||
KEEP(*(.init))
|
KEEP(*(.init))
|
||||||
KEEP(*(.fini))
|
KEEP(*(.fini))
|
||||||
|
|
||||||
|
@ -114,7 +137,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
__StackLimit = .;
|
__StackLimit = .;
|
||||||
*(.stack*);
|
*(.stack*);
|
||||||
. += STACK_SIZE - (. - __StackLimit);
|
. += MBED_BOOT_STACK_SIZE - (. - __StackLimit);
|
||||||
} > SRAM2
|
} > SRAM2
|
||||||
|
|
||||||
/* Set stack top to end of RAM, and stack limit move down by
|
/* Set stack top to end of RAM, and stack limit move down by
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/* Linker script to configure memory regions.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
|
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
|
||||||
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x100000; }
|
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x100000; }
|
||||||
|
|
||||||
|
|
|
@ -1,40 +1,47 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
*******************************************************************************
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
* Copyright (c) 2015, STMicroelectronics
|
******************************************************************************
|
||||||
* All rights reserved.
|
* @attention
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* <h2><center>© Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* All rights reserved.</center></h2>
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
* this list of conditions and the following disclaimer.
|
* the "License"; You may not use this file except in compliance with the
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
* License. You may obtain a copy of the License at:
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
* opensource.org/licenses/BSD-3-Clause
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
******************************************************************************
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
*/
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MBED_CMSIS_NVIC_H
|
#ifndef MBED_CMSIS_NVIC_H
|
||||||
#define MBED_CMSIS_NVIC_H
|
#define MBED_CMSIS_NVIC_H
|
||||||
|
|
||||||
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
|
#if !defined(MBED_ROM_START)
|
||||||
// MCU Peripherals: 82 vectors = 328 bytes from 0x40 to 0x187
|
#define MBED_ROM_START 0x8000000
|
||||||
// Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_ROM_SIZE)
|
||||||
|
#define MBED_ROM_SIZE 0x100000 // 1.0 MB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_START)
|
||||||
|
#define MBED_RAM_START 0x20000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_SIZE)
|
||||||
|
#define MBED_RAM_SIZE 0x18000 // 96 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_START)
|
||||||
|
#define MBED_RAM1_START 0x10000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_SIZE)
|
||||||
|
#define MBED_RAM1_SIZE 0x8000 // 32 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NVIC_NUM_VECTORS 98
|
#define NVIC_NUM_VECTORS 98
|
||||||
#define NVIC_RAM_VECTOR_ADDRESS 0x10000000 // Vectors positioned at start of SRAM2
|
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM1_START // Vectors positioned at start of SRAM2
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,62 +1,53 @@
|
||||||
#! armcc -E
|
#! armcc -E
|
||||||
; Scatter-Loading Description File
|
; Scatter-Loading Description File
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
; Copyright (c) 2018, STMicroelectronics
|
|
||||||
; All rights reserved.
|
|
||||||
;
|
;
|
||||||
; Redistribution and use in source and binary forms, with or without
|
; SPDX-License-Identifier: BSD-3-Clause
|
||||||
; modification, are permitted provided that the following conditions are met:
|
;******************************************************************************
|
||||||
;
|
;* @attention
|
||||||
; 1. Redistributions of source code must retain the above copyright notice,
|
;*
|
||||||
; this list of conditions and the following disclaimer.
|
;* Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
; 2. Redistributions in binary form must reproduce the above copyright notice,
|
;* All rights reserved.
|
||||||
; this list of conditions and the following disclaimer in the documentation
|
;*
|
||||||
; and/or other materials provided with the distribution.
|
;* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
; 3. Neither the name of STMicroelectronics nor the names of its contributors
|
;* the "License"; You may not use this file except in compliance with the
|
||||||
; may be used to endorse or promote products derived from this software
|
;* License. You may obtain a copy of the License at:
|
||||||
; without specific prior written permission.
|
;* opensource.org/licenses/BSD-3-Clause
|
||||||
;
|
;*
|
||||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
;******************************************************************************
|
||||||
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
#include "../cmsis_nvic.h"
|
||||||
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 0x100000
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
|
||||||
|
|
||||||
; 1MB FLASH (0x100000) + 320KB SRAM (0x50000)
|
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
|
|
||||||
|
|
||||||
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
|
ER_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||||
*.o (RESET, +First)
|
*.o (RESET, +First)
|
||||||
*(InRoot$$Sections)
|
*(InRoot$$Sections)
|
||||||
.ANY (+RO)
|
.ANY (+RO)
|
||||||
}
|
}
|
||||||
|
|
||||||
; Total: 107 vectors = 428 bytes (0x1AC); 8-byte aligned = 0x1B0 (0x1AC + 0x4) to be reserved in RAM
|
RW_IRAM1 (MBED_RAM_START + VECTORS_SIZE) { ; RW data
|
||||||
RW_IRAM1 (0x20000000+0x1B0) (0x50000-0x1B0-Stack_Size) { ; RW data 320k L4-SRAM1
|
.ANY (+RW +ZI)
|
||||||
.ANY (+RW +ZI)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ARM_LIB_STACK (0x20000000+0x50000) EMPTY -Stack_Size { ; stack
|
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE + MBED_RAM1_SIZE - MBED_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
|
||||||
|
}
|
||||||
|
|
||||||
|
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE + MBED_RAM1_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; Stack region growing down
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,44 @@
|
||||||
/* Linker script to configure memory regions. */
|
/* Linker script to configure memory regions. */
|
||||||
/* 0x1AC resevered for vectors; 8-byte aligned = 0x1B0 (0x1AC + 0x4)*/
|
/*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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"
|
||||||
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 1024k
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
STACK_SIZE = MBED_BOOT_STACK_SIZE;
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
||||||
SRAM1 (rwx) : ORIGIN = 0x200001B0, LENGTH = 320k - (0x1AC +0x4)
|
RAM (rwx) : ORIGIN = MBED_RAM_START + VECTORS_SIZE, LENGTH = MBED_RAM_SIZE + MBED_RAM1_SIZE - VECTORS_SIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Linker script to place sections and symbol values. Should be used together
|
/* Linker script to place sections and symbol values. Should be used together
|
||||||
|
@ -55,6 +76,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
KEEP(*(.isr_vector))
|
KEEP(*(.isr_vector))
|
||||||
*(.text*)
|
*(.text*)
|
||||||
|
|
||||||
KEEP(*(.init))
|
KEEP(*(.init))
|
||||||
KEEP(*(.fini))
|
KEEP(*(.fini))
|
||||||
|
|
||||||
|
@ -112,7 +134,6 @@ SECTIONS
|
||||||
KEEP(*(.init_array))
|
KEEP(*(.init_array))
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
PROVIDE_HIDDEN (__init_array_end = .);
|
||||||
|
|
||||||
|
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
/* finit data */
|
/* finit data */
|
||||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||||
|
@ -126,7 +147,20 @@ SECTIONS
|
||||||
__data_end__ = .;
|
__data_end__ = .;
|
||||||
_edata = .;
|
_edata = .;
|
||||||
|
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
|
/* Uninitialized data section
|
||||||
|
* This region is not initialized by the C/C++ library and can be used to
|
||||||
|
* store state across soft reboots. */
|
||||||
|
.uninitialized (NOLOAD):
|
||||||
|
{
|
||||||
|
. = ALIGN(32);
|
||||||
|
__uninitialized_start = .;
|
||||||
|
*(.uninitialized)
|
||||||
|
KEEP(*(.keep.uninitialized))
|
||||||
|
. = ALIGN(32);
|
||||||
|
__uninitialized_end = .;
|
||||||
|
} > RAM
|
||||||
|
|
||||||
.bss :
|
.bss :
|
||||||
{
|
{
|
||||||
|
@ -138,16 +172,16 @@ SECTIONS
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
__bss_end__ = .;
|
__bss_end__ = .;
|
||||||
_ebss = .;
|
_ebss = .;
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
.heap (COPY):
|
.heap (COPY):
|
||||||
{
|
{
|
||||||
__end__ = .;
|
__end__ = .;
|
||||||
end = __end__;
|
PROVIDE(end = .);
|
||||||
*(.heap*)
|
*(.heap*)
|
||||||
. = ORIGIN(SRAM1) + LENGTH(SRAM1) - STACK_SIZE;
|
. = ORIGIN(RAM) + LENGTH(RAM) - MBED_BOOT_STACK_SIZE;
|
||||||
__HeapLimit = .;
|
__HeapLimit = .;
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
/* .stack_dummy section doesn't contains any symbols. It is only
|
/* .stack_dummy section doesn't contains any symbols. It is only
|
||||||
* used for linker to calculate size of stack sections, and assign
|
* used for linker to calculate size of stack sections, and assign
|
||||||
|
@ -155,13 +189,13 @@ SECTIONS
|
||||||
.stack_dummy (COPY):
|
.stack_dummy (COPY):
|
||||||
{
|
{
|
||||||
*(.stack*)
|
*(.stack*)
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
/* Set stack top to end of RAM, and stack limit move down by
|
/* Set stack top to end of RAM, and stack limit move down by
|
||||||
* size of stack_dummy section */
|
* size of stack_dummy section */
|
||||||
__StackTop = ORIGIN(SRAM1) + LENGTH(SRAM1);
|
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
|
||||||
_estack = __StackTop;
|
_estack = __StackTop;
|
||||||
__StackLimit = __StackTop - STACK_SIZE;
|
__StackLimit = __StackTop - MBED_BOOT_STACK_SIZE;
|
||||||
PROVIDE(__stack = __StackTop);
|
PROVIDE(__stack = __StackTop);
|
||||||
|
|
||||||
/* Check if data + heap + stack exceeds RAM limit */
|
/* Check if data + heap + stack exceeds RAM limit */
|
||||||
|
|
|
@ -1,38 +1,59 @@
|
||||||
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
|
/* Linker script to configure memory regions.
|
||||||
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x100000; }
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* Device specific values */
|
||||||
|
|
||||||
/* [ROM = 1024kb = 0x100000] */
|
/* Tools provide -DMBED_ROM_START=xxx -DMBED_ROM_SIZE=xxx -DMBED_RAM_START=xxx -DMBED_RAM_SIZE=xxx */
|
||||||
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 = 0x50000] */
|
define symbol VECTORS = 107; /* This value must match NVIC_NUM_VECTORS in cmsis_nvic.h */
|
||||||
/* Vector table dynamic copy: Total: 107 vectors * 4 = 428 bytes (0x1AC) to be reserved in RAM */
|
define symbol HEAP_SIZE = 0x10000;
|
||||||
define symbol __NVIC_start__ = 0x20000000;
|
|
||||||
define symbol __NVIC_end__ = 0x200001AF; /* Add 4 more bytes to be aligned on 8 bytes */
|
|
||||||
define symbol __region_SRAM1_start__ = 0x200001B0;
|
|
||||||
define symbol __region_SRAM1_end__ = 0x2004FFFF;
|
|
||||||
|
|
||||||
/* Memory regions */
|
/* Common - Do not change */
|
||||||
define memory mem with size = 4G;
|
|
||||||
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
|
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||||
define region SRAM1_region = mem:[from __region_SRAM1_start__ to __region_SRAM1_end__];
|
define symbol MBED_APP_START = MBED_ROM_START;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||||
|
define symbol MBED_APP_SIZE = MBED_ROM_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
||||||
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
||||||
}
|
}
|
||||||
|
|
||||||
define symbol __size_cstack__ = MBED_BOOT_STACK_SIZE;
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
define symbol __size_heap__ = 0x10000;
|
define symbol VECTORS_SIZE = ((VECTORS * 4) + 7) & ~7;
|
||||||
define block CSTACK with alignment = 8, size = __size_cstack__ { };
|
define symbol RAM_REGION_START = MBED_RAM_START + VECTORS_SIZE;
|
||||||
define block HEAP with alignment = 8, size = __size_heap__ { };
|
define symbol RAM_REGION_SIZE = MBED_RAM_SIZE + MBED_RAM1_SIZE - VECTORS_SIZE;
|
||||||
define block STACKHEAP with fixed order { block HEAP, block CSTACK };
|
|
||||||
|
|
||||||
initialize by copy with packing = zeros { readwrite };
|
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_BOOT_STACK_SIZE { };
|
||||||
|
define block HEAP with alignment = 8, size = HEAP_SIZE { };
|
||||||
|
|
||||||
|
initialize by copy { readwrite };
|
||||||
do not initialize { section .noinit };
|
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 ROM_region { readonly };
|
||||||
place in SRAM1_region { readwrite, block STACKHEAP };
|
place in RAM_region { readwrite,
|
||||||
|
block CSTACK, block HEAP };
|
||||||
|
|
|
@ -1,40 +1,47 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
*******************************************************************************
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
* Copyright (c) 2015, STMicroelectronics
|
******************************************************************************
|
||||||
* All rights reserved.
|
* @attention
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* <h2><center>© Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* All rights reserved.</center></h2>
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
* this list of conditions and the following disclaimer.
|
* the "License"; You may not use this file except in compliance with the
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
* License. You may obtain a copy of the License at:
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
* opensource.org/licenses/BSD-3-Clause
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
******************************************************************************
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
*/
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MBED_CMSIS_NVIC_H
|
#ifndef MBED_CMSIS_NVIC_H
|
||||||
#define MBED_CMSIS_NVIC_H
|
#define MBED_CMSIS_NVIC_H
|
||||||
|
|
||||||
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
|
#if !defined(MBED_ROM_START)
|
||||||
// MCU Peripherals: 91 vectors = 364 bytes from 0x40 to 0x1AB
|
#define MBED_ROM_START 0x8000000
|
||||||
// Total: 107 vectors = 428 bytes (0x1AC) to be reserved in RAM
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_ROM_SIZE)
|
||||||
|
#define MBED_ROM_SIZE 0x100000 // 1.0 MB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_START)
|
||||||
|
#define MBED_RAM_START 0x20000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_SIZE)
|
||||||
|
#define MBED_RAM_SIZE 0x40000 // 256 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_START)
|
||||||
|
#define MBED_RAM1_START 0x10000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_SIZE)
|
||||||
|
#define MBED_RAM1_SIZE 0x10000 // 64 KB
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NVIC_NUM_VECTORS 107
|
#define NVIC_NUM_VECTORS 107
|
||||||
#define NVIC_RAM_VECTOR_ADDRESS 0X20000000 // Vectors positioned at start of SRAM
|
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM_START
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
* Copyright (c) 2006-2017 ARM Limited
|
* Copyright (c) 2006-2019 ARM Limited
|
||||||
|
* Copyright (c) 2006-2019 STMicroelectronics
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -33,21 +35,12 @@
|
||||||
#include "stm32l4xx.h"
|
#include "stm32l4xx.h"
|
||||||
#include "mbed_assert.h"
|
#include "mbed_assert.h"
|
||||||
|
|
||||||
/*!< Uncomment the following line if you need to relocate your vector Table in
|
|
||||||
Internal SRAM. */
|
|
||||||
/* #define VECT_TAB_SRAM */
|
|
||||||
#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field.
|
|
||||||
This value must be a multiple of 0x200. */
|
|
||||||
|
|
||||||
|
|
||||||
// clock source is selected with CLOCK_SOURCE in json config
|
// clock source is selected with CLOCK_SOURCE in json config
|
||||||
#define USE_PLL_HSE_EXTC 0x8 // Use external clock (ST Link MCO - not enabled by default)
|
#define USE_PLL_HSE_EXTC 0x8 // Use external clock (ST Link MCO - not enabled by default)
|
||||||
#define USE_PLL_HSE_XTAL 0x4 // Use external xtal (X3 on board - not provided by default)
|
#define USE_PLL_HSE_XTAL 0x4 // Use external xtal (X3 on board - not provided by default)
|
||||||
#define USE_PLL_HSI 0x2 // Use HSI internal clock
|
#define USE_PLL_HSI 0x2 // Use HSI internal clock
|
||||||
#define USE_PLL_MSI 0x1 // Use MSI internal clock
|
#define USE_PLL_MSI 0x1 // Use MSI internal clock
|
||||||
|
|
||||||
#define DEBUG_MCO (0) // Output the MCO on PA8 for debugging (0=OFF, 1=SYSCLK, 2=HSE, 3=HSI, 4=MSI)
|
|
||||||
|
|
||||||
#if ( ((CLOCK_SOURCE) & USE_PLL_HSE_XTAL) || ((CLOCK_SOURCE) & USE_PLL_HSE_EXTC) )
|
#if ( ((CLOCK_SOURCE) & USE_PLL_HSE_XTAL) || ((CLOCK_SOURCE) & USE_PLL_HSE_EXTC) )
|
||||||
uint8_t SetSysClock_PLL_HSE(uint8_t bypass);
|
uint8_t SetSysClock_PLL_HSE(uint8_t bypass);
|
||||||
#endif /* ((CLOCK_SOURCE) & USE_PLL_HSE_XTAL) || ((CLOCK_SOURCE) & USE_PLL_HSE_EXTC) */
|
#endif /* ((CLOCK_SOURCE) & USE_PLL_HSE_XTAL) || ((CLOCK_SOURCE) & USE_PLL_HSE_EXTC) */
|
||||||
|
@ -64,8 +57,7 @@ uint8_t SetSysClock_PLL_MSI(void);
|
||||||
/**
|
/**
|
||||||
* @brief Configures the System clock source, PLL Multiplier and Divider factors,
|
* @brief Configures the System clock source, PLL Multiplier and Divider factors,
|
||||||
* AHB/APBx prescalers and Flash settings
|
* AHB/APBx prescalers and Flash settings
|
||||||
* @note This function should be called only once the RCC clock configuration
|
* @note This function is called in mbed_sdk_init() and hal_deepsleep() functions
|
||||||
* is reset to the default reset state (done in SystemInit() function).
|
|
||||||
* @param None
|
* @param None
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
|
@ -99,11 +91,6 @@ void SetSysClock(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output clock on MCO1 pin(PA8) for debugging purpose
|
|
||||||
#if DEBUG_MCO == 1
|
|
||||||
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ( ((CLOCK_SOURCE) & USE_PLL_HSE_XTAL) || ((CLOCK_SOURCE) & USE_PLL_HSE_EXTC) )
|
#if ( ((CLOCK_SOURCE) & USE_PLL_HSE_XTAL) || ((CLOCK_SOURCE) & USE_PLL_HSE_EXTC) )
|
||||||
|
@ -177,15 +164,6 @@ uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // No PLL update
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // No PLL update
|
||||||
HAL_RCC_OscConfig(&RCC_OscInitStruct);
|
HAL_RCC_OscConfig(&RCC_OscInitStruct);
|
||||||
|
|
||||||
// Output clock on MCO1 pin(PA8) for debugging purpose
|
|
||||||
#if DEBUG_MCO == 2
|
|
||||||
if (bypass == 0) {
|
|
||||||
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_2); // 4 MHz
|
|
||||||
} else {
|
|
||||||
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_1); // 8 MHz
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1; // OK
|
return 1; // OK
|
||||||
}
|
}
|
||||||
#endif /* ((CLOCK_SOURCE) & USE_PLL_HSE_XTAL) || ((CLOCK_SOURCE) & USE_PLL_HSE_EXTC) */
|
#endif /* ((CLOCK_SOURCE) & USE_PLL_HSE_XTAL) || ((CLOCK_SOURCE) & USE_PLL_HSE_EXTC) */
|
||||||
|
@ -252,11 +230,6 @@ uint8_t SetSysClock_PLL_HSI(void)
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // No PLL update
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // No PLL update
|
||||||
HAL_RCC_OscConfig(&RCC_OscInitStruct);
|
HAL_RCC_OscConfig(&RCC_OscInitStruct);
|
||||||
|
|
||||||
// Output clock on MCO1 pin(PA8) for debugging purpose
|
|
||||||
#if DEBUG_MCO == 3
|
|
||||||
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSI, RCC_MCODIV_1); // 16 MHz
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1; // OK
|
return 1; // OK
|
||||||
}
|
}
|
||||||
#endif /* ((CLOCK_SOURCE) & USE_PLL_HSI) */
|
#endif /* ((CLOCK_SOURCE) & USE_PLL_HSI) */
|
||||||
|
@ -313,15 +286,10 @@ uint8_t SetSysClock_PLL_MSI(void)
|
||||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; /* 120 MHz */
|
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; /* 120 MHz */
|
||||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; /* 120 MHz */
|
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; /* 120 MHz */
|
||||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; /* 120 MHz */
|
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; /* 120 MHz */
|
||||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK) {
|
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) {
|
||||||
return 0; // FAIL
|
return 0; // FAIL
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output clock on MCO1 pin(PA8) for debugging purpose
|
|
||||||
#if DEBUG_MCO == 4
|
|
||||||
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_MSI, RCC_MCODIV_2); // 2 MHz
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1; // OK
|
return 1; // OK
|
||||||
}
|
}
|
||||||
#endif /* ((CLOCK_SOURCE) & USE_PLL_MSI) */
|
#endif /* ((CLOCK_SOURCE) & USE_PLL_MSI) */
|
||||||
|
|
|
@ -1,60 +1,57 @@
|
||||||
#! armcc -E
|
#! armcc -E
|
||||||
; Scatter-Loading Description File
|
; Scatter-Loading Description File
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
; Copyright (c) 2018, STMicroelectronics
|
|
||||||
; All rights reserved.
|
|
||||||
;
|
;
|
||||||
; Redistribution and use in source and binary forms, with or without
|
; SPDX-License-Identifier: BSD-3-Clause
|
||||||
; modification, are permitted provided that the following conditions are met:
|
;******************************************************************************
|
||||||
;
|
;* @attention
|
||||||
; 1. Redistributions of source code must retain the above copyright notice,
|
;*
|
||||||
; this list of conditions and the following disclaimer.
|
;* Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
; 2. Redistributions in binary form must reproduce the above copyright notice,
|
;* All rights reserved.
|
||||||
; this list of conditions and the following disclaimer in the documentation
|
;*
|
||||||
; and/or other materials provided with the distribution.
|
;* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
; 3. Neither the name of STMicroelectronics nor the names of its contributors
|
;* the "License"; You may not use this file except in compliance with the
|
||||||
; may be used to endorse or promote products derived from this software
|
;* License. You may obtain a copy of the License at:
|
||||||
; without specific prior written permission.
|
;* opensource.org/licenses/BSD-3-Clause
|
||||||
;
|
;*
|
||||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
;******************************************************************************
|
||||||
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
#include "../cmsis_nvic.h"
|
||||||
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 0x200000
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
|
||||||
|
|
||||||
; 2MB FLASH (0x200000) + 640KB SRAM (0xA0000)
|
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
|
|
||||||
|
|
||||||
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
|
ER_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||||
*.o (RESET, +First)
|
*.o (RESET, +First)
|
||||||
*(InRoot$$Sections)
|
*(InRoot$$Sections)
|
||||||
.ANY (+RO)
|
.ANY (+RO)
|
||||||
}
|
}
|
||||||
|
|
||||||
; Total: 111 vectors = 444 bytes (0x1BC) (+ 4 bytes for 8-byte alignment) to be reserved in RAM
|
RW_IRAM1 (MBED_RAM_START + VECTORS_SIZE) { ; RW data
|
||||||
RW_IRAM1 (0x20000000+0x1C0) (0xA0000-0x1C0-Stack_Size) { ; RW data
|
.ANY (+RW +ZI)
|
||||||
|
}
|
||||||
|
|
||||||
|
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
|
||||||
|
}
|
||||||
|
|
||||||
|
RW_IRAM2 MBED_RAM1_START MBED_RAM1_SIZE {
|
||||||
.ANY (+RW +ZI)
|
.ANY (+RW +ZI)
|
||||||
}
|
}
|
||||||
ARM_LIB_STACK (0x20000000+0xA0000) EMPTY -Stack_Size { ; stack
|
|
||||||
|
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; Stack region growing down
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,45 @@
|
||||||
|
/* Linker script to configure memory regions. */
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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"
|
||||||
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 2048K
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
STACK_SIZE = MBED_BOOT_STACK_SIZE;
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
|
||||||
|
|
||||||
/* Linker script to configure memory regions. */
|
|
||||||
/* Total: 111 vectors = 444 bytes (0x1BC) (+ 4 bytes for 8-byte alignment) to be reserved in RAM */
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
||||||
SRAM1 (rwx) : ORIGIN = 0x200001C0, LENGTH = 640k - 0x1C0
|
RAM (rwx) : ORIGIN = MBED_RAM_START + VECTORS_SIZE, LENGTH = MBED_RAM_SIZE - VECTORS_SIZE
|
||||||
|
RAM2 (rwx) : ORIGIN = MBED_RAM1_START , LENGTH = MBED_RAM1_SIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Linker script to place sections and symbol values. Should be used together
|
/* Linker script to place sections and symbol values. Should be used together
|
||||||
|
@ -55,6 +77,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
KEEP(*(.isr_vector))
|
KEEP(*(.isr_vector))
|
||||||
*(.text*)
|
*(.text*)
|
||||||
|
|
||||||
KEEP(*(.init))
|
KEEP(*(.init))
|
||||||
KEEP(*(.fini))
|
KEEP(*(.fini))
|
||||||
|
|
||||||
|
@ -112,7 +135,6 @@ SECTIONS
|
||||||
KEEP(*(.init_array))
|
KEEP(*(.init_array))
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
PROVIDE_HIDDEN (__init_array_end = .);
|
||||||
|
|
||||||
|
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
/* finit data */
|
/* finit data */
|
||||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||||
|
@ -126,7 +148,20 @@ SECTIONS
|
||||||
__data_end__ = .;
|
__data_end__ = .;
|
||||||
_edata = .;
|
_edata = .;
|
||||||
|
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
|
/* Uninitialized data section
|
||||||
|
* This region is not initialized by the C/C++ library and can be used to
|
||||||
|
* store state across soft reboots. */
|
||||||
|
.uninitialized (NOLOAD):
|
||||||
|
{
|
||||||
|
. = ALIGN(32);
|
||||||
|
__uninitialized_start = .;
|
||||||
|
*(.uninitialized)
|
||||||
|
KEEP(*(.keep.uninitialized))
|
||||||
|
. = ALIGN(32);
|
||||||
|
__uninitialized_end = .;
|
||||||
|
} > RAM
|
||||||
|
|
||||||
.bss :
|
.bss :
|
||||||
{
|
{
|
||||||
|
@ -138,16 +173,16 @@ SECTIONS
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
__bss_end__ = .;
|
__bss_end__ = .;
|
||||||
_ebss = .;
|
_ebss = .;
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
.heap (COPY):
|
.heap (COPY):
|
||||||
{
|
{
|
||||||
__end__ = .;
|
__end__ = .;
|
||||||
end = __end__;
|
PROVIDE(end = .);
|
||||||
*(.heap*)
|
*(.heap*)
|
||||||
. = ORIGIN(SRAM1) + LENGTH(SRAM1) - STACK_SIZE;
|
. = ORIGIN(RAM) + LENGTH(RAM) - MBED_BOOT_STACK_SIZE;
|
||||||
__HeapLimit = .;
|
__HeapLimit = .;
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
/* .stack_dummy section doesn't contains any symbols. It is only
|
/* .stack_dummy section doesn't contains any symbols. It is only
|
||||||
* used for linker to calculate size of stack sections, and assign
|
* used for linker to calculate size of stack sections, and assign
|
||||||
|
@ -155,13 +190,13 @@ SECTIONS
|
||||||
.stack_dummy (COPY):
|
.stack_dummy (COPY):
|
||||||
{
|
{
|
||||||
*(.stack*)
|
*(.stack*)
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
/* Set stack top to end of RAM, and stack limit move down by
|
/* Set stack top to end of RAM, and stack limit move down by
|
||||||
* size of stack_dummy section */
|
* size of stack_dummy section */
|
||||||
__StackTop = ORIGIN(SRAM1) + LENGTH(SRAM1);
|
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
|
||||||
_estack = __StackTop;
|
_estack = __StackTop;
|
||||||
__StackLimit = __StackTop - STACK_SIZE;
|
__StackLimit = __StackTop - MBED_BOOT_STACK_SIZE;
|
||||||
PROVIDE(__stack = __StackTop);
|
PROVIDE(__stack = __StackTop);
|
||||||
|
|
||||||
/* Check if data + heap + stack exceeds RAM limit */
|
/* Check if data + heap + stack exceeds RAM limit */
|
||||||
|
|
|
@ -1,38 +1,59 @@
|
||||||
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
|
/* Linker script to configure memory regions.
|
||||||
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x200000; }
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* Device specific values */
|
||||||
|
|
||||||
/* [ROM = 2MB = 0x200000] */
|
/* Tools provide -DMBED_ROM_START=xxx -DMBED_ROM_SIZE=xxx -DMBED_RAM_START=xxx -DMBED_RAM_SIZE=xxx */
|
||||||
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 = 640KB = 0xA0000] */
|
define symbol VECTORS = 111; /* This value must match NVIC_NUM_VECTORS in cmsis_nvic.h */
|
||||||
/* Vector table dynamic copy */
|
define symbol HEAP_SIZE = 0x10000;
|
||||||
/* Total: 111 vectors = 444 bytes (0x1BC) (+ 4 bytes for 8-byte alignment) to be reserved in RAM */
|
|
||||||
define symbol __NVIC_start__ = 0x20000000;
|
|
||||||
define symbol __NVIC_end__ = 0x20000000 + 0x1C0 - 1;
|
|
||||||
define symbol __region_SRAM1_start__ = 0x20000000 + 0x1C0;
|
|
||||||
define symbol __region_SRAM1_end__ = 0x20000000 + 0xA0000 - 1;
|
|
||||||
|
|
||||||
/* Memory regions */
|
/* Common - Do not change */
|
||||||
define memory mem with size = 4G;
|
|
||||||
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
|
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||||
define region SRAM1_region = mem:[from __region_SRAM1_start__ to __region_SRAM1_end__];
|
define symbol MBED_APP_START = MBED_ROM_START;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||||
|
define symbol MBED_APP_SIZE = MBED_ROM_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Stack and Heap */
|
|
||||||
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
||||||
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
||||||
}
|
}
|
||||||
define symbol __size_cstack__ = MBED_BOOT_STACK_SIZE;
|
|
||||||
define symbol __size_heap__ = 0x20000; /* 128KB */
|
|
||||||
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 RAM_REGION_START = MBED_RAM_START + VECTORS_SIZE;
|
||||||
|
define symbol RAM_REGION_SIZE = MBED_RAM_SIZE - VECTORS_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_BOOT_STACK_SIZE { };
|
||||||
|
define block HEAP with alignment = 8, size = HEAP_SIZE { };
|
||||||
|
|
||||||
|
initialize by copy { readwrite };
|
||||||
do not initialize { section .noinit };
|
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 ROM_region { readonly };
|
||||||
place in SRAM1_region { readwrite, block STACKHEAP };
|
place in RAM_region { readwrite,
|
||||||
|
block CSTACK, block HEAP };
|
||||||
|
|
|
@ -1,25 +1,47 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
* Copyright (c) 2006-2018 ARM Limited
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* <h2><center>© Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
* you may not use this file except in compliance with the License.
|
* All rights reserved.</center></h2>
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* 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
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
******************************************************************************
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
*/
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
#ifndef MBED_CMSIS_NVIC_H
|
#ifndef MBED_CMSIS_NVIC_H
|
||||||
#define MBED_CMSIS_NVIC_H
|
#define MBED_CMSIS_NVIC_H
|
||||||
|
|
||||||
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
|
#if !defined(MBED_ROM_START)
|
||||||
// MCU Peripherals: 95 vectors = 380 bytes from 0x40 to 0x1BB
|
#define MBED_ROM_START 0x8000000
|
||||||
// Total: 111 vectors = 444 bytes (0x1BC) to be reserved in RAM
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_ROM_SIZE)
|
||||||
|
#define MBED_ROM_SIZE 0x200000 // 2.0 MB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_START)
|
||||||
|
#define MBED_RAM_START 0x20000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_SIZE)
|
||||||
|
#define MBED_RAM_SIZE 0x40000 // 192KB SRAM1 + 64KB SRAM2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_START)
|
||||||
|
#define MBED_RAM1_START 0x20040000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_SIZE)
|
||||||
|
#define MBED_RAM1_SIZE 0x60000 // 384KB SRAM3
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NVIC_NUM_VECTORS 111
|
#define NVIC_NUM_VECTORS 111
|
||||||
#define NVIC_RAM_VECTOR_ADDRESS 0X20000000 // Vectors positioned at start of SRAM
|
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM_START
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -61,6 +61,7 @@ uint8_t SetSysClock_PLL_MSI(void);
|
||||||
* @param None
|
* @param None
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void SetSysClock(void)
|
void SetSysClock(void)
|
||||||
{
|
{
|
||||||
#if ((CLOCK_SOURCE) & USE_PLL_HSE_EXTC)
|
#if ((CLOCK_SOURCE) & USE_PLL_HSE_EXTC)
|
||||||
|
@ -241,22 +242,17 @@ uint8_t SetSysClock_PLL_MSI(void)
|
||||||
|
|
||||||
HAL_RCCEx_DisableLSECSS();
|
HAL_RCCEx_DisableLSECSS();
|
||||||
/* Enable MSI Oscillator and activate PLL with MSI as source */
|
/* Enable MSI Oscillator and activate PLL with MSI as source */
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI | RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_HSE;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI | RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSE;
|
||||||
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
|
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
|
||||||
RCC_OscInitStruct.HSEState = RCC_HSE_OFF;
|
RCC_OscInitStruct.HSEState = RCC_HSE_OFF;
|
||||||
RCC_OscInitStruct.HSIState = RCC_HSI_OFF;
|
RCC_OscInitStruct.HSIState = RCC_HSI_OFF;
|
||||||
#if DEVICE_USBDEVICE
|
|
||||||
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
|
|
||||||
#else
|
|
||||||
RCC_OscInitStruct.HSI48State = RCC_HSI48_OFF;
|
|
||||||
#endif /* DEVICE_USBDEVICE */
|
|
||||||
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
|
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
|
||||||
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6; /* 4 MHz */
|
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_11; /* 48 MHz */
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI;
|
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI;
|
||||||
RCC_OscInitStruct.PLL.PLLM = 1; /* 4 MHz */
|
RCC_OscInitStruct.PLL.PLLM = 6; /* 8 MHz */
|
||||||
RCC_OscInitStruct.PLL.PLLN = 60; /* 240 MHz */
|
RCC_OscInitStruct.PLL.PLLN = 30; /* 240 MHz */
|
||||||
RCC_OscInitStruct.PLL.PLLP = 7; /* 48 MHz */
|
RCC_OscInitStruct.PLL.PLLP = 5; /* 48 MHz */
|
||||||
RCC_OscInitStruct.PLL.PLLQ = 2; /* 120 MHz */
|
RCC_OscInitStruct.PLL.PLLQ = 2; /* 120 MHz */
|
||||||
RCC_OscInitStruct.PLL.PLLR = 2; /* 120 MHz */
|
RCC_OscInitStruct.PLL.PLLR = 2; /* 120 MHz */
|
||||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
|
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
|
||||||
|
@ -266,11 +262,10 @@ uint8_t SetSysClock_PLL_MSI(void)
|
||||||
HAL_RCCEx_EnableMSIPLLMode();
|
HAL_RCCEx_EnableMSIPLLMode();
|
||||||
|
|
||||||
#if DEVICE_USBDEVICE
|
#if DEVICE_USBDEVICE
|
||||||
|
/* Select MSI output as USB clock source */
|
||||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
|
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
|
||||||
PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48; /* 48 MHz */
|
PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_MSI; /* 48 MHz */
|
||||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
|
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
|
||||||
return 0; // FAIL
|
|
||||||
}
|
|
||||||
#endif /* DEVICE_USBDEVICE */
|
#endif /* DEVICE_USBDEVICE */
|
||||||
|
|
||||||
// Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers
|
// Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers
|
||||||
|
|
|
@ -1,60 +1,57 @@
|
||||||
#! armcc -E
|
#! armcc -E
|
||||||
; Scatter-Loading Description File
|
; Scatter-Loading Description File
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
; Copyright (c) 2018, STMicroelectronics
|
|
||||||
; All rights reserved.
|
|
||||||
;
|
;
|
||||||
; Redistribution and use in source and binary forms, with or without
|
; SPDX-License-Identifier: BSD-3-Clause
|
||||||
; modification, are permitted provided that the following conditions are met:
|
;******************************************************************************
|
||||||
;
|
;* @attention
|
||||||
; 1. Redistributions of source code must retain the above copyright notice,
|
;*
|
||||||
; this list of conditions and the following disclaimer.
|
;* Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
; 2. Redistributions in binary form must reproduce the above copyright notice,
|
;* All rights reserved.
|
||||||
; this list of conditions and the following disclaimer in the documentation
|
;*
|
||||||
; and/or other materials provided with the distribution.
|
;* This software component is licensed by ST under BSD 3-Clause license,
|
||||||
; 3. Neither the name of STMicroelectronics nor the names of its contributors
|
;* the "License"; You may not use this file except in compliance with the
|
||||||
; may be used to endorse or promote products derived from this software
|
;* License. You may obtain a copy of the License at:
|
||||||
; without specific prior written permission.
|
;* opensource.org/licenses/BSD-3-Clause
|
||||||
;
|
;*
|
||||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
;******************************************************************************
|
||||||
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
#include "../cmsis_nvic.h"
|
||||||
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 0x200000
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
|
||||||
|
|
||||||
; 2MB FLASH (0x200000) + 640KB SRAM (0xA0000)
|
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
|
|
||||||
|
|
||||||
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
|
ER_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||||
*.o (RESET, +First)
|
*.o (RESET, +First)
|
||||||
*(InRoot$$Sections)
|
*(InRoot$$Sections)
|
||||||
.ANY (+RO)
|
.ANY (+RO)
|
||||||
}
|
}
|
||||||
|
|
||||||
; Total: 111 vectors = 444 bytes (0x1BC) (+ 4 bytes for 8-byte alignment) to be reserved in RAM
|
RW_IRAM1 (MBED_RAM_START + VECTORS_SIZE) { ; RW data
|
||||||
RW_IRAM1 (0x20000000+0x1C0) (0xA0000-0x1C0-Stack_Size) { ; RW data
|
.ANY (+RW +ZI)
|
||||||
|
}
|
||||||
|
|
||||||
|
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
|
||||||
|
}
|
||||||
|
|
||||||
|
RW_IRAM2 MBED_RAM1_START MBED_RAM1_SIZE {
|
||||||
.ANY (+RW +ZI)
|
.ANY (+RW +ZI)
|
||||||
}
|
}
|
||||||
ARM_LIB_STACK (0x20000000+0xA0000) EMPTY -Stack_Size { ; stack
|
|
||||||
|
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; Stack region growing down
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,45 @@
|
||||||
|
/* Linker script to configure memory regions. */
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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"
|
||||||
|
|
||||||
|
|
||||||
#if !defined(MBED_APP_START)
|
#if !defined(MBED_APP_START)
|
||||||
#define MBED_APP_START 0x08000000
|
#define MBED_APP_START MBED_ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_APP_SIZE)
|
#if !defined(MBED_APP_SIZE)
|
||||||
#define MBED_APP_SIZE 2048K
|
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||||
#define MBED_BOOT_STACK_SIZE 0x400
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
|
#define MBED_BOOT_STACK_SIZE 0x400
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
STACK_SIZE = MBED_BOOT_STACK_SIZE;
|
/* Round up VECTORS_SIZE to 8 bytes */
|
||||||
|
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
|
||||||
|
|
||||||
/* Linker script to configure memory regions. */
|
|
||||||
/* Total: 111 vectors = 444 bytes (0x1BC) (+ 4 bytes for 8-byte alignment) to be reserved in RAM */
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
||||||
SRAM1 (rwx) : ORIGIN = 0x200001C0, LENGTH = 640k - 0x1C0
|
RAM (rwx) : ORIGIN = MBED_RAM_START + VECTORS_SIZE, LENGTH = MBED_RAM_SIZE - VECTORS_SIZE
|
||||||
|
RAM2 (rwx) : ORIGIN = MBED_RAM1_START , LENGTH = MBED_RAM1_SIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Linker script to place sections and symbol values. Should be used together
|
/* Linker script to place sections and symbol values. Should be used together
|
||||||
|
@ -55,6 +77,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
KEEP(*(.isr_vector))
|
KEEP(*(.isr_vector))
|
||||||
*(.text*)
|
*(.text*)
|
||||||
|
|
||||||
KEEP(*(.init))
|
KEEP(*(.init))
|
||||||
KEEP(*(.fini))
|
KEEP(*(.fini))
|
||||||
|
|
||||||
|
@ -112,7 +135,6 @@ SECTIONS
|
||||||
KEEP(*(.init_array))
|
KEEP(*(.init_array))
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
PROVIDE_HIDDEN (__init_array_end = .);
|
||||||
|
|
||||||
|
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
/* finit data */
|
/* finit data */
|
||||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||||
|
@ -126,7 +148,20 @@ SECTIONS
|
||||||
__data_end__ = .;
|
__data_end__ = .;
|
||||||
_edata = .;
|
_edata = .;
|
||||||
|
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
|
/* Uninitialized data section
|
||||||
|
* This region is not initialized by the C/C++ library and can be used to
|
||||||
|
* store state across soft reboots. */
|
||||||
|
.uninitialized (NOLOAD):
|
||||||
|
{
|
||||||
|
. = ALIGN(32);
|
||||||
|
__uninitialized_start = .;
|
||||||
|
*(.uninitialized)
|
||||||
|
KEEP(*(.keep.uninitialized))
|
||||||
|
. = ALIGN(32);
|
||||||
|
__uninitialized_end = .;
|
||||||
|
} > RAM
|
||||||
|
|
||||||
.bss :
|
.bss :
|
||||||
{
|
{
|
||||||
|
@ -138,16 +173,16 @@ SECTIONS
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
__bss_end__ = .;
|
__bss_end__ = .;
|
||||||
_ebss = .;
|
_ebss = .;
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
.heap (COPY):
|
.heap (COPY):
|
||||||
{
|
{
|
||||||
__end__ = .;
|
__end__ = .;
|
||||||
end = __end__;
|
PROVIDE(end = .);
|
||||||
*(.heap*)
|
*(.heap*)
|
||||||
. = ORIGIN(SRAM1) + LENGTH(SRAM1) - STACK_SIZE;
|
. = ORIGIN(RAM) + LENGTH(RAM) - MBED_BOOT_STACK_SIZE;
|
||||||
__HeapLimit = .;
|
__HeapLimit = .;
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
/* .stack_dummy section doesn't contains any symbols. It is only
|
/* .stack_dummy section doesn't contains any symbols. It is only
|
||||||
* used for linker to calculate size of stack sections, and assign
|
* used for linker to calculate size of stack sections, and assign
|
||||||
|
@ -155,13 +190,13 @@ SECTIONS
|
||||||
.stack_dummy (COPY):
|
.stack_dummy (COPY):
|
||||||
{
|
{
|
||||||
*(.stack*)
|
*(.stack*)
|
||||||
} > SRAM1
|
} > RAM
|
||||||
|
|
||||||
/* Set stack top to end of RAM, and stack limit move down by
|
/* Set stack top to end of RAM, and stack limit move down by
|
||||||
* size of stack_dummy section */
|
* size of stack_dummy section */
|
||||||
__StackTop = ORIGIN(SRAM1) + LENGTH(SRAM1);
|
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
|
||||||
_estack = __StackTop;
|
_estack = __StackTop;
|
||||||
__StackLimit = __StackTop - STACK_SIZE;
|
__StackLimit = __StackTop - MBED_BOOT_STACK_SIZE;
|
||||||
PROVIDE(__stack = __StackTop);
|
PROVIDE(__stack = __StackTop);
|
||||||
|
|
||||||
/* Check if data + heap + stack exceeds RAM limit */
|
/* Check if data + heap + stack exceeds RAM limit */
|
||||||
|
|
|
@ -1,38 +1,77 @@
|
||||||
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
|
/* Linker script to configure memory regions.
|
||||||
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x200000; }
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2020 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
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* Device specific values */
|
||||||
|
|
||||||
/* [ROM = 2MB = 0x200000] */
|
/* Tools provide -DMBED_ROM_START=xxx -DMBED_ROM_SIZE=xxx -DMBED_RAM_START=xxx -DMBED_RAM_SIZE=xxx */
|
||||||
define symbol __intvec_start__ = MBED_APP_START;
|
if (!isdefinedsymbol(MBED_ROM_START)) {
|
||||||
define symbol __region_ROM_start__ = MBED_APP_START;
|
define symbol MBED_ROM_START = 0x8000000;
|
||||||
define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
|
}
|
||||||
|
if (!isdefinedsymbol(MBED_ROM_SIZE)) {
|
||||||
|
define symbol MBED_ROM_SIZE = 0x200000;
|
||||||
|
}
|
||||||
|
if (!isdefinedsymbol(MBED_RAM_START)) {
|
||||||
|
define symbol MBED_RAM_START = 0x20000000;
|
||||||
|
}
|
||||||
|
if (!isdefinedsymbol(MBED_RAM_SIZE)) {
|
||||||
|
define symbol MBED_RAM_SIZE = 0x40000;
|
||||||
|
}
|
||||||
|
if (!isdefinedsymbol(MBED_RAM1_START)) {
|
||||||
|
define symbol MBED_RAM1_START = 0x20040000;
|
||||||
|
}
|
||||||
|
if (!isdefinedsymbol(MBED_RAM1_SIZE)) {
|
||||||
|
define symbol MBED_RAM1_SIZE = 0x60000;
|
||||||
|
}
|
||||||
|
|
||||||
/* [RAM = 640KB = 0xA0000] */
|
define symbol VECTORS = 111; /* This value must match NVIC_NUM_VECTORS in cmsis_nvic.h */
|
||||||
/* Vector table dynamic copy */
|
define symbol HEAP_SIZE = 0x10000;
|
||||||
/* Total: 111 vectors = 444 bytes (0x1BC) (+ 4 bytes for 8-byte alignment) to be reserved in RAM */
|
|
||||||
define symbol __NVIC_start__ = 0x20000000;
|
|
||||||
define symbol __NVIC_end__ = 0x20000000 + 0x1C0 - 1;
|
|
||||||
define symbol __region_SRAM1_start__ = 0x20000000 + 0x1C0;
|
|
||||||
define symbol __region_SRAM1_end__ = 0x20000000 + 0xA0000 - 1;
|
|
||||||
|
|
||||||
/* Memory regions */
|
/* Common - Do not change */
|
||||||
define memory mem with size = 4G;
|
|
||||||
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
|
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||||
define region SRAM1_region = mem:[from __region_SRAM1_start__ to __region_SRAM1_end__];
|
define symbol MBED_APP_START = MBED_ROM_START;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||||
|
define symbol MBED_APP_SIZE = MBED_ROM_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Stack and Heap */
|
|
||||||
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
||||||
|
/* This value is normally defined by the tools
|
||||||
|
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||||
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
||||||
}
|
}
|
||||||
define symbol __size_cstack__ = MBED_BOOT_STACK_SIZE;
|
|
||||||
define symbol __size_heap__ = 0x20000; /* 128KB */
|
|
||||||
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 RAM_REGION_START = MBED_RAM_START + VECTORS_SIZE;
|
||||||
|
define symbol RAM_REGION_SIZE = MBED_RAM_SIZE - VECTORS_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_BOOT_STACK_SIZE { };
|
||||||
|
define block HEAP with alignment = 8, size = HEAP_SIZE { };
|
||||||
|
|
||||||
|
initialize by copy { readwrite };
|
||||||
do not initialize { section .noinit };
|
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 ROM_region { readonly };
|
||||||
place in SRAM1_region { readwrite, block STACKHEAP };
|
place in RAM_region { readwrite,
|
||||||
|
block CSTACK, block HEAP };
|
||||||
|
|
|
@ -1,25 +1,47 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
* Copyright (c) 2006-2018 ARM Limited
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* <h2><center>© Copyright (c) 2016-2020 STMicroelectronics.
|
||||||
* you may not use this file except in compliance with the License.
|
* All rights reserved.</center></h2>
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* 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
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
******************************************************************************
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
*/
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
#ifndef MBED_CMSIS_NVIC_H
|
#ifndef MBED_CMSIS_NVIC_H
|
||||||
#define MBED_CMSIS_NVIC_H
|
#define MBED_CMSIS_NVIC_H
|
||||||
|
|
||||||
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
|
#if !defined(MBED_ROM_START)
|
||||||
// MCU Peripherals: 95 vectors = 380 bytes from 0x40 to 0x1BB
|
#define MBED_ROM_START 0x8000000
|
||||||
// Total: 111 vectors = 444 bytes (0x1BC) to be reserved in RAM
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_ROM_SIZE)
|
||||||
|
#define MBED_ROM_SIZE 0x200000 // 2.0 MB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_START)
|
||||||
|
#define MBED_RAM_START 0x20000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM_SIZE)
|
||||||
|
#define MBED_RAM_SIZE 0x40000 // 192KB SRAM1 + 64KB SRAM2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_START)
|
||||||
|
#define MBED_RAM1_START 0x20040000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MBED_RAM1_SIZE)
|
||||||
|
#define MBED_RAM1_SIZE 0x60000 // 384KB SRAM3
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NVIC_NUM_VECTORS 111
|
#define NVIC_NUM_VECTORS 111
|
||||||
#define NVIC_RAM_VECTOR_ADDRESS 0X20000000 // Vectors positioned at start of SRAM
|
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM_START
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3908,6 +3908,10 @@
|
||||||
"MPU"
|
"MPU"
|
||||||
],
|
],
|
||||||
"device_name": "STM32L4R5ZI",
|
"device_name": "STM32L4R5ZI",
|
||||||
|
"mbed_rom_start": "0x08000000",
|
||||||
|
"mbed_rom_size": "0x200000",
|
||||||
|
"mbed_ram_start": "0x20000000",
|
||||||
|
"mbed_ram_size": "0x40000",
|
||||||
"bootloader_supported": true
|
"bootloader_supported": true
|
||||||
},
|
},
|
||||||
"NUCLEO_L4R5ZI_P": {
|
"NUCLEO_L4R5ZI_P": {
|
||||||
|
@ -3970,7 +3974,11 @@
|
||||||
"USBDEVICE",
|
"USBDEVICE",
|
||||||
"MPU"
|
"MPU"
|
||||||
],
|
],
|
||||||
"bootloader_supported": false
|
"mbed_rom_start": "0x08000000",
|
||||||
|
"mbed_rom_size": "0x200000",
|
||||||
|
"mbed_ram_start": "0x20000000",
|
||||||
|
"mbed_ram_size": "0x40000",
|
||||||
|
"bootloader_supported": true
|
||||||
},
|
},
|
||||||
"NUCLEO_L552ZE_Q": {
|
"NUCLEO_L552ZE_Q": {
|
||||||
"inherits": [
|
"inherits": [
|
||||||
|
|
Loading…
Reference in New Issue