Skip to content

Commit ca1514c

Browse files
author
Irit Arkin
committed
Adding section
Not sure about it being a standalone, but okay for now
1 parent 1593876 commit ca1514c

14 files changed

+120
-93
lines changed

docs.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
{
2929
"title": "Create applications",
3030
"description": "Develop your own application for mbed OS",
31-
"slug": "mbed-os-create_apps",
31+
"slug": "mbed-os-create",
3232
"type": "markdown",
3333
"sources": [
3434
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/creating_apps/mbed_interface.md"},
@@ -57,6 +57,27 @@
5757
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/creating_apps/release_profile.md"}
5858
]
5959
},
60+
{
61+
"title": "Compile applications",
62+
"description": "Targes, flags and exporters for application compilations",
63+
"slug": "mbed-os-compile",
64+
"type": "markdown",
65+
"sources": [
66+
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/compile/options.md"},
67+
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/compile/studio_compile.md"},
68+
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/compile/online_comp.md"},
69+
{"type": "markdown", "url": "https://github.com/iriark01/mbed-cli/blob/master/README.md"},
70+
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/compile/third_party.md"},
71+
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/compile/build_profiles.md"},
72+
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/compile/toolchain_profiles.md"},
73+
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/compile/mbedignore.md"},
74+
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/compile/mbed_targets.md"},
75+
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/compile/config_system.md"},
76+
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/compile/mutli_comp.md"},
77+
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/compile/exporters.md"},
78+
{"type": "markdown", "url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/compile/exporter_instruct.md"}
79+
]
80+
},
6081
{
6182
"title": "mbed OS API refrences",
6283
"description": "References to the mbed OS APIs",

docs/dev_tools/build_profiles.md renamed to docs/compile/build_profiles.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Build Profiles
1+
## Build Profiles
22
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.
33

4-
## Develop profile
4+
### Develop profile
55
* Small and fast code.
66
* Full error information. For example, asserts have file name and line number.
77
* Hard to follow code flow when using a debugger.
88

9-
## Debug profile
9+
### Debug profile
1010
* Largest and slowest profile.
1111
* Full error information. For example, asserts have file name and line number.
1212
* Easy to step through code with a debugger.
1313

14-
## Release profile
14+
### Release profile
1515
* Smallest profile and still fast.
1616
* Minimal error information.
1717
* Chip is put to sleep when going idle:

docs/advanced/config_system.md renamed to docs/compile/config_system.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# The mbed configuration system
1+
## The mbed configuration system
22

33
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:
44

@@ -9,7 +9,7 @@ The mbed configuration system customizes the compile time configuration of vario
99

1010
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.
1111

12-
# Defining configuration parameters
12+
### Defining configuration parameters
1313

1414
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".
1515

@@ -49,7 +49,7 @@ The configuration system automatically appends an *implicit prefix* to the name
4949
- **app.** if the parameter is defined in the application.
5050
- The name of the library followed by a dot (.) if the parameter is defined in a library.
5151

52-
# Configuration data in libraries
52+
### Configuration data in libraries
5353

5454
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:
5555

@@ -103,7 +103,7 @@ As explained [here](#defining-configuration-parameters), the parameters have an
103103

104104
If the source tree has code for more than one library, each library needs its own `mbed_lib.json` file in its root folder.
105105

106-
# Configuration data in targets
106+
### Configuration data in targets
107107

108108
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:
109109

@@ -152,7 +152,7 @@ Targets can inherit from other targets, and their configuration data is also inh
152152

153153
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.
154154

155-
# Configuration data in applications
155+
### Configuration data in applications
156156

157157
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.
158158

@@ -203,7 +203,7 @@ Other than this, `target_overrides` works exactly like it does for libraries. Ke
203203

204204
It is an error for the application configuration to override configuration parameters that were not defined.
205205

206-
## Overriding target attributes
206+
#### Overriding target attributes
207207

208208
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.
209209

@@ -226,7 +226,7 @@ For example, this `mbed_app.json` disables the IPV4 feature; using this network
226226
}
227227
```
228228

229-
# Configuration data precedence
229+
### Configuration data precedence
230230

231231
The order in which the various bits of configurations are considered is:
232232

@@ -244,10 +244,10 @@ For `myapp` above:
244244
- The value of `mylib.timer_period` is 100 because that's overridden by the application and takes precedence over the values defined in `mylib`.
245245
- The values of `mylib.buffer_size` and `mylib.queue_size` are:
246246
- 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.
248248
- Because `Derived` has its own `my_own_config` configuration parameter, `target.my_own_config` will also be defined in this case.
249249

250-
# Using configuration data in the code
250+
### Using configuration data in the code
251251

252252
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):
253253

docs/compile/exporter_instruct.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Exporter instructions
2+
3+
[A document with detailed step-by-step instructions about exporters.]

docs/advanced/exporters.md renamed to docs/compile/exporters.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# About the exporters
1+
## About the exporters
22

33
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).
44

5-
## mbed CLI command
5+
### mbed CLI command
66

77
```
88
usage: mbed export [-h] [-i IDE] [-m TARGET] [--source SOURCE] [-c] [-S] [-v]
@@ -24,38 +24,38 @@ optional arguments:
2424
-vv, --very_verbose Very verbose diagnostic output
2525
```
2626

27-
# Adding export support for a target
27+
### Adding export support for a target
2828

2929
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.
3030

31-
## Eclipse and Make
31+
#### Eclipse and Make
3232

3333
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).
3434

35-
## GNU ARM Eclipse managed projects
35+
#### GNU ARM Eclipse managed projects
3636

3737
The GNU ARM Eclipse exporter is available for all targets that use the GCC_ARM toolchain.
3838

39-
## Qt Creator and Make
39+
#### Qt Creator and Make
4040

4141
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.
4242

4343
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.
4444

45-
## uVision and IAR
45+
#### uVision and IAR
4646

47-
### CMSIS Packs
47+
##### CMSIS Packs
4848

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.
5050

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.
5252

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`.
5454

55-
#### What's in a device name?
55+
###### What's in a device name?
5656
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**.
5757

58-
#### Code usage
58+
###### Code usage
5959
[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:
6060
```xml
6161
<device Dname="MK20DX256xxx7">
@@ -73,13 +73,13 @@ There is no reliable way to map an mbed alias such as [NUCLEO_F030R8](https://gi
7373
</device>
7474
```
7575

76-
##### uVision
76+
####### uVision
7777
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.
7878

79-
##### IAR
79+
####### IAR
8080
[`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.
8181

82-
##### Updating index.json
82+
####### Updating index.json
8383
You can regenerate `index.json` to contain a newly made CMSIS pack with the following command:
8484

8585
`mbed export -i [IDE] --update-packs`

0 commit comments

Comments
 (0)