test

Committer:
joschaihl
Date:
Sun May 14 12:23:26 2017 +0000
Revision:
0:593f99dade2d
blub;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
joschaihl 0:593f99dade2d 1 # Getting started with Blinky on mbed OS
joschaihl 0:593f99dade2d 2
joschaihl 0:593f99dade2d 3 This guide reviews the steps required to get Blinky working on an mbed OS platform.
joschaihl 0:593f99dade2d 4
joschaihl 0:593f99dade2d 5 Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
joschaihl 0:593f99dade2d 6
joschaihl 0:593f99dade2d 7 ## Import the example application
joschaihl 0:593f99dade2d 8
joschaihl 0:593f99dade2d 9 From the command-line, import the example:
joschaihl 0:593f99dade2d 10
joschaihl 0:593f99dade2d 11 ```
joschaihl 0:593f99dade2d 12 mbed import mbed-os-example-blinky
joschaihl 0:593f99dade2d 13 cd mbed-os-example-blinky
joschaihl 0:593f99dade2d 14 ```
joschaihl 0:593f99dade2d 15
joschaihl 0:593f99dade2d 16 ### Now compile
joschaihl 0:593f99dade2d 17
joschaihl 0:593f99dade2d 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:
joschaihl 0:593f99dade2d 19
joschaihl 0:593f99dade2d 20 ```
joschaihl 0:593f99dade2d 21 mbed compile -m K64F -t ARM
joschaihl 0:593f99dade2d 22 ```
joschaihl 0:593f99dade2d 23
joschaihl 0:593f99dade2d 24 Your PC may take a few minutes to compile your code. At the end, you see the following result:
joschaihl 0:593f99dade2d 25
joschaihl 0:593f99dade2d 26 ```
joschaihl 0:593f99dade2d 27 [snip]
joschaihl 0:593f99dade2d 28 +----------------------------+-------+-------+------+
joschaihl 0:593f99dade2d 29 | Module | .text | .data | .bss |
joschaihl 0:593f99dade2d 30 +----------------------------+-------+-------+------+
joschaihl 0:593f99dade2d 31 | Misc | 13939 | 24 | 1372 |
joschaihl 0:593f99dade2d 32 | core/hal | 16993 | 96 | 296 |
joschaihl 0:593f99dade2d 33 | core/rtos | 7384 | 92 | 4204 |
joschaihl 0:593f99dade2d 34 | features/FEATURE_IPV4 | 80 | 0 | 176 |
joschaihl 0:593f99dade2d 35 | frameworks/greentea-client | 1830 | 60 | 44 |
joschaihl 0:593f99dade2d 36 | frameworks/utest | 2392 | 512 | 292 |
joschaihl 0:593f99dade2d 37 | Subtotals | 42618 | 784 | 6384 |
joschaihl 0:593f99dade2d 38 +----------------------------+-------+-------+------+
joschaihl 0:593f99dade2d 39 Allocated Heap: unknown
joschaihl 0:593f99dade2d 40 Allocated Stack: unknown
joschaihl 0:593f99dade2d 41 Total Static RAM memory (data + bss): 7168 bytes
joschaihl 0:593f99dade2d 42 Total RAM memory (data + bss + heap + stack): 7168 bytes
joschaihl 0:593f99dade2d 43 Total Flash memory (text + data + misc): 43402 bytes
joschaihl 0:593f99dade2d 44 Image: .\.build\K64F\ARM\mbed-os-example-blinky.bin
joschaihl 0:593f99dade2d 45 ```
joschaihl 0:593f99dade2d 46
joschaihl 0:593f99dade2d 47 ### Program your board
joschaihl 0:593f99dade2d 48
joschaihl 0:593f99dade2d 49 1. Connect your mbed device to the computer over USB.
joschaihl 0:593f99dade2d 50 1. Copy the binary file to the mbed device.
joschaihl 0:593f99dade2d 51 1. Press the reset button to start the program.
joschaihl 0:593f99dade2d 52
joschaihl 0:593f99dade2d 53 The LED on your platform turns on and off.
joschaihl 0:593f99dade2d 54
joschaihl 0:593f99dade2d 55 ## Export the project to Keil MDK, and debug your application
joschaihl 0:593f99dade2d 56
joschaihl 0:593f99dade2d 57 From the command-line, run the following command:
joschaihl 0:593f99dade2d 58
joschaihl 0:593f99dade2d 59 ```
joschaihl 0:593f99dade2d 60 mbed export -m K64F -i uvision
joschaihl 0:593f99dade2d 61 ```
joschaihl 0:593f99dade2d 62
joschaihl 0:593f99dade2d 63 To debug the application:
joschaihl 0:593f99dade2d 64
joschaihl 0:593f99dade2d 65 1. Start uVision.
joschaihl 0:593f99dade2d 66 1. Import the uVision project generated earlier.
joschaihl 0:593f99dade2d 67 1. Compile your application, and generate an `.axf` file.
joschaihl 0:593f99dade2d 68 1. Make sure uVision is configured to debug over CMSIS-DAP (From the Project menu > Options for Target '...' > Debug tab > Use CMSIS-DAP Debugger).
joschaihl 0:593f99dade2d 69 1. Set breakpoints, and start a debug session.
joschaihl 0:593f99dade2d 70
joschaihl 0:593f99dade2d 71 ![Image of uVision](img/uvision.png)
joschaihl 0:593f99dade2d 72
joschaihl 0:593f99dade2d 73 ## Troubleshooting
joschaihl 0:593f99dade2d 74
joschaihl 0:593f99dade2d 75 1. Make sure `mbed-cli` is working correctly and its version is `>1.0.0`
joschaihl 0:593f99dade2d 76
joschaihl 0:593f99dade2d 77 ```
joschaihl 0:593f99dade2d 78 mbed --version
joschaihl 0:593f99dade2d 79 ```
joschaihl 0:593f99dade2d 80
joschaihl 0:593f99dade2d 81 If not, you can update it:
joschaihl 0:593f99dade2d 82
joschaihl 0:593f99dade2d 83 ```
joschaihl 0:593f99dade2d 84 pip install mbed-cli --upgrade
joschaihl 0:593f99dade2d 85 ```
joschaihl 0:593f99dade2d 86
joschaihl 0:593f99dade2d 87 2. If using Keil MDK, make sure you have a license installed. [MDK-Lite](http://www.keil.com/arm/mdk.asp) has a 32 KB restriction on code size.