Skip to content

Commit 1902cf9

Browse files
Maxim: Add bare metal support to targets
Add heap load region to scatter file and update `targets.json` to provide baremetal support to the following targets: SDT32620B, SDT32625B, MAX32620FTHR, MAX32625MBED, MAX32625PICO, and MAX32630FTHR.
1 parent 96e19af commit 1902cf9

File tree

5 files changed

+103
-20
lines changed

5 files changed

+103
-20
lines changed

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

Lines changed: 24 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,23 @@
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)
1937

20-
LR_IROM1 0x00000000 0x200000 { ; load region size_region
21-
ER_IROM1 0x00000000 0x200000 { ; load address = execution address
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
2240
*.o (RESET, +First)
2341
*(InRoot$$Sections)
2442
.ANY (+RO)
2543
}
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
44+
RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-RAM_FIXED_SIZE) { ; RW data
3045
.ANY (+RW +ZI)
3146
}
32-
ARM_LIB_STACK (0x20000000+0x40000) EMPTY -Stack_Size { ; stack
47+
ARM_LIB_HEAP AlignExpr(+0, +16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_RAM_START)){ ; heap region growing up
48+
}
49+
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack region growing down
3350
}
3451
}

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

Lines changed: 16 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,10 @@
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)
2334

2435
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
2536
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
@@ -28,10 +39,12 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
2839
.ANY (+RO)
2940
}
3041

31-
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
32-
RW_IRAM1 (0x20000000+0x110) (0x28000-0x110-Stack_Size) { ; RW data
42+
RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-RAM_FIXED_SIZE) { ; RW data
3343
.ANY (+RW +ZI)
3444
}
35-
ARM_LIB_STACK (0x20000000+0x28000) EMPTY -Stack_Size { ; stack
45+
46+
ARM_LIB_HEAP AlignExpr(+0, +16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_RAM_START)){ ; heap region growing up
47+
}
48+
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack region growing down
3649
}
3750
}

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

Lines changed: 25 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,24 @@
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+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
36+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
1837
*.o (RESET, +First)
1938
*(InRoot$$Sections)
2039
.ANY (+RO)
2140
}
2241

2342
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
24-
RW_IRAM1 (0x20000000+0x110) (0x28000-0x110-Stack_Size) { ; RW data
43+
RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-RAM_FIXED_SIZE) { ; RW data
2544
.ANY (+RW +ZI)
2645
}
27-
ARM_LIB_STACK (0x20000000+0x28000) EMPTY -Stack_Size { ; stack
46+
ARM_LIB_HEAP AlignExpr(+0, +16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_RAM_START)){ ; heap region growing up
47+
}
48+
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack region growing down
2849
}
2950
}

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

Lines changed: 26 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,24 @@
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+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
37+
ER_IROM1 MBED_APP_START MBED_APP_START { ; load address = execution address
1838
*.o (RESET, +First)
1939
*(InRoot$$Sections)
2040
.ANY (+RO)
2141
}
2242

2343
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
24-
RW_IRAM1 (0x20000000+0x110) (0x80000-0x110-Stack_Size) { ; RW data
44+
RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_START-RAM_FIXED_SIZE) { ; RW data
2545
.ANY (+RW +ZI)
2646
}
27-
ARM_LIB_STACK (0x20000000+0x80000) EMPTY -Stack_Size { ; stack
47+
ARM_LIB_HEAP AlignExpr(+0, +16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_RAM_START)){ ; heap growing up
48+
}
49+
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack
2850
}
2951
}

targets/targets.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5184,7 +5184,6 @@
51845184
],
51855185
"supported_toolchains": [
51865186
"GCC_ARM",
5187-
"IAR",
51885187
"ARM"
51895188
],
51905189
"device_has": [
@@ -5206,7 +5205,18 @@
52065205
],
52075206
"release_versions": [
52085207
"5"
5209-
]
5208+
],
5209+
"supported_application_profiles" : ["full", "bare-metal"],
5210+
"supported_c_libs": {
5211+
"arm": [
5212+
"std",
5213+
"small"
5214+
],
5215+
"gcc_arm": [
5216+
"std",
5217+
"small"
5218+
]
5219+
}
52105220
},
52115221
"MAX32625_BASE": {
52125222
"inherits": [

0 commit comments

Comments
 (0)