dsfsdfsdfsdfsdfsdf

Dependencies:   sd-driver

Committer:
Hagrid
Date:
Wed Feb 21 14:59:09 2018 +0000
Revision:
0:5ba1b9a71373
sadasdfsdfsdf

Who changed what in which revision?

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