AdiSense1000_V21 MBED API

Fork of AdiSense1000 by PoC_Team

Committer:
kevin1990
Date:
Thu May 17 10:34:45 2018 +0100
Revision:
28:4eb837cd71df
Adding host library and example code for v1.3 release

Who changed what in which revision?

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