Template for mbed-os

Committer:
noutram
Date:
Tue Sep 18 13:39:05 2018 +0000
Revision:
0:30c2b4019a20
Blinky template project for mbed-os

Who changed what in which revision?

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