projet neotim mpp / Mbed 2 deprecated projet_v4

Dependencies:   mbed

Committer:
jdeschamps
Date:
Fri Jun 05 06:33:21 2020 +0000
Revision:
4:1d58769720c6
Parent:
0:5fb4c7e603cf
nouveau;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dg81 0:5fb4c7e603cf 1 ![](./resources/official_armmbed_example_badge.png)
dg81 0:5fb4c7e603cf 2 # Blinky Mbed OS example
dg81 0:5fb4c7e603cf 3
dg81 0:5fb4c7e603cf 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/).
dg81 0:5fb4c7e603cf 5
dg81 0:5fb4c7e603cf 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).
dg81 0:5fb4c7e603cf 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).)
dg81 0:5fb4c7e603cf 8
dg81 0:5fb4c7e603cf 9 1. [Install Mbed CLI](https://os.mbed.com/docs/mbed-os/latest/quick-start/offline-with-mbed-cli.html).
dg81 0:5fb4c7e603cf 10
dg81 0:5fb4c7e603cf 11 1. Clone this repository on your system, and change the current directory to where the project was cloned:
dg81 0:5fb4c7e603cf 12
dg81 0:5fb4c7e603cf 13 ```bash
dg81 0:5fb4c7e603cf 14 $ git clone git@github.com:armmbed/mbed-os-example-blinky && cd mbed-os-example-blinky
dg81 0:5fb4c7e603cf 15 ```
dg81 0:5fb4c7e603cf 16
dg81 0:5fb4c7e603cf 17 Alternatively, you can download the example project with Arm Mbed CLI using the `import` subcommand:
dg81 0:5fb4c7e603cf 18
dg81 0:5fb4c7e603cf 19 ```bash
dg81 0:5fb4c7e603cf 20 $ mbed import mbed-os-example-blinky && cd mbed-os-example-blinky
dg81 0:5fb4c7e603cf 21 ```
dg81 0:5fb4c7e603cf 22
dg81 0:5fb4c7e603cf 23
dg81 0:5fb4c7e603cf 24 ## Application functionality
dg81 0:5fb4c7e603cf 25
dg81 0:5fb4c7e603cf 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.
dg81 0:5fb4c7e603cf 27
dg81 0:5fb4c7e603cf 28 ## Building and running
dg81 0:5fb4c7e603cf 29
dg81 0:5fb4c7e603cf 30 1. Connect a USB cable between the USB port on the board and the host computer.
dg81 0:5fb4c7e603cf 31 2. <a name="build_cmd"></a> Run the following command to build the example project and program the microcontroller flash memory:
dg81 0:5fb4c7e603cf 32 ```bash
dg81 0:5fb4c7e603cf 33 $ mbed compile -m <TARGET> -t <TOOLCHAIN> --flash
dg81 0:5fb4c7e603cf 34 ```
dg81 0:5fb4c7e603cf 35 The binary is located at `./BUILD/<TARGET>/<TOOLCHAIN>/mbed-os-example-blinky.bin`.
dg81 0:5fb4c7e603cf 36
dg81 0:5fb4c7e603cf 37 Alternatively, you can manually copy the binary to the board, which you mount on the host computer over USB.
dg81 0:5fb4c7e603cf 38
dg81 0:5fb4c7e603cf 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:
dg81 0:5fb4c7e603cf 40
dg81 0:5fb4c7e603cf 41 ```bash
dg81 0:5fb4c7e603cf 42 $ mbed compile -S
dg81 0:5fb4c7e603cf 43 ```
dg81 0:5fb4c7e603cf 44
dg81 0:5fb4c7e603cf 45 ## Expected output
dg81 0:5fb4c7e603cf 46 The LED on your target turns on and off every 500 milliseconds.
dg81 0:5fb4c7e603cf 47
dg81 0:5fb4c7e603cf 48
dg81 0:5fb4c7e603cf 49 ## Troubleshooting
dg81 0:5fb4c7e603cf 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.
dg81 0:5fb4c7e603cf 51
dg81 0:5fb4c7e603cf 52 ## Related Links
dg81 0:5fb4c7e603cf 53
dg81 0:5fb4c7e603cf 54 * [Mbed OS Stats API](https://os.mbed.com/docs/latest/apis/mbed-statistics.html).
dg81 0:5fb4c7e603cf 55 * [Mbed OS Configuration](https://os.mbed.com/docs/latest/reference/configuration.html).
dg81 0:5fb4c7e603cf 56 * [Mbed OS Serial Communication](https://os.mbed.com/docs/latest/tutorials/serial-communication.html).
dg81 0:5fb4c7e603cf 57 * [Mbed OS bare metal](https://os.mbed.com/docs/mbed-os/latest/reference/mbed-os-bare-metal.html).
dg81 0:5fb4c7e603cf 58 * [Mbed boards](https://os.mbed.com/platforms/).
dg81 0:5fb4c7e603cf 59
dg81 0:5fb4c7e603cf 60 ### License and contributions
dg81 0:5fb4c7e603cf 61
dg81 0:5fb4c7e603cf 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.
dg81 0:5fb4c7e603cf 63
dg81 0:5fb4c7e603cf 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.