Skip to content

Commit 6996015

Browse files
author
Juho Eskeli
committed
Make MTB_ADV_WISE_1570 respect MBED_APP_START & enable bootloader
1 parent 5d8570b commit 6996015

File tree

6 files changed

+42
-12
lines changed

6 files changed

+42
-12
lines changed

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TARGET_MTB_ADV_WISE_1570/system_clock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void SystemInit(void)
9797
#ifdef VECT_TAB_SRAM
9898
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
9999
#else
100-
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
100+
SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; /* Vector Table Relocation in Internal FLASH */
101101
#endif
102102

103103
}
@@ -214,7 +214,7 @@ uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
214214
return 0; // FAIL
215215
}
216216
#endif
217-
217+
218218
// Select LSE output as LPUART1 clock source
219219
RCC_PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_RTC | RCC_PERIPHCLK_LPUART1;
220220
RCC_PeriphClkInit.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_LSE;

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/device/TOOLCHAIN_ARM_MICRO/stm32l486xx.sct

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#! armcc -E
12
; Scatter-Loading Description File
23
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
34
; Copyright (c) 2015, STMicroelectronics
@@ -27,10 +28,18 @@
2728
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2829
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2930

31+
#if !defined(MBED_APP_START)
32+
#define MBED_APP_START 0x08000000
33+
#endif
34+
35+
#if !defined(MBED_APP_SIZE)
36+
#define MBED_APP_SIZE 0x100000
37+
#endif
38+
3039
; 1MB FLASH (0x100000) + 128KB SRAM (0x20000)
31-
LR_IROM1 0x08000000 0x100000 { ; load region size_region
40+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
3241

33-
ER_IROM1 0x08000000 0x100000 { ; load address = execution address
42+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
3443
*.o (RESET, +First)
3544
*(InRoot$$Sections)
3645
.ANY (+RO)

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/device/TOOLCHAIN_ARM_STD/stm32l486xx.sct

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#! armcc -E
12
; Scatter-Loading Description File
23
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
34
; Copyright (c) 2015, STMicroelectronics
@@ -27,10 +28,18 @@
2728
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2829
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2930

31+
#if !defined(MBED_APP_START)
32+
#define MBED_APP_START 0x08000000
33+
#endif
34+
35+
#if !defined(MBED_APP_SIZE)
36+
#define MBED_APP_SIZE 0x100000
37+
#endif
38+
3039
; 1MB FLASH (0x100000) + 128KB SRAM (0x20000)
31-
LR_IROM1 0x08000000 0x100000 { ; load region size_region
40+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
3241

33-
ER_IROM1 0x08000000 0x100000 { ; load address = execution address
42+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
3443
*.o (RESET, +First)
3544
*(InRoot$$Sections)
3645
.ANY (+RO)

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/device/TOOLCHAIN_GCC_ARM/STM32L486XX.ld

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
#if !defined(MBED_APP_START)
2+
#define MBED_APP_START 0x08000000
3+
#endif
4+
5+
#if !defined(MBED_APP_SIZE)
6+
#define MBED_APP_SIZE 1024k
7+
#endif
8+
19
/* Linker script to configure memory regions. */
210
MEMORY
3-
{
4-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
11+
{
12+
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
513
SRAM2 (rwx) : ORIGIN = 0x10000188, LENGTH = 32k - 0x188
614
SRAM1 (rwx) : ORIGIN = 0x20000000, LENGTH = 96k
715
}
@@ -10,7 +18,7 @@ MEMORY
1018
* with other linker script that defines memory regions FLASH and RAM.
1119
* It references following symbols, which must be defined in code:
1220
* Reset_Handler : Entry of reset handler
13-
*
21+
*
1422
* It defines following symbols, which code can use without definition:
1523
* __exidx_start
1624
* __exidx_end

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/device/TOOLCHAIN_IAR/stm32l486xx.icf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
2+
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x80000; }
3+
14
/* [ROM = 1024kb = 0x100000] */
2-
define symbol __intvec_start__ = 0x08000000;
3-
define symbol __region_ROM_start__ = 0x08000000;
4-
define symbol __region_ROM_end__ = 0x080FFFFF;
5+
define symbol __intvec_start__ = MBED_APP_START;
6+
define symbol __region_ROM_start__ = MBED_APP_START;
7+
define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
58

69
/* [RAM = 96kb + 32kb = 0x20000] */
710
/* Vector table dynamic copy: Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM */

targets/targets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,6 +1711,7 @@
17111711
"device_has_remove": ["LPTICKER"],
17121712
"release_versions": ["5"],
17131713
"device_name": "STM32L486RG",
1714+
"bootloader_supported": true,
17141715
"OUTPUT_EXT": "hex"
17151716
},
17161717
"ARCH_MAX": {

0 commit comments

Comments
 (0)