Template for advanced microcontrollers assignment 'DMA' 2017

Dependencies:   SimpleDMA

Committer:
wkleunen
Date:
Tue Jun 06 08:24:49 2017 +0000
Revision:
0:7006377c8a24
Initial commit

Who changed what in which revision?

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