ManualControl

Dependencies:   TPixy-Interface

Fork of MbedOS_Robot_Team by ECE4333 - 2018 - Ahmed & Brandon

Committer:
asobhy
Date:
Tue Apr 10 20:54:37 2018 +0000
Branch:
ManualControl
Revision:
29:83c103d12078
Parent:
0:a355e511bc5d
ManualControl

Who changed what in which revision?

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