Kévin

Dependencies:   DHT

Committer:
Souleymane93
Date:
Fri Oct 13 13:15:22 2017 +0000
Revision:
0:1090ec9f109d
Pour K?vin

Who changed what in which revision?

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