AdiSense1000_V21 MBED API

Fork of AdiSense1000 by PoC_Team

Committer:
kevin1990
Date:
Fri Oct 20 15:58:01 2017 +0000
Revision:
7:4dbae381f693
Parent:
0:2a477447cc78
Child:
9:cdbd88d2e463
v0.3 release (New Host api)

Who changed what in which revision?

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