Stefan Vukcevic / Mbed 2 deprecated cantx

Dependencies:   mbed

Committer:
Tafkal
Date:
Wed Oct 18 19:26:29 2017 +0000
Revision:
0:384a18e35fb4
Eo

Who changed what in which revision?

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