blob: 8ea7c35c7049d2b6e90046343e68c1bd4b00ffa5 [file] [log] [blame] [view]
Andrei Litvina76f75e2022-04-13 08:34:42 -10001![ARM Mbed-OS logo](https://raw.githubusercontent.com/ARMmbed/mbed-os/master/logo.png)
Artur Tynecki06f9a382021-10-29 16:10:56 +02002
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +01003# Mbed-OS add new hardware target
Artur Tynecki06f9a382021-10-29 16:10:56 +02004
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +01005## Overview
Artur Tynecki06f9a382021-10-29 16:10:56 +02006
7This document shows how to add the new Mbed OS hardware target to Matter
8project.
9
10Please check the list of supported
11[development boards](https://os.mbed.com/platforms/) which are compatible with
12Mbed OS.
13
14In order to adapt the new hardware target to the Matter project, you need to
15remember about the following requirements:
16
17- Bluetooth Low Energy support.
18- Wireless communication module with WiFi or Thread network support (IPv6
19 protocol is required).
20- Serial port support
21- On-chip debug with OpenOCD support
22
23Additional target component requirements are different for each of example
24application. Check the **Device UI** paragraph in example description.
25
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +010026## Example Application
Artur Tynecki06f9a382021-10-29 16:10:56 +020027
28The first step to add the new target to each of example application is to modify
29the `examples/example_name/mbed/mbed_app.json` file. It contains the common
30project settings and override the default values for supported boards. You
31should add the necessary components and parameters for the target there.
32
33If the new target uses the external libraries, it will be required to link it in
34the CMakeLists.txt file.
35
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +010036## Building
Artur Tynecki06f9a382021-10-29 16:10:56 +020037
38To add the new hardware target to the build system the
39`scripts/examples/mbed_example.sh` script should be modify. Extend
40**SUPPORTED_TARGET_BOARD** variable with a new target name.
41
42Example:
43
44 SUPPORTED_TARGET_BOARD=(CY8CPROTO_062_4343W NEW_TARGET_NAME)
45
46The next step is add the target name to build task in `.vscode/task.json` file.
47Extend the **options** variable in **mbedTarget** input setting.
48
49Example:
50
51 {
52 "type": "pickString",
53 "id": "mbedTarget",
54 "description": "What mbed target do you want to use?",
55 "options": ["CY8CPROTO_062_4343W", "NEW_TARGET_NAME"],
56 "default": "CY8CPROTO_062_4343W"
57 }
58
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +010059## Flashing
Artur Tynecki06f9a382021-10-29 16:10:56 +020060
61Mbed OS example application flashing process uses the
62[Open On-Chip Debugger](http://openocd.org/). The first step is to create the
63target configuration file inside `config/mbed/scripts` directory. The file name
64should be the same as target and the extension should be **.tcl**. The target
65CPU and programming interface definitions are essential parts of the
66configuration file.
67
68The next steps are the same as for building process. Adding the name of the
69target to `scripts/examples/mbed_example.sh` and `.vscode/task.json` files
70allows the use of available flashing processes.
71
72Additional flashing option is based on VSCode launch task. Adding the new target
73to it required `.vscode/launch.json` modification. Extend the **options**
74variable in **mbedTarget** input setting.
75
76Example:
77
78 {
79 "type": "pickString",
80 "id": "mbedTarget",
81 "description": "What mbed target do you want to use?",
82 "options": ["CY8CPROTO_062_4343W", "NEW_TARGET_NAME"],
83 "default": "CY8CPROTO_062_4343W"
84 }
85
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +010086## Debugging
Artur Tynecki06f9a382021-10-29 16:10:56 +020087
88Debugging process of Mbed OS applications is also based on VSCode launch task.
89Adding the new target to it required `.vscode/launch.json` modification. Extend
90the **options** variable in **mbedTarget** input setting.
91
92Example:
93
94 {
95 "type": "pickString",
96 "id": "mbedTarget",
97 "description": "What mbed target do you want to use?",
98 "options": ["CY8CPROTO_062_4343W", "NEW_TARGET_NAME"],
99 "default": "CY8CPROTO_062_4343W"
100 }
101
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +0100102## CI
Artur Tynecki06f9a382021-10-29 16:10:56 +0200103
104The Matter project continue integration process is based on Github Actions tool.
105It uses workflow configuration files to execute actions on CI server.
106
107To add the new target to the validation process of building Mbed OS applications
108you need to modify the `.github/workflows/examples-mbed.yaml` file. Extend the
109job's environment variable **APP_TARGET** with the target name.
110
111Example:
112
113 APP_TARGET: [CY8CPROTO_062_4343W, NEW_TARGET_NAME]