Skip to content

Commit 1689a6e

Browse files
committed
Bringing in 5.3 changes
1 parent b82d15c commit 1689a6e

14 files changed

+87
-165
lines changed

docs/APIs/intro.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
mbed OS lets you write applications that run on embedded devices, by providing the layer that interprets your application's code in a way the hardware can understand.
44

5-
Your application code - written in C++ - uses the application programing interfaces (APIs) presented by mbed OS to receive information from the hardware and send instructions to it. This means that a lot of the challenges in getting started with microcontrollers or integrating large amounts of software is already taken care of.
5+
Your application code is written in C++. It uses the application programming interfaces (APIs) that mbed OS provides. These APIs allow your code to work on different microcontrollers in a uniform way. This reduces a lot of the challenges in getting started with microcontrollers and integrating large amounts of software.
66

7-
To learn how to use the APIs to write your application, we'll start by reviewing how to use them to [control the flow of the application by managing its tasks](../getting_started/flow_control.md). We'll also introduce simple input and output controls.
7+
To use the APIs to write your application, start by reviewing how to use them to [control the flow of the application by managing its tasks](../getting_started/flow_control.md). We'll also introduce simple input and output controls.
88

9-
Once you're familiar with the basic concepts, you can move on to more advances examples that will demonstrate a broader use of the APIs:
9+
Once you're familiar with the basic concepts, you can move on to more advanced examples that will demonstrate a broader use of the APIs:
1010

