json test

Committer:
tgw
Date:
Fri Jan 26 06:05:31 2018 +0000
Revision:
0:2ee762ea11b3
json

Who changed what in which revision?

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