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