test

Committer:
randalthor
Date:
Fri May 19 09:30:31 2017 +0000
Revision:
0:4232849417e1
export to the cli

Who changed what in which revision?

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