Basic touch buttons example for Hexiwear

Dependencies:   Hexi_KW40Z

Committer:
cotigac
Date:
Mon Sep 19 03:50:53 2016 +0000
Revision:
2:5b025ef2835a
Parent:
0:f7ef26f17610
Small bug fix for left color

Who changed what in which revision?

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