Skip to content

Commit ee5946c

Browse files
Add bare metal support to EFM32 targets
Modify scatter files to add heap load region, and remove hard coded values. Add supported c libs and bare metal profile to `targets.json` configurations. Affects the following targets: EFM32GG_STK3700, TB_SENSE_12, and EFM32GG11_STK3701.
1 parent 5b1c704 commit ee5946c

File tree

4 files changed

+97
-20
lines changed

4 files changed

+97
-20
lines changed

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/TARGET_1024K/TOOLCHAIN_ARM_STD/efm32gg.sct

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

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 0x20000
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,19 +27,25 @@
1927
# endif
2028
#endif
2129

30+
#define Vector_Size 0xE0
2231
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
2332

33+
#define MBED_IRAM1_SIZE (MBED_RAM_SIZE - Vector_Size - Stack_Size)
34+
#define MBED_IRAM1_START (MBED_RAM_START + Vector_Size)
35+
#define RAM_FIXED_SIZE (Vector_Size + Stack_Size)
36+
2437
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
2538
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
2639
*.o (RESET, +First)
2740
*(InRoot$$Sections)
2841
.ANY (+RO)
2942
}
30-
RW_IRAM1 0x200000E0 0x0001FF20-Stack_Size { ; RW data
43+
RW_IRAM1 MBED_IRAM1_START MBED_IRAM1_SIZE { ; RW data
3144
.ANY (+RW +ZI)
3245
}
33-
34-
ARM_LIB_STACK (0x200000E0+0x0001FF20) EMPTY -Stack_Size { ; stack
46+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_IRAM1_START)) { ; heap growing up
47+
}
48+
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack
3549
}
3650
}
3751

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG11/device/TOOLCHAIN_ARM_STD/efm32gg11.sct

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

14+
#if !defined(MBED_RAM_)
15+
#define MBED_RAM_START 0x20000000
16+
#endif
17+
18+
#if !defined(MBED_RAM_)
19+
#define MBED_RAM_SIZE 0x80000
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,19 +27,26 @@
1927
# endif
2028
#endif
2129

30+
#define Vector_Size 0x158
2231
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
2332

33+
#define MBED_IRAM1_START (MBED_RAM_START + Vector_Size)
34+
#define MBED_IRAM1_SIZE (MBED_RAM_SIZE - Vector_Size - Stack_Size)
35+
#define RAM_FIXED_SIZE (Vector_Size + Stack_Size)
36+
2437
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
2538
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
2639
*.o (RESET, +First)
2740
*(InRoot$$Sections)
2841
.ANY (+RO)
2942
}
30-
RW_IRAM1 0x20000158 0x0007FEA8-Stack_Size { ; RW data
43+
RW_IRAM1 MBED_IRAM1_START MBED_IRAM1_SIZE { ; RW data
3144
.ANY (+RW +ZI)
3245
}
33-
34-
ARM_LIB_STACK (0x20000158+0x0007FEA8) EMPTY -Stack_Size { ; stack
46+
47+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_IRAM1_START)) { ; heap growing up
48+
}
49+
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack
3550
}
3651
}
3752

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFR32MG12/device/TOOLCHAIN_ARM_STD/efr32mg12p.sct

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

14+
#if !defined(MBED_RAM_)
15+
#define MBED_RAM_START 0x20000000
16+
#endif
17+
18+
#if !defined(MBED_RAM_)
19+
#define MBED_RAM_SIZE 0x40000
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,18 +27,25 @@
1927
# endif
2028
#endif
2129

30+
#define Vector_Size 0x110
2231
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
2332

33+
#define MBED_IRAM1_START (MBED_RAM_START + Vector_Size)
34+
#define MBED_IRAM1_SIZE (MBED_RAM_SIZE - Vector_Size - Stack_Size)
35+
#define RAM_FIXED_SIZE (Vector_Size + Stack_Size)
36+
2437
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
2538
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
2639
*.o (RESET, +First)
2740
*(InRoot$$Sections)
2841
.ANY (+RO)
2942
}
30-
RW_IRAM1 0x20000110 0x0003FEF0-Stack_Size { ; RW data
43+
RW_IRAM1 MBED_IRAM1_START MBED_IRAM1_SIZE { ; RW data
3144
.ANY (+RW +ZI)
3245
}
33-
ARM_LIB_STACK (0x20000110+0x0003FEF0) EMPTY -Stack_Size { ; stack
46+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_IRAM1_START)) { ; heap growing up
47+
}
48+
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack
3449
}
3550
}
3651

targets/targets.json

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5265,16 +5265,27 @@
52655265
],
52665266
"supported_toolchains": [
52675267
"GCC_ARM",
5268-
"ARM",
5269-
"uARM",
5270-
"IAR"
5268+
"ARM"
52715269
],
52725270
"release_versions": [
52735271
"5"
52745272
],
52755273
"device_name": "EFM32GG990F1024",
52765274
"public": false,
5277-
"bootloader_supported": true
5275+
"bootloader_supported": true,
5276+
"supported_c_libs": {
5277+
"arm": [
5278+
"std",
5279+
"small"
5280+
],
5281+
"gcc_arm": [
5282+
"std",
5283+
"small"
5284+
]
5285+
},
5286+
"supported_application_profiles": [
5287+
"full", "bare-metal"
5288+
]
52785289
},
52795290
"EFM32GG_STK3700": {
52805291
"inherits": [
@@ -5370,16 +5381,27 @@
53705381
],
53715382
"supported_toolchains": [
53725383
"GCC_ARM",
5373-
"ARM",
5374-
"uARM",
5375-
"IAR"
5384+
"ARM"
53765385
],
53775386
"release_versions": [
53785387
"5"
53795388
],
53805389
"device_name": "EFR32MG12P332F1024GL125",
53815390
"public": false,
5382-
"bootloader_supported": true
5391+
"bootloader_supported": true,
5392+
"supported_c_libs": {
5393+
"arm": [
5394+
"std",
5395+
"small"
5396+
],
5397+
"gcc_arm": [
5398+
"std",
5399+
"small"
5400+
]
5401+
},
5402+
"supported_application_profiles": [
5403+
"full", "bare-metal"
5404+
]
53835405
},
53845406
"TB_SENSE_12": {
53855407
"inherits": [
@@ -5470,16 +5492,27 @@
54705492
],
54715493
"supported_toolchains": [
54725494
"GCC_ARM",
5473-
"ARM",
5474-
"uARM",
5475-
"IAR"
5495+
"ARM"
54765496
],
54775497
"release_versions": [
54785498
"5"
54795499
],
54805500
"device_name": "EFM32GG11B820F2048GL192",
54815501
"public": false,
5482-
"bootloader_supported": true
5502+
"bootloader_supported": true,
5503+
"supported_c_libs": {
5504+
"arm": [
5505+
"std",
5506+
"small"
5507+
],
5508+
"gcc_arm": [
5509+
"std",
5510+
"small"
5511+
]
5512+
},
5513+
"supported_application_profiles": [
5514+
"full", "bare-metal"
5515+
]
54835516
},
54845517
"EFM32GG11_STK3701": {
54855518
"inherits": [

0 commit comments

Comments
 (0)