Arduboy lib for NRF and mbed

Dependencies:   Adafruit_GFX

Committer:
lmayencou
Date:
Tue Dec 27 11:27:14 2016 +0000
Revision:
0:2b6d7af79c9c
first publish

Who changed what in which revision?

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