1111
* [Building an internet connected lighting system](https://docs.mbed.com/docs/building-an-internet-connected-lighting-system/en/latest/).
1212
* [Building a LoRa network](https://docs.mbed.com/docs/lora-with-mbed/en/latest/).
1313
* Or any of the other examples [on our full list](https://docs.mbed.com/docs/examples-list/en/latest/).
1414

15-
<span class="tips">The full API references are [here](https://docs.mbed.com/docs/mbed-os-api-reference/). The [doxygen is here](https://docs.mbed.com/docs/mbed-os-api/en/mbed-os-5.2/api/index.html).</span>
15+
<span class="tips">The full API references are [here](https://docs.mbed.com/docs/mbed-os-api-reference/). The [doxygen is here](https://docs.mbed.com/docs/mbed-os-api/en/mbed-os-5.3/api/index.html).</span>
1616

docs/advanced/MINAR_migration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ If you don't like asynchronous programming, or if you wrote your code in asynchr
6060

6161
## Porting strategy 2: use the optional mbed OS 5 event loop
6262

63-
To help ease porting MINAR applications, and to provide support for asynchronous style programming, mbed OS 5 provides an optional event loop. The main documentation for the event loop can be found [here](https://docs.mbed.com/docs/mbed-os-api-reference/en/5.2/APIs/tasks/events/). In short, the mbed OS 5 event loop implementation consists of an [EventQueue class](https://github.com/ARMmbed/mbed-os/blob/master/events/EventQueue.h) that implements the storage for the events and has a `dispatch` function. There are quite a few differences between MINAR and `EventQueue`:
63+
To help ease porting MINAR applications, and to provide support for asynchronous style programming, mbed OS 5 provides an optional event loop. The main documentation for the event loop can be found [here](https://docs.mbed.com/docs/mbed-os-api-reference/en/5.3/APIs/tasks/events/). In short, the mbed OS 5 event loop implementation consists of an [EventQueue class](https://github.com/ARMmbed/mbed-os/blob/master/events/EventQueue.h) that implements the storage for the events and has a `dispatch` function. There are quite a few differences between MINAR and `EventQueue`:
6464

6565
- MINAR and the mbed OS 5 event loop have incompatible APIs.
6666
- Both MINAR and `EventQueue` work with *events* (objects that are placed in the event queue). However, the interface and implementations of events in MINAR and mbed OS 5 are different, and that's also true for the APIs that use them. Take a look at [the Callback class](https://github.com/ARMmbed/mbed-os/blob/master/platform/Callback.h), [the Event class](https://github.com/ARMmbed/mbed-os/blob/master/events/Event.h) and [the EventQueue class](https://github.com/ARMmbed/mbed-os/blob/master/events/EventQueue.h) for more details about the mbed OS 5 implementation.
@@ -71,7 +71,7 @@ To help ease porting MINAR applications, and to provide support for asynchronous
7171

7272
Keep in mind that even if you choose to use the mbed OS 5 event loop, the RTOS is always present, so you need to consider all the RTOS-specific issues (such as synchronization).
7373

74-
If you want to keep the asynchronous aspect of your mbed OS 3 application, the best way to proceed is to read the [documentation of the mbed OS event loop](https://docs.mbed.com/docs/mbed-os-api-reference/en/5.2/APIs/tasks/events/) and rewrite your application using the new APIs. Here are some rough API compatibility guides:
74+
If you want to keep the asynchronous aspect of your mbed OS 3 application, the best way to proceed is to read the [documentation of the mbed OS event loop](https://docs.mbed.com/docs/mbed-os-api-reference/en/5.3/APIs/tasks/events/) and rewrite your application using the new APIs. Here are some rough API compatibility guides:
7575

7676
- The MINAR function `postCallback` can be replaced with `EventQueue::call`.
7777
- The MINAR function `delay` can be replaced with `EventQueue::call_in`.

docs/advanced/porting_guide.md

Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1 @@
1-
# Porting guide: adding target support to mbed OS 5
2-
3-
There are two typical ways to add target support to mbed OS: Either you'll be adding a [completely new microcontroller](#adding-a-new-microcontroller) and board, or you'll be adding a new board that contains an [already-supported microcontroller](#adding-a-new-board-or-module).
4-
5-
There is a dependency on CMSIS-CORE and CMSIS-Packs, so make sure the microcontroller already has these available.
6-
7-
## Adding a new microcontroller
8-
9-
Add the empty target implementation reference to the working directory using:
10-
11-
```
12-
mbed add mbed-os-example-new-target
13-
cd mbed-os-example-new-target\mbed-os
14-
git checkout master
15-
git pull
16-
git checkout -b my-new-target
17-
git remote set-url origin https://github.com/USERNAME/mbed-os
18-
cd ..
19-
```
20-
21-
### Target description
22-
23-
Add the target description to ```mbed-os\targets\targets.json```
24-
25-
``` json
26-
"MCU_NAME": {
27-
"inherits": ["Target"],
28-
"core": "Cortex-M3",
29-
"supported_toolchains": ["ARM", "GCC_ARM", "IAR"],
30-
"extra_labels": ["VENDOR", "MCU_FAMILY", "MCU_NAME"],
31-
"macros": [],
32-
"device_has": ["SERIAL", "STDIO_MESSAGES"]
33-
},
34-
"BOARD_NAME": {
35-
"inherits": ["MCU_NAME"]
36-
}
37-
```
38-
39-
### Bootstrap code
40-
41-
There are a number of files needed before a first successful compile. CMSIS-CORE files are needed for start-up and peripheral memory addresses as well as the linker scripts for ARM, IAR and GCC toolchains. These files are usually in the ```mbed-os\targets\TARGET_VENDOR\TARGET_MCU_FAMILY\TARGET_MCUNAME\device``` directory.
42-
43-
If the microcontroller has a SYS_TICK the RTOS will configure this, so only a few macros are needed in ```mbed-os\targets\TARGET_VENDOR\mbed-rtx.h```.
44-
45-
Some extensions to CMSIS-CORE are also required for dynamic vector relocation. ```mbed-os\targets\TARGET_VENDOR\TARGET_MCUNAME\cmsis.h``` is the entry point to the target for mbed OS software. This will include the vector relocation additions and device-specific headers that include CMSIS-CORE. A relocation routine is needed in ```mbed-os\targets\TARGET_VENDOR\TARGET_MCUNAME\cmsis_nvic.c and .h```
46-
47-
Now verify your target is identified by using ```mbed compile -m MCU_NAME -t <toolchain>```. This should compile.
48-
49-
The next step is to enable the test harness dependencies. To run the test suite there is a minimum requirement of GPIO, microsecond ticker and serial implementation, all explained below.
50-
51-
### GPIO
52-
53-
The ```gpio_s``` is for referencing memory-mapped GPIO registers and passing related pin information or other IO operation data that the HAL needs. These structures are defined in ```objects.h```. The required implementation definition is in ```mbed-os\hal\gpio_api.h```.
54-
55-
### SERIAL
56-
57-
The ```serial_s``` is for referencing memory-mapped Serial registers and passing related pin and peripheral operation information data that the HAL needs. These structures are defined in ```objects.h```. The required implementation definition is in ```mbed-os\hal\serial_api.h```.
58-
59-
### US TICKER
60-
61-
The microsecond ticker is a system resource that is used for many API and other timing utilities. It needs a one microsecond resolution and should be implemented using a free-running hardware counter or timer with match register.
62-
The required implementation definition is in ```mbed-os\hal\us_ticker_api.h```.
63-
64-
At this point, we should be able to compile a handful of tests:
65-
66-
``mbed test -m BOARD_NAME --compile -t <toolchain>``
67-
68-
To execute the tests you'll need to already support [mbed-ls](https://github.com/armmbed/mbed-ls).
69-
70-
### All the others
71-
72-
At this point, the HAL structure should be familiar as a programming model. There are many more APIs to implement, which are enabled by adding a ```device_has``` attribute to the MCU_NAME and then providing the implementation.
73-
74-
## Adding a new board or module
75-
76-
Coming soon.
1+
!{https://raw.githubusercontent.com/sg-/porting-guide/master/porting-quick.md}

docs/dev_tools/online_comp.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The compiler is always available on [https://developer.mbed.org/compiler/](https
1212

1313
There are two methods of importing the code into the online compiler: directly from a program presented on the site, or using the compiler’s Import button:
1414

15-
1. Directly from the site: wherever you see a program on the site, you should see an Import button:
15+
1. Directly from the site: wherever you see a program on the site, you should see an **Import into mbed IDE** button:
1616

1717
<span class="images">![](Images/import_button_site.png)<span>Most code snippets on the site can be directly imported</span></span>
1818

@@ -33,27 +33,27 @@ There are two methods of importing the code into the online compiler: directly f
3333

3434
## Creating a new program
3535

36-
1. From the **New** menu, select **Program**:
36+
1. From the **New** menu, select **New Program**:
3737

3838
<span class="images">![](Images/new.png)<span>The applications list</span>Triggering a new program</span>
3939

4040
1. The **Create new program** pop-up opens.
4141
1. Select your platform (board).
42-
1. You can create from an existing template, or from an empty program.
42+
1. You can create from an existing template or from an empty program.
4343
1. Enter a unique name.
4444

4545
<span class="images">![](Images/new_program.png)<span>Creating a new program</span></span>
4646

4747
1. Create a ``main.cpp`` file in your program:
48-
1. Right click on the program and select **New File...**. The **Create new file** popup opens.
48+
1. Right click on the program and select **New File...**. The **Create new file** pop-up opens. If you created from an existing template, this file already exists.
4949

5050
<span class="images">![](Images/new_file.png)<span>Adding a file</span></span>
5151

5252
1. Enter ``main.cpp`` as the file name.
5353

5454
<span class="images">![](Images/main_cpp.png)<span>Naming the new file</span></span>
5555

56-
1. Import the mbed OS library so you can build your program with the mbed OS code base:
56+
1. Import the mbed OS library, so you can build your program with the mbed OS codebase:
5757
1. Click **Import**. The Import Wizard opens.
5858
1. Go to the Libraries tab and search for "mbed", or perform an empty search to show all libraries:
5959

@@ -73,7 +73,7 @@ The mbed Online Compiler builds a file that can run on your board. All you need
7373

7474
### Selecting your board
7575

76-
mbed programs can be built to run on multiple boards. The hard work is done behind the scenes, by mbed OS itself. All you need to do is tell the mbed Online Compiler which board you're building for.
76+
mbed programs can be built to run on multiple boards. The hard work is done behind the scenes by mbed OS itself. All you need to do is tell the mbed Online Compiler which board you're building for.
7777

7878
To select a board as the build target:
7979

@@ -123,7 +123,7 @@ Your board should appear on your computer as removable storage. To run your prog
123123
| Shift + Page Up | Select from current position up one page |
124124
| Shift + Page Down | Select from current position down one page |
125125
| Shift + any arrow | Extend or reduce text selection |
126-
| Ctrl + left arrow | Go to beginning of the previous word |
126+
| Ctrl + left arrow | Go to beginning of current or previous word |
127127
| Ctrl + right arrow | Go to beginning of the next word |
128128
| Ctrl + up arrow | Scroll up one row |
129129
| Ctrl + down arrow | Scroll down one row |
@@ -153,8 +153,8 @@ Your board should appear on your computer as removable storage. To run your prog
153153
| Ctrl + Shift + S | Save all |
154154
| Ctrl + U| Change select text to upper case |
155155
| Ctrl + V | Paste text from clipboard |
156-
| Ctrl + W | Close current file (doesn't work on Chrome |
157-
| Ctrl + Shift + W | Close all (doesn't work on Chrome |
156+
| Ctrl + W | Close current file (doesn't work on Chrome) |
157+
| Ctrl + Shift + W | Close all (doesn't work on Chrome) |
158158
| Ctrl + X | Cut selected text |
159159
| Ctrl + Y | Redo |
160160
| Ctrl + Z | Undo |
@@ -171,8 +171,8 @@ Your board should appear on your computer as removable storage. To run your prog
171171
| Ins | Toggle insert mode |
172172
| Ctrl + Ins | Copy selected text |
173173
| Shift + Ins | Paste text from clipboard |
174-
| Shift + Del | Cut selected text |
175-
| F8| Compile only (no download prompt |
174+
| Shift + Del | Delete selected text |
175+
| F8| Compile only (no download prompt) |
176176
| F9 | Compile and download |
177177
| F10 | Compile all and download |
178178

docs/dev_tools/options.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,18 @@
22

33
We developed mbed OS 5 using the mbed CLI tool, which is a Python program that coordinates builds and fetches all the dependencies of an mbed OS application. As this runs on your local development machine, you also need compilers and other build tools installed.
44

5-
mbed OS 5 is compatible with the tools, libraries and programs that have been deployed on the developer.mbed.org site since mbed's origins, so you can also use the mbed Online Compiler for building mbed OS 5 examples and programs. Furthermore, the exporters to third party development tools that were part of the mbed OS 2 ecosystem can also be used.
5+
mbed OS 5 is compatible with the tools, libraries and programs that have been deployed on the developer.mbed.org site since mbed's origin, so you can also use the mbed Online Compiler for building mbed OS 5 examples and programs. Furthermore, you can use the exporters to third party development tools that were part of the mbed OS 2 ecosystem.
66

7-
Finally, we are experimenting with a Cloud9-based mbed Enabled IDE, which is currently in an alpha state and can be tested using the instructions below.
7+
Use the instructions below to test our Cloud9-based mbed Enabled IDE, which is currently in an alpha state.
88

99
## mbed CLI
1010

11-
The mbed command line tool (mbed CLI) was created specifically for mbed OS 5 and is a Python-based tool. For more information, see the [mbed CLI page](cli.md).
11+
We created the mbed command-line tool (mbed CLI), a Python-based tool, specifically for mbed OS 5. For more information, see the [mbed CLI page](cli.md).
1212

1313
## mbed Online Compiler
1414

1515
The mbed Online Compiler is our in-house IDE, and should be familiar to anyone who's been working with mbed for a while. For more information, see the [Online Compiler page](online_comp.md).
1616

17-
## mbed Studio
18-
19-
mbed Studio is an mbed Enabled IDE based on Cloud9 and offers a rich development environment. It is currently in alpha and should be considered experimental. It can be tried by selecting 'mbed Studio' from the 'Import Program' dropdown on our code samples.
20-
2117
## Third party development tools
2218

23-
You can export your project from any of our tools to third party tools. For instructions, as well as tool-specific information, see [the Exporting to Third Party Toolchains page](third_party.md).
19+
You can export your project from any of our tools to third party tools. For instructions, as well as tool-specific information, see [the Exporting to third party toolchains page](third_party.md).

0 commit comments

Comments
 (0)