Skip to content

Commit 53f87aa

Browse files
authored
Merge pull request #14363 from harmut01/baremetal_si
Add bare metal support to Silicon Labs targets
2 parents 71de6e2 + ee5946c commit 53f87aa

File tree

6 files changed

+97
-319
lines changed

6 files changed

+97
-319
lines changed

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

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

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/TARGET_1024K/TOOLCHAIN_ARM_MICRO/startup_efm32gg.S

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

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

0 commit comments

Comments
 (0)