From ed94e6aa350a5c0d53046e5133b16337d9494e75 Mon Sep 17 00:00:00 2001 From: Keyur Hariya Date: Mon, 14 May 2018 08:50:55 -0500 Subject: [PATCH] Add bootloader configuration parameters for MAX32625PICO and rework targets.json --- .../PeripheralNames.h | 0 .../PinNames.h | 0 .../low_level_init.c | 0 .../TARGET_MAX32625_BOOT/MAX32625.sct | 13 ++++++++-- .../TARGET_MAX32625_BOOT/max32625.ld | 10 ++++++- .../TARGET_MAX32625_BOOT/MAX32625.icf | 13 +++++++--- targets/targets.json | 26 +++++-------------- 7 files changed, 37 insertions(+), 25 deletions(-) rename targets/TARGET_Maxim/TARGET_MAX32625/{TARGET_MAX32625PICO_BASE => TARGET_MAX32625PICO}/PeripheralNames.h (100%) rename targets/TARGET_Maxim/TARGET_MAX32625/{TARGET_MAX32625PICO_BASE => TARGET_MAX32625PICO}/PinNames.h (100%) rename targets/TARGET_Maxim/TARGET_MAX32625/{TARGET_MAX32625PICO_BASE => TARGET_MAX32625PICO}/low_level_init.c (100%) diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO_BASE/PeripheralNames.h b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/PeripheralNames.h similarity index 100% rename from targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO_BASE/PeripheralNames.h rename to targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/PeripheralNames.h diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO_BASE/PinNames.h b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/PinNames.h similarity index 100% rename from targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO_BASE/PinNames.h rename to targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/PinNames.h diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO_BASE/low_level_init.c b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/low_level_init.c similarity index 100% rename from targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO_BASE/low_level_init.c rename to targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/low_level_init.c diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_BOOT/MAX32625.sct b/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_BOOT/MAX32625.sct index 9d1329923b..83525ba4fe 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_BOOT/MAX32625.sct +++ b/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_BOOT/MAX32625.sct @@ -1,9 +1,18 @@ +#! armcc -E ; MAX32625 ; 512KB FLASH (0x80000) @ 0x000000000 ; 160KB RAM (0x28000) @ 0x20000000 -LR_IROM1 0x000010000 0x70000 { ; load region size_region - ER_IROM1 0x000010000 0x70000 { ; load address = execution address +#if !defined(MBED_APP_START) + #define MBED_APP_START 0x00010000 +#endif + +#if !defined(MBED_APP_SIZE) + #define MBED_APP_SIZE 0x00070000 +#endif + +LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region + ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625_BOOT/max32625.ld b/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625_BOOT/max32625.ld index f9d978a8e8..dee71737a8 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625_BOOT/max32625.ld +++ b/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625_BOOT/max32625.ld @@ -31,9 +31,17 @@ ******************************************************************************* */ +#if !defined(MBED_APP_START) + #define MBED_APP_START 0x00010000 +#endif + +#if !defined(MBED_APP_SIZE) + #define MBED_APP_SIZE 0x00070000 +#endif + MEMORY { - FLASH (rx) : ORIGIN = 0x00010000, LENGTH = 0x00070000 + FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00028000 } diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_IAR/TARGET_MAX32625_BOOT/MAX32625.icf b/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_IAR/TARGET_MAX32625_BOOT/MAX32625.icf index 622cf2839d..716245bf71 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_IAR/TARGET_MAX32625_BOOT/MAX32625.icf +++ b/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_IAR/TARGET_MAX32625_BOOT/MAX32625.icf @@ -1,7 +1,14 @@ +if (!isdefinedsymbol(MBED_APP_START)) { + define symbol MBED_APP_START = 0x00010000; +} +if (!isdefinedsymbol(MBED_APP_SIZE)) { + define symbol MBED_APP_SIZE = 0x00070000; +} + /* [ROM] */ -define symbol __intvec_start__ = 0x00010000; -define symbol __region_ROM_start__ = 0x00010000; -define symbol __region_ROM_end__ = 0x0007FFFF; +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] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110) bytes */ define symbol __NVIC_start__ = 0x00010000; diff --git a/targets/targets.json b/targets/targets.json index 9851f37f90..910756cdf3 100755 --- a/targets/targets.json +++ b/targets/targets.json @@ -2909,33 +2909,21 @@ "extra_labels": ["Maxim", "MAX32625"], "supported_toolchains": ["GCC_ARM", "IAR", "ARM"], "device_has": ["ANALOGIN", "I2C", "INTERRUPTIN", "LPTICKER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "STDIO_MESSAGES", "USTICKER"], + "device_name": "MAX32625", "release_versions": ["2", "5"], "public": false }, - "MAX32625_BOOT": { - "inherits": ["MAX32625_BASE"], - "extra_labels_add": ["MAX32625_BOOT"], - "public": false - }, - "MAX32625_NO_BOOT": { - "inherits": ["MAX32625_BASE"], - "extra_labels_add": ["MAX32625_NO_BOOT"], - "public": false - }, "MAX32625MBED": { - "inherits": ["MAX32625_NO_BOOT"] + "inherits": ["MAX32625_BASE"], + "extra_labels_add": ["MAX32625_NO_BOOT"] }, "MAX32625PICO": { - "inherits": ["MAX32625_BOOT"], - "extra_labels_add": ["MAX32625PICO_BASE"] - }, - "MAX32625PICO_NO_BOOT": { - "inherits": ["MAX32625_NO_BOOT"], - "extra_labels_add": ["MAX32625PICO_BASE"] + "inherits": ["MAX32625_BASE"], + "extra_labels_add": ["MAX32625_BOOT"], + "bootloader_supported": true }, "MAX32625NEXPAQ": { - "inherits": ["MAX32625_BASE"], - "extra_labels_add": ["MAX32625NEXPAQ"] + "inherits": ["MAX32625_BASE"] }, "MAX32630FTHR": { "inherits": ["Target"],