Skip to content

Commit 016d725

Browse files
authored
Merge pull request #14465 from harmut01/baremetal_maxim
Maxim: Add bare metal support to targets
2 parents 32d1c99 + 1c671c4 commit 016d725

File tree

5 files changed

+115
-20
lines changed

5 files changed

+115
-20
lines changed

targets/TARGET_Maxim/TARGET_MAX32620C/device/TOOLCHAIN_ARM_STD/MAX32620.sct

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,22 @@
44
; 256KB RAM (0x40000) @ 0x20000000
55

66

7+
#if !defined(MBED_APP_START)
8+
#define MBED_APP_START 0x000000000
9+
#endif
10+
11+
#if !defined(MBED_APP_SIZE)
12+
#define MBED_APP_SIZE 0x200000
13+
#endif
714

815
; MAX32620: 2MB FLASH (0x200000) + 256KB RAM (0x40000)
16+
#if !defined(MBED_RAM_SIZE)
17+
#define MBED_RAM_SIZE 0x40000
18+
#endif
19+
20+
#if !defined(MBED_RAM_START)
21+
#define MBED_RAM_START 0x20000000
22+
#endif
923

1024
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
1125
# if defined(MBED_BOOT_STACK_SIZE)
@@ -15,20 +29,26 @@
1529
# endif
1630
#endif
1731

32+
; [RAM] Vector table dynamic copy: 65 vectors * 4 bytes = 260 (0x104) + 4
33+
; for 8 byte alignment
34+
#define VECTOR_SIZE 0x108
1835
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
36+
#define RAM_FIXED_SIZE (Stack_Size + VECTOR_SIZE)
37+
38+
#define MBED_RAM1_START (MBED_RAM_START+VECTOR_SIZE)
39+
#define MBED_RAM1_SIZE (MBED_RAM_SIZE-RAM_FIXED_SIZE)
1940

20-
LR_IROM1 0x00000000 0x200000 { ; load region size_region
21-
ER_IROM1 0x00000000 0x200000 { ; load address = execution address
41+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
42+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
2243
*.o (RESET, +First)
2344
*(InRoot$$Sections)
2445
.ANY (+RO)
2546
}
26-
27-
; [RAM] Vector table dynamic copy: 65 vectors * 4 bytes = 260 (0x104) + 4
28-
; for 8 byte alignment
29-
RW_IRAM1 (0x20000000+0x108) (0x40000-0x108-Stack_Size) { ; RW data
47+
RW_IRAM1 MBED_RAM1_START MBED_RAM1_SIZE { ; RW data
3048
.ANY (+RW +ZI)
3149
}
32-
ARM_LIB_STACK (0x20000000+0x40000) EMPTY -Stack_Size { ; stack
50+
ARM_LIB_HEAP AlignExpr(+0, +16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_RAM1_START)){ ; heap region growing up
51+
}
52+
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack region growing down
3353
}
3454
}

targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_BOOT/MAX32625.sct

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
#define MBED_APP_SIZE 0x00070000
1212
#endif
1313

14+
#if !defined(MBED_RAM_SIZE)
15+
#define MBED_RAM_SIZE 0x28000
16+
#endif
17+
18+
#if !defined(MBED_RAM_START)
19+
#define MBED_RAM_START 0x20000000
20+
#endif
21+
1422
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
1523
# if defined(MBED_BOOT_STACK_SIZE)
1624
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
@@ -19,7 +27,13 @@
1927
# endif
2028
#endif
2129

30+
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
31+
#define VECTOR_SIZE 0x110
2232
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
33+
#define RAM_FIXED_SIZE (Stack_Size + VECTOR_SIZE)
34+
35+
#define MBED_RAM1_START (MBED_RAM_START+VECTOR_SIZE)
36+
#define MBED_RAM1_SIZE (MBED_RAM_SIZE-RAM_FIXED_SIZE)
2337

2438
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
2539
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
@@ -28,10 +42,12 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
2842
.ANY (+RO)
2943
}
3044

31-
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
32-
RW_IRAM1 (0x20000000+0x110) (0x28000-0x110-Stack_Size) { ; RW data
45+
RW_IRAM1 MBED_RAM1_START MBED_RAM1_SIZE { ; RW data
3346
.ANY (+RW +ZI)
3447
}
35-
ARM_LIB_STACK (0x20000000+0x28000) EMPTY -Stack_Size { ; stack
48+
49+
ARM_LIB_HEAP AlignExpr(+0, +16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_RAM1_START)){ ; heap region growing up
50+
}
51+
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack region growing down
3652
}
3753
}

targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_NO_BOOT/MAX32625.sct

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
; 512KB FLASH (0x80000) @ 0x000000000
44
; 160KB RAM (0x28000) @ 0x20000000
55

