Testing motor functions

Dependencies:   HIDScope MODSERIAL QEI mbed

Committer:
hiz
Date:
Thu Oct 12 14:21:37 2017 +0000
Revision:
0:e6749361c960
First public, simple motor control

Who changed what in which revision?

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