finds I2C slaves on BUS

Committer:
andcor02
Date:
Mon Oct 09 09:50:19 2017 +0000
Revision:
0:4241a76032ad
test and find I2C slaves on BUS

Who changed what in which revision?

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