This is an example of how to setup mbed to run on the ANNA-B112 using the EVK-NINA-B1 target for compilation

Committer:
rlanders73
Date:
Sun Mar 01 21:36:20 2020 +0000
Revision:
1:2bd5f1894796
Parent:
0:67a616264a3f
Disabled serial control flow by default

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rlanders73 0:67a616264a3f 1 ![](./resources/official_armmbed_example_badge.png)
rlanders73 0:67a616264a3f 2 # Blinky Mbed OS example
rlanders73 0:67a616264a3f 3
rlanders73 0:67a616264a3f 4 The example project is part of the [Arm Mbed OS Official Examples](https://os.mbed.com/code/) and is the [getting started example for Mbed OS](https://os.mbed.com/docs/mbed-os/v5.14/quick-start/index.html). It contains an application that repeatedly blinks an LED on supported [Mbed boards](https://os.mbed.com/platforms/).
rlanders73 0:67a616264a3f 5
rlanders73 0:67a616264a3f 6 You can build the project 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).
rlanders73 0:67a616264a3f 7 (Note: To see a rendered example you can import into the Arm Online Compiler, please see our [import quick start](https://os.mbed.com/docs/mbed-os/latest/quick-start/online-with-the-online-compiler.html#importing-the-code).)
rlanders73 0:67a616264a3f 8
rlanders73 0:67a616264a3f 9 1. [Install Mbed CLI](https://os.mbed.com/docs/mbed-os/latest/quick-start/offline-with-mbed-cli.html).
rlanders73 0:67a616264a3f 10
rlanders73 0:67a616264a3f 11 1. Clone this repository on your system, and change the current directory to where the project was cloned:
rlanders73 0:67a616264a3f 12
rlanders73 0:67a616264a3f 13 ```bash
rlanders73 0:67a616264a3f 14 $ git clone git@github.com:armmbed/mbed-os-example-blinky && cd mbed-os-example-blinky
rlanders73 0:67a616264a3f 15 ```
rlanders73 0:67a616264a3f 16
rlanders73 0:67a616264a3f 17 Alternatively, you can download the example project with Arm Mbed CLI using the `import` subcommand:
rlanders73 0:67a616264a3f 18
rlanders73 0:67a616264a3f 19 ```bash
rlanders73 0:67a616264a3f 20 $ mbed import mbed-os-example-blinky && cd mbed-os-example-blinky
rlanders73 0:67a616264a3f 21 ```
rlanders73 0:67a616264a3f 22
rlanders73 0:67a616264a3f 23
rlanders73 0:67a616264a3f 24 ## Application functionality
rlanders73 0:67a616264a3f 25
rlanders73 0:67a616264a3f 26 The `main()` function is the single thread in the application. It toggles the state of a digital output connected to an LED on the board.
rlanders73 0:67a616264a3f 27
rlanders73 0:67a616264a3f 28 ## Building and running
rlanders73 0:67a616264a3f 29
rlanders73 0:67a616264a3f 30 1. Connect a USB cable between the USB port on the board and the host computer.
rlanders73 0:67a616264a3f 31 2. <a name="build_cmd"></a> Run the following command to build the example project and program the microcontroller flash memory:
rlanders73 0:67a616264a3f 32 ```bash
rlanders73 0:67a616264a3f 33 $ mbed compile -m <TARGET> -t <TOOLCHAIN> --flash
rlanders73 0:67a616264a3f 34 ```
rlanders73 0:67a616264a3f 35 The binary is located at `./BUILD/<TARGET>/<TOOLCHAIN>/mbed-os-example-blinky.bin`.
rlanders73 0:67a616264a3f 36
rlanders73 0:67a616264a3f 37 Alternatively, you can manually copy the binary to the board, which you mount on the host computer over USB.
rlanders73 0:67a616264a3f 38
rlanders73 0:67a616264a3f 39 Depending on the target, you can build the example project with the `GCC_ARM`, `ARM` or `IAR` toolchain. After installing Arm Mbed CLI, run the command below to determine which toolchain supports your target:
rlanders73 0:67a616264a3f 40
rlanders73 0:67a616264a3f 41 ```bash
rlanders73 0:67a616264a3f 42 $ mbed compile -S
rlanders73 0:67a616264a3f 43 ```
rlanders73 0:67a616264a3f 44
rlanders73 0:67a616264a3f 45 ## Expected output
rlanders73 0:67a616264a3f 46 The LED on your target turns on and off every 500 milliseconds.
rlanders73 0:67a616264a3f 47
rlanders73 0:67a616264a3f 48
rlanders73 0:67a616264a3f 49 ## Troubleshooting
rlanders73 0:67a616264a3f 50 If you have problems, you can review the [documentation](https://os.mbed.com/docs/latest/tutorials/debugging.html) for suggestions on what could be wrong and how to fix it.
rlanders73 0:67a616264a3f 51
rlanders73 0:67a616264a3f 52 ## Related Links
rlanders73 0:67a616264a3f 53
rlanders73 0:67a616264a3f 54 * [Mbed OS Stats API](https://os.mbed.com/docs/latest/apis/mbed-statistics.html).
rlanders73 0:67a616264a3f 55 * [Mbed OS Configuration](https://os.mbed.com/docs/latest/reference/configuration.html).
rlanders73 0:67a616264a3f 56 * [Mbed OS Serial Communication](https://os.mbed.com/docs/latest/tutorials/serial-communication.html).
rlanders73 0:67a616264a3f 57 * [Mbed OS bare metal](https://os.mbed.com/docs/mbed-os/latest/reference/mbed-os-bare-metal.html).
rlanders73 0:67a616264a3f 58 * [Mbed boards](https://os.mbed.com/platforms/).
rlanders73 0:67a616264a3f 59
rlanders73 0:67a616264a3f 60 ### License and contributions
rlanders73 0:67a616264a3f 61
rlanders73 0:67a616264a3f 62 The software is provided under Apache-2.0 license. Contributions to this project are accepted under the same license. Please see contributing.md for more info.
rlanders73 0:67a616264a3f 63
rlanders73 0:67a616264a3f 64 This project contains code from other projects. The original license text is included in those source files. They must comply with our license guide.