Michael Lumpp / Mbed OS vorlageGSOE

Dependencies:   MFS_Display_HAL LCD_i2c_GSOE HSAnalogIn_GSOE

Committer:
lumppi
Date:
Sat Jul 23 14:23:28 2022 +0000
Revision:
2:33c35c8855f1
Parent:
0:645e47a5b9db
commit2 mbed 6.16

Who changed what in which revision?

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