A simple program to Toggle the 2 OnBoard LEDs.

Committer:
RGurav
Date:
Tue May 15 14:43:30 2018 +0000
Revision:
0:889636b54b07
Toggles the 2 onBoard LEDs.

Who changed what in which revision?

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