Example application for MAX1704X LiPo battery fuel gauge

Dependencies:   MAX1704X

Committer:
maclobdell
Date:
Mon Oct 09 12:54:13 2017 +0000
Revision:
0:f63374514537
initial version, haven't tested yet

Who changed what in which revision?

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