6+
#if !defined(MBED_APP_START)
7+
#define MBED_APP_START 0x000000000
8+
#endif
9+
10+
#if !defined(MBED_APP_SIZE)
11+
#define MBED_APP_SIZE 0x80000
12+
#endif
13+
14+
#if !defined(MBED_RAM_SIZE)
15+
#define MBED_RAM_SIZE 0x28000
16+
#endif
17+
18+
#if !defined(MBED_RAM_START)
19+
#define MBED_RAM_START 0x20000000
20+
#endif
21+
622
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
723
# if defined(MBED_BOOT_STACK_SIZE)
824
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
@@ -11,19 +27,27 @@
1127
# endif
1228
#endif
1329

30+
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
31+
#define VECTOR_SIZE 0x110
1432
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
33+
#define RAM_FIXED_SIZE (Stack_Size + VECTOR_SIZE)
1534

16-
LR_IROM1 0x000000000 0x80000 { ; load region size_region
17-
ER_IROM1 0x000000000 0x80000 { ; load address = execution address
35+
#define MBED_RAM1_START (MBED_RAM_START+VECTOR_SIZE)
36+
#define MBED_RAM1_SIZE (MBED_RAM_SIZE-RAM_FIXED_SIZE)
37+
38+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
39+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
1840
*.o (RESET, +First)
1941
*(InRoot$$Sections)
2042
.ANY (+RO)
2143
}
2244

2345
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
24-
RW_IRAM1 (0x20000000+0x110) (0x28000-0x110-Stack_Size) { ; RW data
46+
RW_IRAM1 MBED_RAM1_START MBED_RAM1_SIZE { ; RW data
2547
.ANY (+RW +ZI)
2648
}
27-
ARM_LIB_STACK (0x20000000+0x28000) EMPTY -Stack_Size { ; stack
49+
ARM_LIB_HEAP AlignExpr(+0, +16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_RAM1_START)){ ; heap region growing up
50+
}
51+
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack region growing down
2852
}
2953
}

targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_ARM_STD/MAX3263x.sct

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@
33
; 2MB FLASH (0x200000) @ 0x000000000
44
; 512KB RAM (0x80000) @ 0x20000000
55

6+
#if !defined(MBED_APP_START)
7+
#define MBED_APP_START 0x000000000
8+
#endif
9+
10+
#if !defined(MBED_APP_SIZE)
11+
#define MBED_APP_SIZE 0x200000
12+
#endif
13+
14+
; MAX32620: 2MB FLASH (0x200000) + 256KB RAM (0x40000)
15+
#if !defined(MBED_RAM_SIZE)
16+
#define MBED_RAM_SIZE 0x80000
17+
#endif
18+
19+
#if !defined(MBED_RAM_START)
20+
#define MBED_RAM_START 0x20000000
21+
#endif
22+
623
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
724
# if defined(MBED_BOOT_STACK_SIZE)
825
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
@@ -11,19 +28,27 @@
1128
# endif
1229
#endif
1330

31+
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
32+
#define VECTOR_SIZE 0x110
1433
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
34+
#define RAM_FIXED_SIZE (Stack_Size + VECTOR_SIZE)
1535

16-
LR_IROM1 0x000000000 0x200000 { ; load region size_region
17-
ER_IROM1 0x000000000 0x200000 { ; load address = execution address
36+
#define MBED_RAM1_START (MBED_RAM_START+VECTOR_SIZE)
37+
#define MBED_RAM1_SIZE (MBED_RAM_SIZE-RAM_FIXED_SIZE)
38+
39+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
40+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
1841
*.o (RESET, +First)
1942
*(InRoot$$Sections)
2043
.ANY (+RO)
2144
}
2245

2346
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
24-
RW_IRAM1 (0x20000000+0x110) (0x80000-0x110-Stack_Size) { ; RW data
47+
RW_IRAM1 MBED_RAM1_START MBED_RAM1_SIZE { ; RW data
2548
.ANY (+RW +ZI)
2649
}
27-
ARM_LIB_STACK (0x20000000+0x80000) EMPTY -Stack_Size { ; stack
50+
ARM_LIB_HEAP AlignExpr(+0, +16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_RAM1_START)){ ; heap region growing up
51+
}
52+
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack region growing down
2853
}
2954
}

targets/targets.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5212,7 +5212,6 @@
52125212
],
52135213
"supported_toolchains": [
52145214
"GCC_ARM",
5215-
"IAR",
52165215
"ARM"
52175216
],
52185217
"device_has": [
@@ -5234,7 +5233,18 @@
52345233
],
52355234
"release_versions": [
52365235
"5"
5237-
]
5236+
],
5237+
"supported_application_profiles" : ["full", "bare-metal"],
5238+
"supported_c_libs": {
5239+
"arm": [
5240+
"std",
5241+
"small"
5242+
],
5243+
"gcc_arm": [
5244+
"std",
5245+
"small"
5246+
]
5247+
}
52385248
},
52395249
"MAX32625_BASE": {
52405250
"inherits": [

0 commit comments

Comments
 (0)