SPI Test (Slave)

Committer:
ryood
Date:
Fri May 19 01:26:32 2017 +0000
Revision:
1:7090a42ac6e0
Parent:
0:317ca984456c
work well

Who changed what in which revision?

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