Lチカ+シリアル出力

Committer:
jksoft
Date:
Wed Jan 03 07:43:46 2018 +0000
Revision:
0:c2c4a841c8f4
????????

Who changed what in which revision?

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