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