Display pot. value

Fork of IPI_Singapore_Workshop by IPI Singapore Workshop

Committer:
alansim
Date:
Wed Nov 22 07:59:57 2017 +0000
Revision:
2:10f92fa42985
Parent:
0:4ebd37a7a0ac
Revision Commit

Who changed what in which revision?

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