Simple LED blinking test code

Committer:
bpd227
Date:
Fri Jun 29 01:17:25 2018 +0000
Revision:
0:903ffe4d4440
First

Who changed what in which revision?

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