51 52 with same code

Dependencies:   MtSense07

Fork of MtConnect04S_MtSense07 by MtM+

Committer:
johnathanlyu
Date:
Fri Apr 27 10:00:21 2018 +0000
Revision:
4:4ca64a863fbf
Parent:
0:418880413158
51 52 with same code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcc6 0:418880413158 1 # Getting started with Blinky on mbed OS
bcc6 0:418880413158 2
bcc6 0:418880413158 3 This is a very simple guide, reviewing the steps required to get Blinky working on an mbed OS platform.
bcc6 0:418880413158 4
bcc6 0:418880413158 5 Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
bcc6 0:418880413158 6
bcc6 0:418880413158 7 ## Get the example application!
bcc6 0:418880413158 8
bcc6 0:418880413158 9 From the command line, import the example:
bcc6 0:418880413158 10
bcc6 0:418880413158 11 ```
bcc6 0:418880413158 12 mbed import mbed-os-example-blinky
bcc6 0:418880413158 13 cd mbed-os-example-blinky
bcc6 0:418880413158 14 ```
bcc6 0:418880413158 15
bcc6 0:418880413158 16 ### Now compile
bcc6 0:418880413158 17
bcc6 0:418880413158 18 Invoke `mbed compile` specifying the name of your platform and your favorite toolchain (`GCC_ARM`, `ARM`, `IAR`). For example, for the ARM Compiler 5:
bcc6 0:418880413158 19
bcc6 0:418880413158 20 ```
bcc6 0:418880413158 21 mbed compile -m K64F -t ARM
bcc6 0:418880413158 22 ```
bcc6 0:418880413158 23
bcc6 0:418880413158 24 Your PC may take a few minutes to compile your code. At the end you should get the following result:
bcc6 0:418880413158 25
bcc6 0:418880413158 26 ```
bcc6 0:418880413158 27 [snip]
bcc6 0:418880413158 28 +----------------------------+-------+-------+------+
bcc6 0:418880413158 29 | Module | .text | .data | .bss |
bcc6 0:418880413158 30 +----------------------------+-------+-------+------+
bcc6 0:418880413158 31 | Misc | 13939 | 24 | 1372 |
bcc6 0:418880413158 32 | core/hal | 16993 | 96 | 296 |
bcc6 0:418880413158 33 | core/rtos | 7384 | 92 | 4204 |
bcc6 0:418880413158 34 | features/FEATURE_IPV4 | 80 | 0 | 176 |
bcc6 0:418880413158 35 | frameworks/greentea-client | 1830 | 60 | 44 |
bcc6 0:418880413158 36 | frameworks/utest | 2392 | 512 | 292 |
bcc6 0:418880413158 37 | Subtotals | 42618 | 784 | 6384 |
bcc6 0:418880413158 38 +----------------------------+-------+-------+------+
bcc6 0:418880413158 39 Allocated Heap: unknown
bcc6 0:418880413158 40 Allocated Stack: unknown
bcc6 0:418880413158 41 Total Static RAM memory (data + bss): 7168 bytes
bcc6 0:418880413158 42 Total RAM memory (data + bss + heap + stack): 7168 bytes
bcc6 0:418880413158 43 Total Flash memory (text + data + misc): 43402 bytes
bcc6 0:418880413158 44 Image: .\.build\K64F\ARM\mbed-os-example-blinky.bin
bcc6 0:418880413158 45 ```
bcc6 0:418880413158 46
bcc6 0:418880413158 47 ### Program your board
bcc6 0:418880413158 48
bcc6 0:418880413158 49 1. Connect your mbed device to the computer over USB.
bcc6 0:418880413158 50 1. Copy the binary file to the mbed device .
bcc6 0:418880413158 51 1. Press the reset button to start the program.
bcc6 0:418880413158 52
bcc6 0:418880413158 53 You should see the LED of your platform turning on and off.
bcc6 0:418880413158 54
bcc6 0:418880413158 55 Congratulations if you managed to complete this test!
bcc6 0:418880413158 56
bcc6 0:418880413158 57 ## Export the project to Keil MDK and debug your application
bcc6 0:418880413158 58
bcc6 0:418880413158 59 From the command line, run the following command:
bcc6 0:418880413158 60
bcc6 0:418880413158 61 ```
bcc6 0:418880413158 62 mbed export -m K64F -i uvision
bcc6 0:418880413158 63 ```
bcc6 0:418880413158 64
bcc6 0:418880413158 65 To debug the application:
bcc6 0:418880413158 66
bcc6 0:418880413158 67 1. Start uVision.
bcc6 0:418880413158 68 1. Import the uVision project generated earlier.
bcc6 0:418880413158 69 1. Compile your application and generate an `.axf` file.
bcc6 0:418880413158 70 1. Make sure uVision is configured to debug over CMSIS-DAP (From the Project menu > Options for Target '...' > Debug tab > Use CMSIS-DAP Debugger).
bcc6 0:418880413158 71 1. Set breakpoints and start a debug session.
bcc6 0:418880413158 72
bcc6 0:418880413158 73 ![Image of uVision](img/uvision.png)
bcc6 0:418880413158 74
bcc6 0:418880413158 75 ## Troubleshooting
bcc6 0:418880413158 76
bcc6 0:418880413158 77 1. Make sure `mbed-cli` is working correctly and its version is greater than `0.8.9`
bcc6 0:418880413158 78
bcc6 0:418880413158 79 ```
bcc6 0:418880413158 80 mbed --version
bcc6 0:418880413158 81 ```
bcc6 0:418880413158 82
bcc6 0:418880413158 83 If not, you can update it easily:
bcc6 0:418880413158 84
bcc6 0:418880413158 85 ```
bcc6 0:418880413158 86 pip install mbed-cli --upgrade
bcc6 0:418880413158 87 ```
bcc6 0:418880413158 88
bcc6 0:418880413158 89 2. If using Keil MDK, make sure you have a license installed. [MDK-Lite](http://www.keil.com/arm/mdk.asp) has a 32KB restriction on code size.