PPM read and generate

Dependencies:   PPM

Committer:
edy05
Date:
Fri Jun 09 08:39:37 2017 +0000
Revision:
0:f4a29fdb4d6f
Testing PPM reading

Who changed what in which revision?

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