Example program for LED blinky

Committer:
Pitiwut
Date:
Fri Oct 05 08:30:50 2018 +0000
Revision:
0:71e6966178f5
First program

Who changed what in which revision?

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