MBC004 - Ticker This example use the BusOut function with a 7-Segment Display

Committer:
leandropg
Date:
Thu Jul 12 11:16:20 2018 +0000
Revision:
0:317ba4466741
MBC004 - Ticker; This example use the BusOut function with a 7-Segment Display

Who changed what in which revision?

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