Updated Nov. 18th.

Dependencies:   SX1276Lib_modtronix

Fork of SX1276PingPong by Semtech

Committer:
AMNoll
Date:
Sun Nov 19 18:22:07 2017 +0000
Revision:
16:4051b7c16410
Updated Nov. 18th

Who changed what in which revision?

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