TestingCrew / Mbed OS TechBreakThrough

Fork of TechBreakThrough by Mac Lobdell

Committer:
maclobdell
Date:
Tue Jan 02 19:31:52 2018 +0000
Revision:
0:181267edd351
test

Who changed what in which revision?

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