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