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: README.md
+9-33Lines changed: 9 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Blinky Mbed OS Example
2
2
3
-
The example project contains variants of an application to blink an LED on supported [Mbed boards](https://os.mbed.com/platforms/).
3
+
The example project contains an application to blink an LED on supported [Mbed boards](https://os.mbed.com/platforms/).
4
4
5
5
The project can be built with all supported [Mbed OS build tools](https://os.mbed.com/docs/mbed-os/latest/tools/index.html). However, this example project specifically refers to the command line interface tool [Arm Mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli). Please install Arm Mbed CLI.
6
6
@@ -14,18 +14,11 @@ Clone this repository on your system and change the current directory to where t
14
14
15
15
Modifying default Mbed OS configuration parameters can be done at application level using an application configuration file. By default ARM Mbed CLI looks for [`mbed_app.json`](https://os.mbed.com/docs/mbed-os/latest/reference/configuration.html), however the configuration file can be named anything. It can be passed to ARM Mbed CLI using the optional argument `--app-config` of the `compile` sub-command. This project comes with configuration files for the different variants and configurations of the blinky application.
16
16
17
-
Select the section for the variant of the application you wish to build:
The `main()` function is the single thread in the application, it toggles the state of a digital output connected to an LED on the target.
23
20
24
-
### Application functionality
25
-
26
-
The `main()` function calls `blinky_wait()`, as part of the single thread, which toggles the state of a digital output connected to an LED on the target.
27
-
28
-
### <aname="build_blinky_wait_rtos"></a> Building and Running
21
+
## Building and Running
29
22
30
23
1. Connect a USB cable between the USB port on the target and the host computer.
31
24
2. Run the following command to build the example project and program the microcontroller flash memory:
@@ -34,38 +27,21 @@ The `main()` function calls `blinky_wait()`, as part of the single thread, which
34
27
```
35
28
The binary is located at `./BUILD/<TARGET>/<TOOLCHAIN>/mbed-os-example-blinky.bin` and can alternatively be manually copied to the target which gets mounted on the host computer via USB.
36
29
37
-
### <a name="blinky_wait_bare_metal"></a> Bare metal
38
-
The variant of the application [above](#build_blinky_wait_rtos) is built with the full Mbed OS library including its RTOS components. However, for single-threaded applications running on targets with ultraconstrains, it is possible to obtain an application with an even smaller memory footprint using [Mbed OS bare metal](https://os.mbed.com/docs/mbed-os/latest/reference/mbed-os-bare-metal.html) profile.
39
-
An application configuration file, [`config_blinky_wait_bare_metal.json`](./blinky_wait/config_blinky_wait_bare_metal.json) is provided to build a binary with Mbed OS bare metal profile.
30
+
## Bare metal
31
+
The application above is built with the full Mbed OS library including its RTOS components. However, for single-threaded applications running on targets with ultraconstrains, it is possible to obtain an application with an even smaller memory footprint using [Mbed OS bare metal](https://os.mbed.com/docs/mbed-os/latest/reference/mbed-os-bare-metal.html) profile.
32
+
An application configuration file, [`config_bare_metal.json`](./config_bare_metal.json) is provided to build a binary with Mbed OS bare metal profile.
40
33
41
34
1. Connect a USB cable between the USB port on the target and the host computer.
42
35
2. Run the following command to build the example project with runtime statistics output:
The binary is located at `./BUILD/<TARGET>/<TOOLCHAIN>/mbed-os-example-blinky.bin` and can alternatively be manually copied to the target which gets mounted on the host computer via USB.
47
40
48
41
`"target.default_lib":"small"` tells the build tool to use a small implementation of the C standard library for the toolchain selected if available. That would be Newlib-nano and MicroLib for GCC_ARM and ARM toolchains respectively.
This variant shows Mbed OS features suchs as threads, thread delay, and inter-thread communication to blink an LED.
54
-
55
-
### Application functionality
56
-
57
-
The `main()`functioncalls`blinky_multithreaded()`, as part of the main thread, which starts two threads: `thread_producer()` and `thread_consumer`. `thread_producer()` periodically send messages to `thread_consumer()` via an inter-thread queue. `thread_consumer()` verifies the message correctness and toggles the state of a digital output connected to an LED on the target.
58
-
59
-
### Building and Running
60
-
61
-
1. Connect a USB cable between the USB port on the target and the host computer.
62
-
2. Run the following command to build the example project and program the microcontroller flash memory:
The binary is located at `./BUILD/<TARGET>/<TOOLCHAIN>/mbed-os-example-blinky.bin` and can alternatively be manually copied to the target which gets mounted on the host computer via USB.
67
-
68
-
### Optional RTOS runtime statistics
44
+
## Optional RTOS runtime statistics
69
45
70
46
It is possible to take a snapshot of the device's runtime statistics and display it over serial to your PC. See how [here](https://os.mbed.com/docs/latest/apis/mbed-statistics.html).
0 commit comments