Skip to content

Commit 6d1a6da

Browse files
authored
Merge pull request #14466 from harmut01/baremetal_gigadevice
GigaDevice: Add bare metal support for targets
2 parents d20384a + ea83d07 commit 6d1a6da

File tree

7 files changed

+60
-869
lines changed

7 files changed

+60
-869
lines changed

targets/TARGET_GigaDevice/TARGET_GD32F30X/TARGET_GD32F307VG/device/TOOLCHAIN_ARM_MICRO/gd32f307vg.sct

Lines changed: 0 additions & 55 deletions
This file was deleted.

targets/TARGET_GigaDevice/TARGET_GD32F30X/TARGET_GD32F307VG/device/TOOLCHAIN_ARM_MICRO/startup_gd32f30x_cl.S

Lines changed: 0 additions & 339 deletions
This file was deleted.

targets/TARGET_GigaDevice/TARGET_GD32F30X/TARGET_GD32F307VG/device/TOOLCHAIN_ARM_STD/gd32f307vg.sct

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@
44
; *****
55

66
#if !defined(MBED_APP_START)
7-
#define MBED_APP_START 0x08000000
7+
#define MBED_APP_START 0x08000000
88
#endif
99

1010
#if !defined(MBED_APP_SIZE)
11-
#define MBED_APP_SIZE 0x100000
11+
#define MBED_APP_SIZE 0x100000
12+
#endif
13+
14+
#if !defined(MBED_RAM_START)
15+
#define MBED_RAM_START 0x20000000
16+
#endif
17+
18+
#if !defined(MBED_RAM_SIZE)
19+
#define MBED_RAM_SIZE 0x00018000
1220
#endif
1321

1422
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
@@ -19,7 +27,15 @@
1927
# endif
2028
#endif
2129

22-
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
30+
31+
; 84 vectors (16 core + 68 peripheral) * 4 bytes = 336 bytes to reserve (0x150)
32+
#define VECTOR_SIZE 0x150
33+
34+
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
35+
36+
#define RAM_FIXED_SIZE (Stack_Size+VECTOR_SIZE)
37+
38+
#define MBED_RAM1_START (MBED_RAM_START+VECTOR_SIZE)
2339

2440
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region (1024K)
2541

@@ -30,11 +46,14 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region (1024K)
3046
}
3147

3248
; 84 vectors (16 core + 68 peripheral) * 4 bytes = 336 bytes to reserve (0x150)
33-
RW_IRAM1 (0x20000000+0x150) (0x18000-0x150-Stack_Size) { ; RW data
49+
RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-RAM_FIXED_SIZE) { ; RW data
3450
.ANY (+RW +ZI)
3551
}
3652

37-
ARM_LIB_STACK (0x20000000+0x18000) EMPTY -Stack_Size { ; stack
53+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM1_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap region growing up
54+
}
55+
56+
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; Stack region growing down
3857
}
3958
}
4059

targets/TARGET_GigaDevice/TARGET_GD32F4XX/device/TOOLCHAIN_ARM_MICRO/gd32f450zi.sct

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)