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