Masahiro Hirano / Mbed OS led-blinky
Committer:
bleis
Date:
Mon Jul 09 04:52:05 2018 +0000
Revision:
0:8bd49b071be9
first commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bleis 0:8bd49b071be9 1 # Getting started with Blinky on mbed OS
bleis 0:8bd49b071be9 2
bleis 0:8bd49b071be9 3 This guide reviews the steps required to get Blinky working on an mbed OS platform.
bleis 0:8bd49b071be9 4
bleis 0:8bd49b071be9 5 Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
bleis 0:8bd49b071be9 6
bleis 0:8bd49b071be9 7 ## Import the example application
bleis 0:8bd49b071be9 8
bleis 0:8bd49b071be9 9 From the command-line, import the example:
bleis 0:8bd49b071be9 10
bleis 0:8bd49b071be9 11 ```
bleis 0:8bd49b071be9 12 mbed import mbed-os-example-blinky
bleis 0:8bd49b071be9 13 cd mbed-os-example-blinky
bleis 0:8bd49b071be9 14 ```
bleis 0:8bd49b071be9 15
bleis 0:8bd49b071be9 16 ### Now compile
bleis 0:8bd49b071be9 17
bleis 0:8bd49b071be9 18 Invoke `mbed compile`, and specify the name of your platform and your favorite toolchain (`GCC_ARM`, `ARM`, `IAR`). For example, for the ARM Compiler 5:
bleis 0:8bd49b071be9 19
bleis 0:8bd49b071be9 20 ```
bleis 0:8bd49b071be9 21 mbed compile -m K64F -t ARM
bleis 0:8bd49b071be9 22 ```
bleis 0:8bd49b071be9 23
bleis 0:8bd49b071be9 24 Your PC may take a few minutes to compile your code. At the end, you see the following result:
bleis 0:8bd49b071be9 25
bleis 0:8bd49b071be9 26 ```
bleis 0:8bd49b071be9 27 [snip]
bleis 0:8bd49b071be9 28 +----------------------------+-------+-------+------+
bleis 0:8bd49b071be9 29 | Module | .text | .data | .bss |
bleis 0:8bd49b071be9 30 +----------------------------+-------+-------+------+
bleis 0:8bd49b071be9 31 | Misc | 13939 | 24 | 1372 |
bleis 0:8bd49b071be9 32 | core/hal | 16993 | 96 | 296 |
bleis 0:8bd49b071be9 33 | core/rtos | 7384 | 92 | 4204 |
bleis 0:8bd49b071be9 34 | features/FEATURE_IPV4 | 80 | 0 | 176 |
bleis 0:8bd49b071be9 35 | frameworks/greentea-client | 1830 | 60 | 44 |
bleis 0:8bd49b071be9 36 | frameworks/utest | 2392 | 512 | 292 |
bleis 0:8bd49b071be9 37 | Subtotals | 42618 | 784 | 6384 |
bleis 0:8bd49b071be9 38 +----------------------------+-------+-------+------+
bleis 0:8bd49b071be9 39 Allocated Heap: unknown
bleis 0:8bd49b071be9 40 Allocated Stack: unknown
bleis 0:8bd49b071be9 41 Total Static RAM memory (data + bss): 7168 bytes
bleis 0:8bd49b071be9 42 Total RAM memory (data + bss + heap + stack): 7168 bytes
bleis 0:8bd49b071be9 43 Total Flash memory (text + data + misc): 43402 bytes
bleis 0:8bd49b071be9 44 Image: .\.build\K64F\ARM\mbed-os-example-blinky.bin
bleis 0:8bd49b071be9 45 ```
bleis 0:8bd49b071be9 46
bleis 0:8bd49b071be9 47 ### Program your board
bleis 0:8bd49b071be9 48
bleis 0:8bd49b071be9 49 1. Connect your mbed device to the computer over USB.
bleis 0:8bd49b071be9 50 1. Copy the binary file to the mbed device.
bleis 0:8bd49b071be9 51 1. Press the reset button to start the program.
bleis 0:8bd49b071be9 52
bleis 0:8bd49b071be9 53 The LED on your platform turns on and off.
bleis 0:8bd49b071be9 54
bleis 0:8bd49b071be9 55 ## Troubleshooting
bleis 0:8bd49b071be9 56
bleis 0:8bd49b071be9 57 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.