University of Plymouth - Stages 1, 2 and 3 / Mbed OS SOFT261-Coursework-May2018
Committer:
noutram
Date:
Mon Apr 30 13:15:32 2018 +0000
Revision:
0:aed251004373
Initial untested version

Who changed what in which revision?

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