diff --git a/targets/TARGET_GigaDevice/TARGET_GD32F30X/TARGET_GD32F307VG/device/TOOLCHAIN_ARM_STD/gd32f307vg.sct b/targets/TARGET_GigaDevice/TARGET_GD32F30X/TARGET_GD32F307VG/device/TOOLCHAIN_ARM_STD/gd32f307vg.sct index bd465b299e..cc2d580532 100644 --- a/targets/TARGET_GigaDevice/TARGET_GD32F30X/TARGET_GD32F307VG/device/TOOLCHAIN_ARM_STD/gd32f307vg.sct +++ b/targets/TARGET_GigaDevice/TARGET_GD32F30X/TARGET_GD32F307VG/device/TOOLCHAIN_ARM_STD/gd32f307vg.sct @@ -4,11 +4,19 @@ ; ***** #if !defined(MBED_APP_START) - #define MBED_APP_START 0x08000000 + #define MBED_APP_START 0x08000000 #endif #if !defined(MBED_APP_SIZE) - #define MBED_APP_SIZE 0x100000 + #define MBED_APP_SIZE 0x100000 +#endif + +#if !defined(MBED_RAM_START) + #define MBED_RAM_START 0x20000000 +#endif + +#if !defined(MBED_RAM_SIZE) + #define MBED_RAM_SIZE 0x00018000 #endif #if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE) @@ -19,7 +27,15 @@ # endif #endif -#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE + +; 84 vectors (16 core + 68 peripheral) * 4 bytes = 336 bytes to reserve (0x150) +#define VECTOR_SIZE 0x150 + +#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE + +#define RAM_FIXED_SIZE (Stack_Size+VECTOR_SIZE) + +#define MBED_RAM1_START (MBED_RAM_START+VECTOR_SIZE) LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region (1024K) @@ -30,11 +46,14 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region (1024K) } ; 84 vectors (16 core + 68 peripheral) * 4 bytes = 336 bytes to reserve (0x150) - RW_IRAM1 (0x20000000+0x150) (0x18000-0x150-Stack_Size) { ; RW data + RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-VECTOR_SIZE-Stack_Size) { ; RW data .ANY (+RW +ZI) } - ARM_LIB_STACK (0x20000000+0x18000) EMPTY -Stack_Size { ; stack + ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM1_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) { + } + + ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack } } diff --git a/targets/TARGET_GigaDevice/TARGET_GD32F4XX/device/TOOLCHAIN_ARM_STD/gd32f450zi.sct b/targets/TARGET_GigaDevice/TARGET_GD32F4XX/device/TOOLCHAIN_ARM_STD/gd32f450zi.sct index cd82ae74fa..13da3c6583 100644 --- a/targets/TARGET_GigaDevice/TARGET_GD32F4XX/device/TOOLCHAIN_ARM_STD/gd32f450zi.sct +++ b/targets/TARGET_GigaDevice/TARGET_GD32F4XX/device/TOOLCHAIN_ARM_STD/gd32f450zi.sct @@ -4,13 +4,22 @@ ; ***** #if !defined(MBED_APP_START) - #define MBED_APP_START 0x08000000 + #define MBED_APP_START 0x08000000 #endif #if !defined(MBED_APP_SIZE) - #define MBED_APP_SIZE 0x200000 + #define MBED_APP_SIZE 0x00200000 #endif +#if !defined(MBED_RAM_START) + #define MBED_RAM_START 0x20000000 +#endif + +#if !defined(MBED_RAM_SIZE) + #define MBED_RAM_SIZE 0x30000 +#endif + + #if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE) # if defined(MBED_BOOT_STACK_SIZE) # define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE @@ -21,6 +30,13 @@ #define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE +; 107 vectors (16 core + 91 peripheral) * 4 bytes = 428 bytes to reserve (0x1B0, 8-byte aligned) +#define VECTOR_SIZE 0x1B0 + +#define RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE+VECTOR_SIZE) + +#define MBED_RAM1_START (MBED_RAM_START+VECTOR_SIZE) + LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region (3*1024K) ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address @@ -30,10 +46,13 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region (3*1024K) } ; 107 vectors (16 core + 91 peripheral) * 4 bytes = 428 bytes to reserve (0x1B0, 8-byte aligned) - RW_IRAM1 (0x20000000+0x1B0) (0x30000-0x1B0-Stack_Size) { ; RW data + RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-VECTOR_SIZE-Stack_Size) { ; RW data .ANY (+RW +ZI) } - ARM_LIB_STACK 0x20000000+0x30000 EMPTY -Stack_Size { ; Stack region growing down + ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM1_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) { + } + + ARM_LIB_STACK MBED_RAM_START+MBED_RAM_SIZE EMPTY -Stack_Size { ; Stack region growing down } } diff --git a/targets/targets.json b/targets/targets.json index ef62982274..f9c6153d72 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -7499,7 +7499,6 @@ ], "supported_toolchains": [ "ARM", - "IAR", "GCC_ARM" ], "device_has_add": [ @@ -7511,6 +7510,19 @@ "PORTOUT", "PWMOUT", "SERIAL" + ], + "supported_c_libs": { + "arm": [ + "std", + "small" + ], + "gcc_arm": [ + "std", + "small" + ] + }, + "supported_application_profiles": [ + "full", "bare-metal" ] }, "GD32_F307VG": {