HEXIWEAR Battery driver and example.

Dependencies:   Hexi_OLED_SSD1351

Committer:
fredlak
Date:
Sat Oct 29 17:13:31 2016 +0000
Revision:
0:579e15da3834
Hexiwear battery driver for mbed

Who changed what in which revision?

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