You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/configuration/mbed_targets.md
+21-21Lines changed: 21 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ The style that we use for targets is:
36
36
37
37
This section lists all the properties the Mbed build system understands. Unless specified otherwise, all properties are optional.
38
38
39
-
#### `inherits`
39
+
#### inherits
40
40
41
41
The description of an Mbed target can "inherit" from one or more descriptions of other targets. When a target, called a _child_ inherits from another target, called its _parent_, the child automatically copies all the properties from the parent. After the child has copied the properties of the parent, it may then overwrite, add or remove from those properties. In our example above, `TEENSY3_1` inherits from `Target`. This is the definition of `Target`:
42
42
@@ -82,23 +82,23 @@ Avoid using multiple inheritance for your targets. If you use multiple inheritan
82
82
83
83
For more details about the Python method resolution order, please see [this Python tutorial](http://makina-corpus.com/blog/metier/2014/python-tutorial-understanding-python-mro-class-search-path).
<spanclass="notes">**Note:** Mbed OS supports v8-M architecture devices (Cortex-M23 and Cortex-M33) on the ARMC6 toolchain (version 6.10).</span>
92
92
93
-
#### `public`
93
+
#### public
94
94
95
95
The `public` property controls which targets the Mbed build system allows users to build. You may define targets as parents for other targets. When you define such a target, its description must set the `public` property to `false`. `Target`, shown above, sets `public` to `false` for this reason.
96
96
97
97
If `public` is not defined for a target, it defaults to `true`.
98
98
99
99
<spanclass="notes">**Note:** Unlike other target properties, **the value of `public` is not inherited from a parent to its children**.</span>
100
100
101
-
### `macros`, `macros_add` and `macros_remove`
101
+
### macros, macros_add and macros_remove
102
102
103
103
The `macros` property defines a list of macros that are available when compiling code. You may define these macros with or without a value. For example, the declaration `"macros": ["NO_VALUE", "VALUE=10"]` will add `-DNO_VALUE -DVALUE=10` to the compiler's command-line.
104
104
@@ -119,13 +119,13 @@ For example:
119
119
120
120
In this configuration, the value of `TargetB.macros` is `["PARENT_MACRO1", "CHILD_MACRO1"]`.
121
121
122
-
#### `extra_labels`, `extra_labels_add` and `extra_labels_remove`
122
+
#### extra_labels, extra_labels_add and extra_labels_remove
123
123
124
124
The list of _labels_ defines how the build system looks for sources, include directories and so on. `extra_labels` makes the build system aware of additional directories that it must scan for such files.
125
125
126
126
When you use target inheritance, you may alter the values of `extra_labels` using `extra_labels_add` and `extra_labels_remove`. This is similar to the `macros_add` and `macros_remove` mechanism described in the previous section.
127
127
128
-
#### `features`, `features_add` and `features_remove`
128
+
#### features, features_add and features_remove
129
129
130
130
The list of _features_ enables software features on a platform. Like `extra_labels`, `features` makes the build system aware of additional directories it must scan for resources. Unlike `extra_labels`, the build system recognizes a fixed set of values in the `features` list. The build system recognizes the following features:
131
131
-`BLE`.
@@ -135,7 +135,7 @@ The build system errors when you use features outside of this list.
135
135
136
136
When you use target inheritance, you may alter the values of `features` using `features_add` and `features_remove`. This is similar to the `macros_add` and `macros_remove` mechanism the previous section describes.
137
137
138
-
#### `config` and `overrides`
138
+
#### config and overrides
139
139
140
140
<spanclass="notes">**Note:** The [Arm Mbed configuration system](../tools/compile.html) customizes the compile time configuration of various Mbed components (targets, libraries and applications). Each component can define a number of configuration parameters. The values of these configuration parameters can then be overridden in various ways.</span>
141
141
@@ -180,25 +180,25 @@ You can also modify config values for a project using the `target_overrides` key
180
180
181
181
This section, in an `mbed_app.json` file, sets the clock source to `RC` on all targets and the clock frequency to 16Mhz on just the `NRF51_DK` target.
182
182
183
-
#### `device_has`
183
+
#### device_has
184
184
185
185
The list in `device_has` defines what hardware a device has.
186
186
187
187
Mbed, libraries and application source code can then select different implementations of drivers based on hardware availability; selectively compile drivers for existing hardware only; or run only the tests that apply to a particular platform. The values in `device_has` are available in C, C++ and assembly language as `DEVICE_` prefixed macros.
188
188
189
-
#### `is_disk_virtual`
189
+
#### is_disk_virtual
190
190
191
191
Enabling `is_disk_virtual` adds delay after flashing firmware binary to make sure the mount was correct. This field is not used anymore. The Mbed test tools use `Mbed LS` to make sure the mount was correct before flashing it again.
192
192
193
-
#### `supported_toolchains`
193
+
#### supported_toolchains
194
194
195
195
The `supported_toolchains` property is the list of toolchains that support a target. The allowed values for `supported_toolchains` are `ARM`, `uARM`, `ARMC6`, `GCC_ARM` and `IAR`.
196
196
197
-
#### `default_toolchain`
197
+
#### default_toolchain
198
198
199
199
The `default_toolchain` property names the toolchain that compiles code for this target in the Online Compiler. Possible values for `default_toolchain` are `ARM` or `uARM`.
200
200
201
-
#### `post_binary_hook`
201
+
#### post_binary_hook
202
202
203
203
Some targets require specific actions to generate a programmable binary image. Specify these actions using the `post_binary_hook` property and custom Python code. The value of `post_binary_hook` must be a JSON object with keys `function` and optionally `toolchain`. Within the `post_binary_hook` JSON object, the `function` key must contain a Python function that is accessible from the namespace of `tools/targets/__init__.py`, and the optional `toolchain` key must contain a list of toolchains that require processing from the `post_binary_hook`. When you do not specify the `toolchains` key for a `post_binary_hook`, you can assume the `post_binary_hook` applies to all toolchains. For the `TEENSY3_1` target above, the definition of `post_binary_hook` looks like this:
204
204
@@ -229,7 +229,7 @@ class TEENSY3_1Code:
229
229
230
230
The `post_build_hook` for the `TEENSY3_1` converts the output file (`binf`) from binary format to Intel HEX format. See the other hooks in `tools/targets/__init__.py` for more examples of hook code.
231
231
232
-
#### `device_name`
232
+
#### device_name
233
233
234
234
Use this property to pass necessary data for exporting to various third party tools and IDEs and for building applications with bootloaders.
235
235
@@ -257,27 +257,27 @@ The [`"device_name"`](../porting/index.html) attribute it `targets.json` maps fr
257
257
258
258
The `device_name` key in `targets.json` is `MK20DX256xxx7` for any target that uses this particular MCU.
259
259
260
-
#### `detect_code`
260
+
#### detect_code
261
261
262
262
The `detect_code` contains four ASCII characters containing only hexadecimal values (A-F and 0-9). This code is the same for all platforms of the same type. `Mbed LS` no longer uses this field to identify the platform. Instead, `Mbed LS` has its [own database](https://github.com/ARMmbed/mbed-os-tools/blob/master/src/mbed_os_tools/detect/platform_database.py) of detect codes.
263
263
264
-
#### `OUTPUT_EXT`
264
+
#### OUTPUT_EXT
265
265
266
266
The `OUTPUT_EXT` property controls the file type emitted for a target by the build system. You may set `OUTPUT_EXT` to `bin` for binary format, `hex` for Intel HEX format and `elf` for ELF format. We discourage using the `elf` value for `OUTPUT_EXT` because the build system must always emit an ELF file.
267
267
268
-
#### `default_lib`
268
+
#### default_lib
269
269
270
270
The `delault_lib` property controls which library, small or standard, the `GCC_ARM` toolchain links. The `default_lib` property may take on the values `std` for the standard library and `small` for the reduced size library.
271
271
272
-
#### `bootloader_supported`
272
+
#### bootloader_supported
273
273
274
274
The `bootloader_supported` property controls whether the build system allows a bootloader or a bootloader-using application to be built for a target. The default value of `bootloader_supported` is `false`.
275
275
276
-
#### `release_versions`
276
+
#### release_versions
277
277
278
278
The `release_versions` property is a list of major versions of Mbed OS that the target supports. The list within `release_versions` may only contain `2`, indicating that the support of Mbed OS 2, and `5`, indicating the support of Mbed OS 5. We build all targets that are released for Mbed OS 2 as a static library. Targets are released for Mbed OS 2 by putting a `2` in the `release_version` list.
279
279
280
-
#### `supported_form_factors`
280
+
#### supported_form_factors
281
281
282
282
The `supported_form_factors` property is an optional list of form factors that a development board supports. You can use this property in C, C++ and assembly language by passing a macro prefixed with `TARGET_FF_` to the compiler. The accepted values for `supported_form_factors` are `ARDUINO`, which indicates compatibility with Arduino headers, and `MORPHO`, which indicates compatibility with ST Morpho headers.
283
283
@@ -367,7 +367,7 @@ For each of these target roles, some restrictions are in place:
367
367
368
368
The linting script takes three subcommands: `targets`, `all-targets` and `orphans`.
369
369
370
-
##### `targets` and `all-targets` commands
370
+
##### targets and all-targets commands
371
371
372
372
The `targets` and `all-targets` commands both show errors within public inheritance hierarchies. For example:
373
373
@@ -412,7 +412,7 @@ target errors:
412
412
413
413
The `all-targets` command is very verbose, with output that matches the format above but is too long to reproduce here.
414
414
415
-
##### `orphans` command
415
+
##### orphans command
416
416
417
417
The `orphans` command shows all targets that you cannot reach from a public target.
0 commit comments