Skip to content

Commit a976651

Browse files
authored
Merge pull request #14345 from harmut01/baremetal_toshiba
Add bare metal support to Toshiba targets
2 parents 1e38343 + 191bd02 commit a976651

File tree

3 files changed

+60
-13
lines changed

3 files changed

+60
-13
lines changed

targets/TARGET_TOSHIBA/TARGET_TMPM46B/device/TOOLCHAIN_ARM_STD/tmpm46bf10fg.sct

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222
#define MBED_APP_SIZE 0x100000
2323
#endif
2424

25+
#if !defined(MBED_RAM_START)
26+
#define MBED_RAM_START 0x20000000
27+
#endif
28+
29+
#if !defined(MBED_RAM_SIZE)
30+
#define MBED_RAM_SIZE 0x80000
31+
#endif
32+
2533
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
2634
# if defined(MBED_BOOT_STACK_SIZE)
2735
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
@@ -31,6 +39,11 @@
3139
#endif
3240

3341
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
42+
#define VECTOR_SIZE 0x1E0
43+
44+
#define RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE + VECTOR_SIZE)
45+
#define MBED_IRAM1_START (MBED_RAM_START + VECTOR_SIZE)
46+
#define MBED_IRAM1_SIZE (MBED_RAM_SIZE - VECTOR_SIZE - Stack_Size)
3447

3548
; TMPM46B: 1024 KB FLASH (0x100000) + 512 KB SRAM (0x80000)
3649

@@ -43,12 +56,13 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE ; load region size_region
4356
.ANY (+RO)
4457
}
4558

46-
RW_IRAM1 0x200001E0 (0x80000 - 0x1E0 - Stack_Size)
59+
RW_IRAM1 MBED_IRAM1_START MBED_IRAM1_SIZE
4760
{
4861
tmpm46b_fc.o(+RO)
4962
.ANY (+RW, +ZI)
5063
}
51-
52-
ARM_LIB_STACK (0x20000000+0x80000) EMPTY -Stack_Size { ; stack
64+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_IRAM1_START)) { ; heap
65+
}
66+
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack
5367
}
5468
}

targets/TARGET_TOSHIBA/TARGET_TMPM4G9/device/TOOLCHAIN_ARM_STD/tmpm4g9f15.sct

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838
#define MBED_APP_SIZE 0x000180000
3939
#endif
4040

41+
#if !defined(MBED_RAM_START)
42+
#define MBED_RAM_START 0x20000000
43+
#endif
44+
45+
#if !defined(MBED_RAM_SIZE)
46+
#define MBED_RAM_SIZE 0x30000
47+
#endif
48+
4149
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
4250
# if defined(MBED_BOOT_STACK_SIZE)
4351
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
@@ -47,6 +55,11 @@
4755
#endif
4856

4957
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
58+
#define VECTOR_SIZE 0x320
59+
60+
#define RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE + VECTOR_SIZE)
61+
#define MBED_IRAM1_START (MBED_RAM_START + VECTOR_SIZE)
62+
#define MBED_IRAM1_SIZE (MBED_RAM_SIZE - VECTOR_SIZE - Stack_Size)
5063

5164
; TMPM4G9: 1536 KB FLASH (0x180000) + 192 KB SRAM (0x30000)
5265

@@ -58,13 +71,13 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE ; load region size_region
5871
*(InRoot$$Sections)
5972
.ANY (+RO)
6073
}
61-
62-
RW_IRAM1 0x20000320 (0x30000 - 0x320 - Stack_Size)
74+
RW_IRAM1 MBED_IRAM1_START MBED_IRAM1_SIZE
6375
{
6476
tmpm4g9_fc.o (+RO)
6577
.ANY (+RW, +ZI)
6678
}
67-
68-
ARM_LIB_STACK (0x20000000+0x30000) EMPTY -Stack_Size { ; stack
79+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_IRAM1_START)) { ; heap
80+
}
81+
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack
6982
}
7083
}

targets/targets.json

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6445,8 +6445,7 @@
64456445
],
64466446
"supported_toolchains": [
64476447
"GCC_ARM",
6448-
"ARM",
6449-
"IAR"
6448+
"ARM"
64506449
],
64516450
"device_has": [
64526451
"USTICKER",
@@ -6478,7 +6477,18 @@
64786477
"release_versions": [
64796478
"5"
64806479
],
6481-
"bootloader_supported": true
6480+
"bootloader_supported": true,
6481+
"supported_application_profiles" : ["full", "bare-metal"],
6482+
"supported_c_libs": {
6483+
"arm": [
6484+
"std",
6485+
"small"
6486+
],
6487+
"gcc_arm": [
6488+
"std",
6489+
"small"
6490+
]
6491+
}
64826492
},
64836493
"ARM_FM": {
64846494
"inherits": [
@@ -6733,8 +6743,7 @@
67336743
],
67346744
"supported_toolchains": [
67356745
"GCC_ARM",
6736-
"ARM",
6737-
"IAR"
6746+
"ARM"
67386747
],
67396748
"device_has": [
67406749
"ANALOGIN",
@@ -6767,7 +6776,18 @@
67676776
"release_versions": [
67686777
"5"
67696778
],
6770-
"bootloader_supported": true
6779+
"bootloader_supported": true,
6780+
"supported_application_profiles" : ["full", "bare-metal"],
6781+
"supported_c_libs": {
6782+
"arm": [
6783+
"std",
6784+
"small"
6785+
],
6786+
"gcc_arm": [
6787+
"std",
6788+
"small"
6789+
]
6790+
}
67716791
},
67726792
"MCU_PSOC6": {
67736793
"inherits": [

0 commit comments

Comments
 (0)