Skip to content

Commit da4c528

Browse files
Add bare metal support to ARM FM targets
Modify scatter files to specify heap load region and add small libraries to list of supported libraries in target.json.
1 parent 2660621 commit da4c528

File tree

6 files changed

+101
-55
lines changed
  • targets
    • TARGET_ARM_FM/TARGET_FVP_MPS2
      • TARGET_FVP_MPS2_M0P/device/TOOLCHAIN_ARM_STD
      • TARGET_FVP_MPS2_M0/device/TOOLCHAIN_ARM_STD
      • TARGET_FVP_MPS2_M3/device/TOOLCHAIN_ARM_STD
      • TARGET_FVP_MPS2_M4/device/TOOLCHAIN_ARM_STD
      • TARGET_FVP_MPS2_M7/device/TOOLCHAIN_ARM_STD

6 files changed

+101
-55
lines changed

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,24 @@
5252
#define STACK_SIZE MBED_CONF_TARGET_BOOT_STACK_SIZE
5353
#endif
5454

55+
#define ZBT_SRAM2_RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE + NVIC_VECTORS_SIZE)
56+
5557
; The vector table is loaded at address 0x00000000 in Flash memory region.
5658
LR_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load region size_region
57-
ER_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load address = execution address
58-
*.o (RESET, +First)
59-
*(InRoot$$Sections)
60-
*(+RO)
61-
}
62-
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
63-
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
64-
*(+RW +ZI)
65-
}
66-
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down
67-
}
59+
ER_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load address = execution address
60+
*.o (RESET, +First)
61+
*(InRoot$$Sections)
62+
*(+RO)
63+
}
64+
65+
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
66+
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
67+
*(+RW +ZI)
68+
}
69+
70+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (ZBT_SRAM2_SIZE - ZBT_SRAM2_RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - ZBT_SRAM2_START)) { ; Heap growing upward
71+
}
72+
73+
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down
74+
}
6875
}

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0P/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,24 @@
5252
#define STACK_SIZE MBED_CONF_TARGET_BOOT_STACK_SIZE
5353
#endif
5454

55+
#define ZBT_SRAM2_RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE + NVIC_VECTORS_SIZE)
56+
5557
; The vector table is loaded at address 0x00000000 in Flash memory region.
5658
LR_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load region size_region
57-
ER_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load address = execution address
58-
*.o (RESET, +First)
59-
*(InRoot$$Sections)
60-
*(+RO)
61-
}
62-
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
63-
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
64-
*(+RW +ZI)
65-
}
66-
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down
67-
}
59+
ER_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load address = execution address
60+
*.o (RESET, +First)
61+
*(InRoot$$Sections)
62+
*(+RO)
63+
}
64+
65+
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
66+
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
67+
*(+RW +ZI)
68+
}
69+
70+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (ZBT_SRAM2_SIZE - ZBT_SRAM2_RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - ZBT_SRAM2_START)) { ; Heap growing upward
71+
}
72+
73+
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down
74+
}
6875
}

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M3/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,24 @@
5252
#define STACK_SIZE MBED_CONF_TARGET_BOOT_STACK_SIZE
5353
#endif
5454

55+
#define ZBT_SRAM2_RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE + NVIC_VECTORS_SIZE)
56+
5557
; The vector table is loaded at address 0x00000000 in Flash memory region.
5658
LR_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load region size_region
57-
ER_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load address = execution address
58-
*.o (RESET, +First)
59-
*(InRoot$$Sections)
60-
*(+RO)
61-
}
62-
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
63-
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
64-
*(+RW +ZI)
65-
}
66-
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down
67-
}
59+
ER_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load address = execution address
60+
*.o (RESET, +First)
61+
*(InRoot$$Sections)
62+
*(+RO)
63+
}
64+
65+
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
66+
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
67+
*(+RW +ZI)
68+
}
69+
70+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (ZBT_SRAM2_SIZE - ZBT_SRAM2_RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - ZBT_SRAM2_START)) { ; Heap growing upward
71+
}
72+
73+
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down
74+
}
6875
}

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M4/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,24 @@
5252
#define STACK_SIZE MBED_CONF_TARGET_BOOT_STACK_SIZE
5353
#endif
5454

55+
#define ZBT_SRAM2_RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE + NVIC_VECTORS_SIZE)
56+
5557
; The vector table is loaded at address 0x00000000 in Flash memory region.
5658
LR_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load region size_region
57-
ER_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load address = execution address
58-
*.o (RESET, +First)
59-
*(InRoot$$Sections)
60-
*(+RO)
61-
}
62-
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
63-
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
64-
*(+RW +ZI)
65-
}
66-
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down
67-
}
59+
ER_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load address = execution address
60+
*.o (RESET, +First)
61+
*(InRoot$$Sections)
62+
*(+RO)
63+
}
64+
65+
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
66+
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
67+
*(+RW +ZI)
68+
}
69+
70+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (ZBT_SRAM2_SIZE - ZBT_SRAM2_RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - ZBT_SRAM2_START)) { ; Heap growing upward
71+
}
72+
73+
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down
74+
}
6875
}

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M7/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,24 @@
5252
#define STACK_SIZE MBED_CONF_TARGET_BOOT_STACK_SIZE
5353
#endif
5454

55+
#define ZBT_SRAM2_RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE + NVIC_VECTORS_SIZE)
56+
5557
; The vector table is loaded at address 0x00000000 in Flash memory region.
5658
LR_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load region size_region
57-
ER_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load address = execution address
58-
*.o (RESET, +First)
59-
*(InRoot$$Sections)
60-
*(+RO)
61-
}
62-
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
63-
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
64-
*(+RW +ZI)
65-
}
66-
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down
67-
}
59+
ER_IROM1 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load address = execution address
60+
*.o (RESET, +First)
61+
*(InRoot$$Sections)
62+
*(+RO)
63+
}
64+
65+
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
66+
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
67+
*(+RW +ZI)
68+
}
69+
70+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (ZBT_SRAM2_SIZE - ZBT_SRAM2_RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - ZBT_SRAM2_START)) { ; Heap growing upward
71+
}
72+
73+
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down
74+
}
6875
}

targets/targets.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6415,6 +6415,17 @@
64156415
],
64166416
"overrides": {
64176417
"network-default-interface-type": "ETHERNET"
6418+
},
6419+
"supported_application_profiles" : ["full", "bare-metal"],
6420+
"supported_c_libs": {
6421+
"arm": [
6422+
"std",
6423+
"small"
6424+
],
6425+
"gcc_arm": [
6426+
"std",
6427+
"small"
6428+
]
64186429
}
64196430
},
64206431
"FVP_MPS2_M0": {

0 commit comments

Comments
 (0)