takashi kadono
/
mbed-os-example-blinky
Fork of https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-blinky/
README.md@0:394aee574ebb, 2017-02-01 (annotated)
- Committer:
- mbed_official
- Date:
- Wed Feb 01 09:06:36 2017 +0100
- Revision:
- 0:394aee574ebb
- Child:
- 1:5840a8dc8ee4
Merge pull request #39 from adbridge/master
Updating mbed-os to mbed-os-5.3.3
Commit copied from https://github.com/ARMmbed/mbed-os-example-blinky
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:394aee574ebb | 1 | # Getting started with Blinky on mbed OS |
mbed_official | 0:394aee574ebb | 2 | |
mbed_official | 0:394aee574ebb | 3 | This is a very simple guide, reviewing the steps required to get Blinky working on an mbed OS platform. |
mbed_official | 0:394aee574ebb | 4 | |
mbed_official | 0:394aee574ebb | 5 | Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli). |
mbed_official | 0:394aee574ebb | 6 | |
mbed_official | 0:394aee574ebb | 7 | ## Get the example application! |
mbed_official | 0:394aee574ebb | 8 | |
mbed_official | 0:394aee574ebb | 9 | From the command line, import the example: |
mbed_official | 0:394aee574ebb | 10 | |
mbed_official | 0:394aee574ebb | 11 | ``` |
mbed_official | 0:394aee574ebb | 12 | mbed import mbed-os-example-blinky |
mbed_official | 0:394aee574ebb | 13 | cd mbed-os-example-blinky |
mbed_official | 0:394aee574ebb | 14 | ``` |
mbed_official | 0:394aee574ebb | 15 | |
mbed_official | 0:394aee574ebb | 16 | ### Now compile |
mbed_official | 0:394aee574ebb | 17 | |
mbed_official | 0:394aee574ebb | 18 | Invoke `mbed compile` specifying the name of your platform and your favorite toolchain (`GCC_ARM`, `ARM`, `IAR`). For example, for the ARM Compiler 5: |
mbed_official | 0:394aee574ebb | 19 | |
mbed_official | 0:394aee574ebb | 20 | ``` |
mbed_official | 0:394aee574ebb | 21 | mbed compile -m K64F -t ARM |
mbed_official | 0:394aee574ebb | 22 | ``` |
mbed_official | 0:394aee574ebb | 23 | |
mbed_official | 0:394aee574ebb | 24 | Your PC may take a few minutes to compile your code. At the end you should get the following result: |
mbed_official | 0:394aee574ebb | 25 | |
mbed_official | 0:394aee574ebb | 26 | ``` |
mbed_official | 0:394aee574ebb | 27 | [snip] |
mbed_official | 0:394aee574ebb | 28 | +----------------------------+-------+-------+------+ |
mbed_official | 0:394aee574ebb | 29 | | Module | .text | .data | .bss | |
mbed_official | 0:394aee574ebb | 30 | +----------------------------+-------+-------+------+ |
mbed_official | 0:394aee574ebb | 31 | | Misc | 13939 | 24 | 1372 | |
mbed_official | 0:394aee574ebb | 32 | | core/hal | 16993 | 96 | 296 | |
mbed_official | 0:394aee574ebb | 33 | | core/rtos | 7384 | 92 | 4204 | |
mbed_official | 0:394aee574ebb | 34 | | features/FEATURE_IPV4 | 80 | 0 | 176 | |
mbed_official | 0:394aee574ebb | 35 | | frameworks/greentea-client | 1830 | 60 | 44 | |
mbed_official | 0:394aee574ebb | 36 | | frameworks/utest | 2392 | 512 | 292 | |
mbed_official | 0:394aee574ebb | 37 | | Subtotals | 42618 | 784 | 6384 | |
mbed_official | 0:394aee574ebb | 38 | +----------------------------+-------+-------+------+ |
mbed_official | 0:394aee574ebb | 39 | Allocated Heap: unknown |
mbed_official | 0:394aee574ebb | 40 | Allocated Stack: unknown |
mbed_official | 0:394aee574ebb | 41 | Total Static RAM memory (data + bss): 7168 bytes |
mbed_official | 0:394aee574ebb | 42 | Total RAM memory (data + bss + heap + stack): 7168 bytes |
mbed_official | 0:394aee574ebb | 43 | Total Flash memory (text + data + misc): 43402 bytes |
mbed_official | 0:394aee574ebb | 44 | Image: .\.build\K64F\ARM\mbed-os-example-blinky.bin |
mbed_official | 0:394aee574ebb | 45 | ``` |
mbed_official | 0:394aee574ebb | 46 | |
mbed_official | 0:394aee574ebb | 47 | ### Program your board |
mbed_official | 0:394aee574ebb | 48 | |
mbed_official | 0:394aee574ebb | 49 | 1. Connect your mbed device to the computer over USB. |
mbed_official | 0:394aee574ebb | 50 | 1. Copy the binary file to the mbed device . |
mbed_official | 0:394aee574ebb | 51 | 1. Press the reset button to start the program. |
mbed_official | 0:394aee574ebb | 52 | |
mbed_official | 0:394aee574ebb | 53 | You should see the LED of your platform turning on and off. |
mbed_official | 0:394aee574ebb | 54 | |
mbed_official | 0:394aee574ebb | 55 | Congratulations if you managed to complete this test! |
mbed_official | 0:394aee574ebb | 56 | |
mbed_official | 0:394aee574ebb | 57 | ## Export the project to Keil MDK and debug your application |
mbed_official | 0:394aee574ebb | 58 | |
mbed_official | 0:394aee574ebb | 59 | From the command line, run the following command: |
mbed_official | 0:394aee574ebb | 60 | |
mbed_official | 0:394aee574ebb | 61 | ``` |
mbed_official | 0:394aee574ebb | 62 | mbed export -m K64F -i uvision |
mbed_official | 0:394aee574ebb | 63 | ``` |
mbed_official | 0:394aee574ebb | 64 | |
mbed_official | 0:394aee574ebb | 65 | To debug the application: |
mbed_official | 0:394aee574ebb | 66 | |
mbed_official | 0:394aee574ebb | 67 | 1. Start uVision. |
mbed_official | 0:394aee574ebb | 68 | 1. Import the uVision project generated earlier. |
mbed_official | 0:394aee574ebb | 69 | 1. Compile your application and generate an `.axf` file. |
mbed_official | 0:394aee574ebb | 70 | 1. Make sure uVision is configured to debug over CMSIS-DAP (From the Project menu > Options for Target '...' > Debug tab > Use CMSIS-DAP Debugger). |
mbed_official | 0:394aee574ebb | 71 | 1. Set breakpoints and start a debug session. |
mbed_official | 0:394aee574ebb | 72 | |
mbed_official | 0:394aee574ebb | 73 | ![Image of uVision](img/uvision.png) |
mbed_official | 0:394aee574ebb | 74 | |
mbed_official | 0:394aee574ebb | 75 | ## Troubleshooting |
mbed_official | 0:394aee574ebb | 76 | |
mbed_official | 0:394aee574ebb | 77 | 1. Make sure `mbed-cli` is working correctly and its version is greater than `0.8.9` |
mbed_official | 0:394aee574ebb | 78 | |
mbed_official | 0:394aee574ebb | 79 | ``` |
mbed_official | 0:394aee574ebb | 80 | mbed --version |
mbed_official | 0:394aee574ebb | 81 | ``` |
mbed_official | 0:394aee574ebb | 82 | |
mbed_official | 0:394aee574ebb | 83 | If not, you can update it easily: |
mbed_official | 0:394aee574ebb | 84 | |
mbed_official | 0:394aee574ebb | 85 | ``` |
mbed_official | 0:394aee574ebb | 86 | pip install mbed-cli --upgrade |
mbed_official | 0:394aee574ebb | 87 | ``` |
mbed_official | 0:394aee574ebb | 88 | |
mbed_official | 0:394aee574ebb | 89 | 2. If using Keil MDK, make sure you have a license installed. [MDK-Lite](http://www.keil.com/arm/mdk.asp) has a 32KB restriction on code size. |