AdiSense1000_V21 MBED API

Fork of AdiSense1000 by PoC_Team

Committer:
kevin1990
Date:
Fri Oct 20 17:40:20 2017 +0000
Revision:
9:cdbd88d2e463
Parent:
7:4dbae381f693
v0.3 Updates

Who changed what in which revision?

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