Skip to content

Commit 8edef02

Browse files
committed
Rewrite targets.json entries to use modern style
1 parent 541fde7 commit 8edef02

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

docs/tutorials/porting.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,38 @@ Mbed Cloud Client provides reference implementation for three Mbed Enabled targe
2929
Our sample target is identified by the following:
3030

3131
* The name of the target for builds is `MY_BOARD_1`.
32+
* The vendor is "MY_VENDOR", the device family is "MY_FAMILY" and the device on the board is "MY_DEVICE"
3233
* A Cortex-M4F based core.
33-
* Supports Mbed OS v5.x.
34-
* Has SERIAL interface as a bare minimum to print standard printf messages to the console, once built successfully.
35-
* Supports ARMCC and IAR compilers.
36-
* Inherits some features, such as the default toolchain and the virtual disk, from the standard `Target` defined in `targets.json`.
37-
* The public flag is set to `true` to indicate that this target is visible for compilation from the toolchains.
34+
* Porting for Mbed OS v5.x, which requires support for Arm Compiler 5, GCC Arm Embedded, and IAR EWARM.
35+
* Has a serial (UART) interface connected to the CMSIS-DAP implementation.
36+
* Requires the macro `CPU_DEVICE_1` to compile the vendor-provided HAL for the device mounted on the board.
37+
* Requires the macro `FAMILY_MY_FAMILY` to compile the vendor-provided HAL for the family of the device.
3838

3939
All of these requirements are directly mapped to relevant tags in the `targets.json` entry for our target. This is shown in step 3 below.
4040

4141

4242
### Add the target entry in `targets.json`
43-
```
44-
"MY_BOARD_1": {
45-
"inherits":["Target"],
46-
"core":"Cortex-M4F",
47-
"public": true,
48-
"extra_labels": ["MY_Vendor", "VendorMCUs", "VendorDevice1",
49-
"VendorBoard_1"],
50-
"macros": ["CPU_<Full_Name_of_CPU>"],
51-
"supported_toolchains": ["ARM", "IAR"],
52-
"device_has": ["SERIAL"],
53-
"release_versions": ["5"]
54-
},
43+
```json
44+
"MY_FAMILY": {
45+
"inherits": ["Target"],
46+
"macros_add": ["FAMILY_MY_FAMILY"],
47+
"extra_labels_add": ["MY_VENDOR"],
48+
"public": false
49+
},
50+
"MY_DEVICE_1": {
51+
"inherits": ["MY_FAMILY"],
52+
"macros_add": ["CPU_DEVICE_1"],
53+
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
54+
"device_has_add": ["SERIAL"],
55+
"core": "Cortex-M4F",
56+
"release_versions": [5]
57+
}
58+
"MY_BOARD_1": {
59+
"inherits":["MY_DEVICE_1"]
60+
},
5561
```
5662

57-
<span class="notes">**Note:** The `extra_labels` must mimic the exact directory structure used to define the new target.</span>
63+
<span class="notes">**Note:** The `extra_labels_add` of `MY_VENDOR` is a stand in for the vendor, as it would not configure anything by itself.</span>
5864

5965

6066
### Create the directory structure

0 commit comments

Comments
 (0)