Working version. ADXL355 data saved to microSD.

Committer:
DUR
Date:
Fri Sep 29 12:53:50 2017 +0000
Revision:
0:e2579e8d9b13
Working version.

Who changed what in which revision?

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