Programma Siren

Committer:
Wonderjack996
Date:
Fri Apr 06 10:57:42 2018 +0000
Revision:
0:2bd507b775d3
Programma Siren

Who changed what in which revision?

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