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/compile/build_profiles.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
-
# Build Profiles
1
+
##Build Profiles
2
2
mbed OS 5 supports three primary build profiles: *develop*, *debug* and *release*. The Online Compiler uses the *develop* profile. When building from mbed CLI, you can select a profile by adding the ```--profile <profile>``` flag. You can specify custom user-defined profiles by giving the path to the profile.
3
3
4
-
## Develop profile
4
+
###Develop profile
5
5
* Small and fast code.
6
6
* Full error information. For example, asserts have file name and line number.
7
7
* Hard to follow code flow when using a debugger.
8
8
9
-
## Debug profile
9
+
###Debug profile
10
10
* Largest and slowest profile.
11
11
* Full error information. For example, asserts have file name and line number.
Copy file name to clipboardExpand all lines: docs/compile/config_system.md
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# The mbed configuration system
1
+
##The mbed configuration system
2
2
3
3
The mbed configuration system 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. Configuration is defined using [JSON](http://www.json.org/). Some examples of configuration parameters:
4
4
@@ -9,7 +9,7 @@ The mbed configuration system customizes the compile time configuration of vario
9
9
10
10
The configuration system gathers and interprets all the configurations defined in the source tree. The output of the configuration system is a list of macros that are automatically defined when compiling the code.
11
11
12
-
# Defining configuration parameters
12
+
###Defining configuration parameters
13
13
14
14
The configuration system understands configuration data defined in targets, libraries and applications. Although there are some slight differences in the way the configuration system works in these cases, the configuration parameters are always defined in a JSON object called "config".
15
15
@@ -49,7 +49,7 @@ The configuration system automatically appends an *implicit prefix* to the name
49
49
-**app.** if the parameter is defined in the application.
50
50
- The name of the library followed by a dot (.) if the parameter is defined in a library.
51
51
52
-
# Configuration data in libraries
52
+
###Configuration data in libraries
53
53
54
54
Each mbed library can have an optional `mbed_lib.json` file located in the root folder of the library that defines its configuration. For a library called `mylib`, the configuration file can look like this:
55
55
@@ -103,7 +103,7 @@ As explained [here](#defining-configuration-parameters), the parameters have an
103
103
104
104
If the source tree has code for more than one library, each library needs its own `mbed_lib.json` file in its root folder.
105
105
106
-
# Configuration data in targets
106
+
###Configuration data in targets
107
107
108
108
Like libraries, targets can define their own configuration data. Additionally, targets can override the configuration of the target(s) they inherit from (for more details about how do define a target and target inheritance, check [this link](mbed_targets.md)). Target configuration data is defined in `targets.json` using `config`, as described [here](#defining-configuration-parameters). An example for a hypothetical `Base` target is given below:
109
109
@@ -152,7 +152,7 @@ Targets can inherit from other targets, and their configuration data is also inh
152
152
153
153
It is an error for a derived target to redefine a configuration parameter already defined by its parent(s) in its `config` section. It is also an error for a derived target to override a configuration parameter that was not defined by its parent(s) in its `overrides` section.
154
154
155
-
# Configuration data in applications
155
+
###Configuration data in applications
156
156
157
157
Like target and library configuration, application configuration is optional; if it exists, it must be defined in an `mbed_app.json` file. Unlike library configuration, there can be a single `mbed_app.json` file in the source tree.
158
158
@@ -203,7 +203,7 @@ Other than this, `target_overrides` works exactly like it does for libraries. Ke
203
203
204
204
It is an error for the application configuration to override configuration parameters that were not defined.
205
205
206
-
## Overriding target attributes
206
+
####Overriding target attributes
207
207
208
208
Target configurations contain a set of attributes that you may manipulate with an application configuration. You may override these attributes as if they were a normal configuration parameter. If these attributes are cumulative, you may also manipulate them with the special `attribute_add` and `attribute_remove` meta-attributes.
209
209
@@ -226,7 +226,7 @@ For example, this `mbed_app.json` disables the IPV4 feature; using this network
226
226
}
227
227
```
228
228
229
-
# Configuration data precedence
229
+
###Configuration data precedence
230
230
231
231
The order in which the various bits of configurations are considered is:
232
232
@@ -244,10 +244,10 @@ For `myapp` above:
244
244
- The value of `mylib.timer_period` is 100 because that's overridden by the application and takes precedence over the values defined in `mylib`.
245
245
- The values of `mylib.buffer_size` and `mylib.queue_size` are:
246
246
- 1024 and 10, respectively, when compiling for `Base`, as defined in the `config` section of `mylib`.
247
-
- 128 and 20, respectively, because `Derived` defines the `NXP` label and `mylib` defines a specific configuration for this label.
247
+
- 128 and 20, respectively, because `Derived` defines the `NXP` label and `mylib` defines a specific configuration for this label.
248
248
- Because `Derived` has its own `my_own_config` configuration parameter, `target.my_own_config` will also be defined in this case.
249
249
250
-
# Using configuration data in the code
250
+
###Using configuration data in the code
251
251
252
252
When compiling, the configuration system will automatically generate macro definitions for the configuration parameters and all the macros defined in libraries and the application in their `macros` keys. These definitions will be written in a file named `mbed_config.h`, located in the build directory. When compiling `myapp` for target `Base`, the `mbed_config.h` file will look like this (note that the order of the definitions may be different):
Copy file name to clipboardExpand all lines: docs/compile/exporters.md
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# About the exporters
1
+
##About the exporters
2
2
3
3
Use the mbed exporters to export your code to various third party tools and IDEs. Each exporter implements a `generate` function that produces an IDE specific project file. Exporters benefit from mbed build tools. However, instead of using your source and [config data](config_system.md) to create an executable, we use that information to populate an IDE project file that will be configured to build, flash and debug your code. You can find exporter implementations [here](https://github.com/ARMmbed/mbed-os/tree/master/tools/export).
-vv, --very_verbose Very verbose diagnostic output
25
25
```
26
26
27
-
# Adding export support for a target
27
+
###Adding export support for a target
28
28
29
29
If you have added a new target to mbed OS 5, exporting will allow users to transition from mbed source code to the offline development environment of their choice. More people can use your device.
30
30
31
-
## Eclipse and Make
31
+
####Eclipse and Make
32
32
33
33
Eclipse project export uses a generated Makefile for building. If `mbed compile -t <toolchain> -m <target>` works, then mbed `export -i make_<toolchain> -m <target>` will also work. You can find more information about adding and configuring targets [here](mbed_targets.md).
34
34
35
-
## GNU ARM Eclipse managed projects
35
+
####GNU ARM Eclipse managed projects
36
36
37
37
The GNU ARM Eclipse exporter is available for all targets that use the GCC_ARM toolchain.
38
38
39
-
## Qt Creator and Make
39
+
####Qt Creator and Make
40
40
41
41
The Qt Creator project export is available for the GCC_ARM toolchain; it generates a [Qt Creator generic project](http://doc.qt.io/qtcreator/creator-project-generic.html) and a Makefile, in a similar fashion to the *Eclipse and Make* exporter.
42
42
43
43
You can open the generated `.creator` project in Qt Creator, enabling integration with the project pane, syntax highlighting and automatic code completion. You can use the Makefile to compile the project; the IDE should automatically invoke the Makefile when you issue the Build command.
44
44
45
-
## uVision and IAR
45
+
####uVision and IAR
46
46
47
-
### CMSIS Packs
47
+
#####CMSIS Packs
48
48
49
-
uVision and IAR both use [CMSIS packs](http://www.keil.com/pack/doc/CMSIS/Pack/html/index.html) to find target information necessary to create a valid project file.
49
+
uVision and IAR both use [CMSIS packs](http://www.keil.com/pack/doc/CMSIS/Pack/html/index.html) to find target information necessary to create a valid project file.
50
50
51
-
We use the tool [ArmPackManager](https://github.com/ARMmbed/mbed-os/tree/master/tools/arm_pack_manager) to scrape [MDK5 Software Packs](https://www.keil.com/dd2/Pack/) for target information by parsing [http://www.keil.com/pack/index.idx](http://sadevicepacksprod.blob.core.windows.net/idxfile/index.idx). [index.json](https://github.com/ARMmbed/mbed-os/blob/master/tools/arm_pack_manager/index.json) stores the relevant information in the [PDSC (Pack Description)](http://www.keil.com/pack/doc/CMSIS/Pack/html/_pack_format.html) retrieved from each URL in the index.
51
+
We use the tool [ArmPackManager](https://github.com/ARMmbed/mbed-os/tree/master/tools/arm_pack_manager) to scrape [MDK5 Software Packs](https://www.keil.com/dd2/Pack/) for target information by parsing [http://www.keil.com/pack/index.idx](http://sadevicepacksprod.blob.core.windows.net/idxfile/index.idx). [index.json](https://github.com/ARMmbed/mbed-os/blob/master/tools/arm_pack_manager/index.json) stores the relevant information in the [PDSC (Pack Description)](http://www.keil.com/pack/doc/CMSIS/Pack/html/_pack_format.html) retrieved from each URL in the index.
52
52
53
-
A `.pdsc` file typically describes a family of devices. Each device is uniquely identified by its [device name](mbed_targets.md#device_name). This name makes a natural key to associate a device with its information in `index.json`.
53
+
A `.pdsc` file typically describes a family of devices. Each device is uniquely identified by its [device name](mbed_targets.md#device_name). This name makes a natural key to associate a device with its information in `index.json`.
54
54
55
-
#### What's in a device name?
55
+
######What's in a device name?
56
56
There is no reliable way to map an mbed alias such as [NUCLEO_F030R8](https://github.com/ARMmbed/mbed-os/blob/master/targets/targets.json#L603) to its unique identifier, [STM32F030R8](https://github.com/ARMmbed/mbed-os/blob/master/targets/targets.json#L615), because it is listed in a CMSIS pack (and subsequently `index.json`). So, we added a [device name](mbed_targets.md#device_name) field in `targets.json`. **This field is required for IAR or uVision exporter support**.
57
57
58
-
#### Code usage
58
+
######Code usage
59
59
[http://www.keil.com/pack/Keil.Kinetis_K20_DFP.pdsc](http://www.keil.com/pack/Keil.Kinetis_K20_DFP.pdsc) is the PDSC that contains TEENSY_31 device (MK20DX256xxx7). ArmPackManager has parsed it, and `index.json` stores it. The device information begins on line 156:
60
60
```xml
61
61
<deviceDname="MK20DX256xxx7">
@@ -73,13 +73,13 @@ There is no reliable way to map an mbed alias such as [NUCLEO_F030R8](https://gi
73
73
</device>
74
74
```
75
75
76
-
##### uVision
76
+
####### uVision
77
77
The `dname` (device name) field on line 156 directly corresponds to that in the uVision5 IDE Target Selection window. [`tools/export/uvision/uvision.tmpl`](https://github.com/ARMmbed/mbed-os/blob/master/tools/export/uvision/uvision.tmpl#L15) uses target information from these packs to generate valid uVision5 projects. If the program cannot find the device name, we use a generic ARM CPU target in uVision5.
78
78
79
-
##### IAR
79
+
####### IAR
80
80
[`tools/export/iar/iar_definitions.json`](https://github.com/ARMmbed/mbed-os/blob/master/tools/export/iar/iar_definitions.json) uses this device name to store information necessary to set the target in an IAR project.
81
81
82
-
##### Updating index.json
82
+
####### Updating index.json
83
83
You can regenerate `index.json` to contain a newly made CMSIS pack with the following command:
0 commit comments