diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_ARM_STD/MBRZA1LU.sct b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_ARM_STD/MBRZA1LU.sct index e24f8c5..726e670 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_ARM_STD/MBRZA1LU.sct +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_ARM_STD/MBRZA1LU.sct @@ -9,25 +9,42 @@ #include "mem_RZ_A1LU.h" +#if !defined(MBED_APP_START) + #define MBED_APP_START 0x18000000 +#endif + +#if !defined(MBED_APP_SIZE) + #define MBED_APP_SIZE 0x800000 +#endif + LOAD_TTB __TTB_BASE __TTB_SIZE ; Page 0 of On-Chip Data Retention RAM { TTB +0 EMPTY 0x4000 { } ; Level-1 Translation Table for MMU } -SFLASH __ROM_BASE __ROM_SIZE ; load region size_region +SFLASH MBED_APP_START MBED_APP_SIZE ; load region size_region { - BOOT_LOADER_BEGIN __ROM_BASE FIXED +#if (MBED_APP_START == 0x18000000) + BOOT_LOADER_BEGIN MBED_APP_START FIXED { * (BOOT_LOADER) } - VECTORS __VECTOR_BASE FIXED + VECTORS (MBED_APP_START + 0x4000) FIXED { * (RESET, +FIRST) ; Vector table and other startup code * (InRoot$$Sections) ; All (library) code that must be in a root region * (+RO-CODE) ; Application RO code (.text) } +#else + VECTORS MBED_APP_START FIXED + { + * (RESET, +FIRST) ; Vector table and other startup code + * (InRoot$$Sections) ; All (library) code that must be in a root region + * (+RO-CODE) ; Application RO code (.text) + } +#endif RO_DATA +0 { * (+RO-DATA) } ; Application RO data (.constdata) diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_ARM_STD/mem_RZ_A1LU.h b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_ARM_STD/mem_RZ_A1LU.h index 46fb985..6414d9e 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_ARM_STD/mem_RZ_A1LU.h +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_ARM_STD/mem_RZ_A1LU.h @@ -42,10 +42,6 @@ // ROM Size (in Bytes) <0x0-0xFFFFFFFF:8> // *----------------------------------------------------------------------------*/ -#define __ROM_BASE 0x18000000 -#define __ROM_SIZE 0x08000000 - -#define __VECTOR_BASE 0x18004000 /*--------------------- RAM Configuration ----------------------------------- *----------------------------------------------------------------------------*/ diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_GCC_ARM/RZA1LU.ld b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_GCC_ARM/RZA1LU.ld index 4e00203..e27299d 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_GCC_ARM/RZA1LU.ld +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_GCC_ARM/RZA1LU.ld @@ -1,14 +1,33 @@ /* Linker script for mbed RZ_A1LU */ /* Linker script to configure memory regions. */ + +#if !defined(MBED_APP_START) + #define MBED_APP_START 0x18000000 +#endif + +#if !defined(MBED_APP_SIZE) + #define MBED_APP_SIZE 0x800000 +#endif + +#define BOOT_LOADER_ADDR (MBED_APP_START) +#if (MBED_APP_START == 0x18000000) + #define BOOT_LOADER_SIZE (0x00004000) +#else + #define BOOT_LOADER_SIZE (0x00000000) +#endif + +#define SFLASH_ADDR (MBED_APP_START + BOOT_LOADER_SIZE) +#define SFLASH_SIZE (MBED_APP_SIZE - BOOT_LOADER_SIZE) + MEMORY { - ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x02000000 - BOOT_LOADER (rx) : ORIGIN = 0x18000000, LENGTH = 0x00004000 - SFLASH (rx) : ORIGIN = 0x18004000, LENGTH = 0x07FFC000 - L_TTB (rw) : ORIGIN = 0x20000000, LENGTH = 0x00004000 - RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x001E0000 - RAM_NC (rwx) : ORIGIN = 0x20200000, LENGTH = 0x00100000 + ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x02000000 + BOOT_LOADER (rx) : ORIGIN = BOOT_LOADER_ADDR, LENGTH = BOOT_LOADER_SIZE + SFLASH (rx) : ORIGIN = SFLASH_ADDR, LENGTH = SFLASH_SIZE + L_TTB (rw) : ORIGIN = 0x20000000, LENGTH = 0x00004000 + RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x001E0000 + RAM_NC (rwx) : ORIGIN = 0x20200000, LENGTH = 0x00100000 } /* Linker script to place sections and symbol values. Should be used together @@ -41,17 +60,18 @@ SECTIONS { +#if (MBED_APP_START == 0x18000000) .boot : { KEEP(*(.boot_loader)) } > BOOT_LOADER +#endif .text : { Image$$VECTORS$$Base = .; * (RESET) - . += 0x00000400; KEEP(*(.isr_vector)) *(SVC_TABLE) diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_IAR/MBRZA1LU.icf b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_IAR/MBRZA1LU.icf index 5d72266..8d921c4 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_IAR/MBRZA1LU.icf +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_IAR/MBRZA1LU.icf @@ -2,10 +2,20 @@ /*-Editor annotation file-*/ /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ /*-Specials-*/ -define symbol __ICFEDIT_intvec_start__ = 0x18004000; +if (!isdefinedsymbol(MBED_APP_START)) { + define symbol MBED_APP_START = 0x18000000; +} +if (MBED_APP_START == 0x18000000) { + define symbol __ICFEDIT_intvec_start__ = MBED_APP_START + 0x4000; +} else { + define symbol __ICFEDIT_intvec_start__ = MBED_APP_START; +} +if (!isdefinedsymbol(MBED_APP_SIZE)) { + define symbol MBED_APP_SIZE = 0x800000; +} /*-Memory Regions-*/ -define symbol __ICFEDIT_region_ROM_start__ = 0x18000000; -define symbol __ICFEDIT_region_ROM_end__ = 0x187FFFFF; +define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START; +define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1; define symbol __ICFEDIT_region_TTB_start__ = 0x20000000; define symbol __ICFEDIT_region_TTB_end__ = 0x2001FFFF; define symbol __ICFEDIT_region_RAM_start__ = 0x20020000; diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/mbed_sf_boot.c b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/mbed_sf_boot.c index 2c7620a..6d25278 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/mbed_sf_boot.c +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/mbed_sf_boot.c @@ -26,6 +26,15 @@ * $Date:: $ * @brief RZ_A1 serial flash boot loader ******************************************************************************/ +#if !defined(APPLICATION_ADDR) + #define APPLICATION_ADDR 0x18000000 +#endif + +#if (APPLICATION_ADDR != 0x18000000) +const char * boot_loader = (char *)0x18000000; + +#else /* (APPLICATION_ADDR == 0x18000000) */ + #if defined (__CC_ARM) #pragma arm section rodata = "BOOT_LOADER" const char boot_loader[] __attribute__((used)) = @@ -825,3 +834,4 @@ #pragma arm section #endif +#endif /* APPLICATION_ADDR */ diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_ARM_STD/MBRZA1H.sct b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_ARM_STD/MBRZA1H.sct index cb8b9da..2336a3a 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_ARM_STD/MBRZA1H.sct +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_ARM_STD/MBRZA1H.sct @@ -9,25 +9,42 @@ #include "mem_RZ_A1H.h" +#if !defined(MBED_APP_START) + #define MBED_APP_START 0x18000000 +#endif + +#if !defined(MBED_APP_SIZE) + #define MBED_APP_SIZE 0x800000 +#endif + LOAD_TTB __TTB_BASE __TTB_SIZE ; Page 0 of On-Chip Data Retention RAM { TTB +0 EMPTY 0x4000 { } ; Level-1 Translation Table for MMU } -SFLASH __ROM_BASE __ROM_SIZE ; load region size_region +SFLASH MBED_APP_START MBED_APP_SIZE ; load region size_region { - BOOT_LOADER_BEGIN __ROM_BASE FIXED +#if (MBED_APP_START == 0x18000000) + BOOT_LOADER_BEGIN MBED_APP_START FIXED { * (BOOT_LOADER) } - VECTORS __VECTOR_BASE FIXED + VECTORS (MBED_APP_START + 0x4000) FIXED { * (RESET, +FIRST) ; Vector table and other startup code * (InRoot$$Sections) ; All (library) code that must be in a root region * (+RO-CODE) ; Application RO code (.text) } +#else + VECTORS MBED_APP_START FIXED + { + * (RESET, +FIRST) ; Vector table and other startup code + * (InRoot$$Sections) ; All (library) code that must be in a root region + * (+RO-CODE) ; Application RO code (.text) + } +#endif RO_DATA +0 { * (+RO-DATA) } ; Application RO data (.constdata) diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_ARM_STD/mem_RZ_A1H.h b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_ARM_STD/mem_RZ_A1H.h index 38a9986..e7ddd4f 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_ARM_STD/mem_RZ_A1H.h +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_ARM_STD/mem_RZ_A1H.h @@ -42,10 +42,6 @@ // ROM Size (in Bytes) <0x0-0xFFFFFFFF:8> // *----------------------------------------------------------------------------*/ -#define __ROM_BASE 0x18000000 -#define __ROM_SIZE 0x08000000 - -#define __VECTOR_BASE 0x18004000 /*--------------------- RAM Configuration ----------------------------------- *----------------------------------------------------------------------------*/ diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_GCC_ARM/RZA1H.ld b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_GCC_ARM/RZA1H.ld index f5f918c..2b10e18 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_GCC_ARM/RZA1H.ld +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_GCC_ARM/RZA1H.ld @@ -1,14 +1,33 @@ /* Linker script for mbed RZ_A1H */ /* Linker script to configure memory regions. */ + +#if !defined(MBED_APP_START) + #define MBED_APP_START 0x18000000 +#endif + +#if !defined(MBED_APP_SIZE) + #define MBED_APP_SIZE 0x800000 +#endif + +#define BOOT_LOADER_ADDR (MBED_APP_START) +#if (MBED_APP_START == 0x18000000) + #define BOOT_LOADER_SIZE (0x00004000) +#else + #define BOOT_LOADER_SIZE (0x00000000) +#endif + +#define SFLASH_ADDR (MBED_APP_START + BOOT_LOADER_SIZE) +#define SFLASH_SIZE (MBED_APP_SIZE - BOOT_LOADER_SIZE) + MEMORY { - ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x02000000 - BOOT_LOADER (rx) : ORIGIN = 0x18000000, LENGTH = 0x00004000 - SFLASH (rx) : ORIGIN = 0x18004000, LENGTH = 0x07FFC000 - L_TTB (rw) : ORIGIN = 0x20000000, LENGTH = 0x00004000 - RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x008E0000 - RAM_NC (rwx) : ORIGIN = 0x20900000, LENGTH = 0x00100000 + ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x02000000 + BOOT_LOADER (rx) : ORIGIN = BOOT_LOADER_ADDR, LENGTH = BOOT_LOADER_SIZE + SFLASH (rx) : ORIGIN = SFLASH_ADDR, LENGTH = SFLASH_SIZE + L_TTB (rw) : ORIGIN = 0x20000000, LENGTH = 0x00004000 + RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x008E0000 + RAM_NC (rwx) : ORIGIN = 0x20900000, LENGTH = 0x00100000 } /* Linker script to place sections and symbol values. Should be used together @@ -41,17 +60,18 @@ SECTIONS { +#if (MBED_APP_START == 0x18000000) .boot : { KEEP(*(.boot_loader)) } > BOOT_LOADER +#endif .text : { Image$$VECTORS$$Base = .; * (RESET) - . += 0x00000400; KEEP(*(.isr_vector)) *(SVC_TABLE) diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_IAR/MBRZA1H.icf b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_IAR/MBRZA1H.icf index 3bd5dca..9d637d8 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_IAR/MBRZA1H.icf +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_IAR/MBRZA1H.icf @@ -2,10 +2,20 @@ /*-Editor annotation file-*/ /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ /*-Specials-*/ -define symbol __ICFEDIT_intvec_start__ = 0x18004000; +if (!isdefinedsymbol(MBED_APP_START)) { + define symbol MBED_APP_START = 0x18000000; +} +if (MBED_APP_START == 0x18000000) { + define symbol __ICFEDIT_intvec_start__ = MBED_APP_START + 0x4000; +} else { + define symbol __ICFEDIT_intvec_start__ = MBED_APP_START; +} +if (!isdefinedsymbol(MBED_APP_SIZE)) { + define symbol MBED_APP_SIZE = 0x800000; +} /*-Memory Regions-*/ -define symbol __ICFEDIT_region_ROM_start__ = 0x18000000; -define symbol __ICFEDIT_region_ROM_end__ = 0x187FFFFF; +define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START; +define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1; define symbol __ICFEDIT_region_TTB_start__ = 0x20000000; define symbol __ICFEDIT_region_TTB_end__ = 0x2001FFFF; define symbol __ICFEDIT_region_RAM_start__ = 0x20020000; diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/mbed_sf_boot.c b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/mbed_sf_boot.c index 4d254a2..bc50ddf 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/mbed_sf_boot.c +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/mbed_sf_boot.c @@ -26,6 +26,15 @@ * $Date:: $ * @brief RZ_A1 serial flash boot loader ******************************************************************************/ +#if !defined(APPLICATION_ADDR) + #define APPLICATION_ADDR 0x18000000 +#endif + +#if (APPLICATION_ADDR != 0x18000000) +const char * boot_loader = (char *)0x18000000; + +#else /* (APPLICATION_ADDR == 0x18000000) */ + #if defined (__CC_ARM) #pragma arm section rodata = "BOOT_LOADER" const char boot_loader[] __attribute__((used)) = @@ -826,3 +835,4 @@ #pragma arm section #endif +#endif /* APPLICATION_ADDR */ diff --git a/targets/targets.json b/targets/targets.json index 0c69238..c1cf41d 100755 --- a/targets/targets.json +++ b/targets/targets.json @@ -2845,7 +2845,9 @@ "supported_form_factors": ["ARDUINO"], "extra_labels_add": ["RZA1H", "MBRZA1H", "RZ_A1_EMAC"], "device_has_add": ["EMAC", "FLASH"], - "release_versions": ["2", "5"] + "release_versions": ["2", "5"], + "device_name": "R7S72100", + "bootloader_supported": true }, "VK_RZ_A1H": { "inherits": ["RZ_A1XX"], @@ -2861,6 +2863,8 @@ "device_has_remove": ["ETHERNET"], "features_remove": ["LWIP"], "release_versions": ["2", "5"], + "device_name": "R7S72103", + "bootloader_supported": true, "overrides": { "network-default-interface-type": null }