Hexiware_WiFi_ESP8266_and_sensor_code

Committer:
agaikwad
Date:
Wed Mar 22 01:15:16 2017 +0000
Revision:
0:5fcbe9cb4f5b
Hexiware_WiFi_ESP8266_and_sensor_code

Who changed what in which revision?

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