Future Electronics
/
sequana-rgb-led-example
Example program to blink RGB LEDs on Sequana board in a rotating pattern.
README.md@2:a83100cd9c9a, 2019-03-04 (annotated)
- Committer:
- lru
- Date:
- Mon Mar 04 14:15:06 2019 +0000
- Revision:
- 2:a83100cd9c9a
- Parent:
- 0:da2de84c3c04
Updated color selection algorithm
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lru | 0:da2de84c3c04 | 1 | # Getting started with Sequana RGB LED example on mbed OS |
lru | 0:da2de84c3c04 | 2 | |
lru | 0:da2de84c3c04 | 3 | This guide reviews the steps required to get exmple program working on Sequana platform. |
lru | 0:da2de84c3c04 | 4 | |
lru | 0:da2de84c3c04 | 5 | |
lru | 0:da2de84c3c04 | 6 | Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli). |
lru | 0:da2de84c3c04 | 7 | |
lru | 0:da2de84c3c04 | 8 | ## Import the example application |
lru | 0:da2de84c3c04 | 9 | |
lru | 0:da2de84c3c04 | 10 | From the command-line, import the example: |
lru | 0:da2de84c3c04 | 11 | |
lru | 0:da2de84c3c04 | 12 | ``` |
lru | 0:da2de84c3c04 | 13 | mbed import https://github.com/lrusinowicz/sequana-rgb-led-example |
lru | 0:da2de84c3c04 | 14 | cd sequana-rgb-led-example |
lru | 0:da2de84c3c04 | 15 | ``` |
lru | 0:da2de84c3c04 | 16 | |
lru | 0:da2de84c3c04 | 17 | ### Now compile |
lru | 0:da2de84c3c04 | 18 | |
lru | 0:da2de84c3c04 | 19 | Invoke `mbed compile`, and specify the name of your platform and your favorite toolchain (`GCC_ARM`, `ARM`, `IAR`). For example, for GCC: |
lru | 0:da2de84c3c04 | 20 | |
lru | 0:da2de84c3c04 | 21 | ``` |
lru | 0:da2de84c3c04 | 22 | mbed target FUTURE_SEQUANA |
lru | 0:da2de84c3c04 | 23 | mbed toolchain GCC_ARM |
lru | 0:da2de84c3c04 | 24 | mbed compile |
lru | 0:da2de84c3c04 | 25 | ``` |
lru | 0:da2de84c3c04 | 26 | |
lru | 0:da2de84c3c04 | 27 | Your PC may take a few minutes to compile your code. At the end, you see the following result: |
lru | 0:da2de84c3c04 | 28 | |
lru | 0:da2de84c3c04 | 29 | ``` |
lru | 0:da2de84c3c04 | 30 | [snip] |
lru | 0:da2de84c3c04 | 31 | | Module | .text | .data | .bss | |
lru | 0:da2de84c3c04 | 32 | |----------------------------|-----------|----------|----------| |
lru | 0:da2de84c3c04 | 33 | | [fill] | 176(+0) | 13(+0) | 33(+0) | |
lru | 0:da2de84c3c04 | 34 | | [lib]\c.a | 22147(+0) | 2472(+0) | 89(+0) | |
lru | 0:da2de84c3c04 | 35 | | [lib]\gcc.a | 3112(+0) | 0(+0) | 0(+0) | |
lru | 0:da2de84c3c04 | 36 | | [lib]\misc | 208(+0) | 12(+0) | 28(+0) | |
lru | 0:da2de84c3c04 | 37 | | [misc] | 48(+0) | 56(+0) | 0(+0) | |
lru | 0:da2de84c3c04 | 38 | | bd2808-driver\BD2808.o | 270(+0) | 46(+0) | 4(+0) | |
lru | 0:da2de84c3c04 | 39 | | bd2808-driver\bd2808_hal.o | 1435(+0) | 1444(+0) | 24(+0) | |
lru | 0:da2de84c3c04 | 40 | | main.o | 602(+0) | 24(+0) | 202(+0) | |
lru | 0:da2de84c3c04 | 41 | | mbed-os\cmsis | 1033(+0) | 0(+0) | 84(+0) | |
lru | 0:da2de84c3c04 | 42 | | mbed-os\drivers | 1245(+0) | 0(+0) | 0(+0) | |
lru | 0:da2de84c3c04 | 43 | | mbed-os\hal | 2094(+0) | 4(+0) | 68(+0) | |
lru | 0:da2de84c3c04 | 44 | | mbed-os\platform | 5005(+0) | 260(+0) | 242(+0) | |
lru | 0:da2de84c3c04 | 45 | | mbed-os\rtos | 8667(+0) | 168(+0) | 5969(+0) | |
lru | 0:da2de84c3c04 | 46 | | mbed-os\targets | 11169(+0) | 953(+0) | 1125(+0) | |
lru | 0:da2de84c3c04 | 47 | | Subtotals | 57211(+0) | 5452(+0) | 7868(+0) | |
lru | 0:da2de84c3c04 | 48 | Total Static RAM memory (data + bss): 13320(+0) bytes |
lru | 0:da2de84c3c04 | 49 | Total Flash memory (text + data): 62663(+0) bytes |
lru | 0:da2de84c3c04 | 50 | |
lru | 0:da2de84c3c04 | 51 | Image: .\BUILD\FUTURE_SEQUANA\GCC_ARM\sequana-rgb-led-example.hex |
lru | 0:da2de84c3c04 | 52 | ``` |
lru | 0:da2de84c3c04 | 53 | |
lru | 0:da2de84c3c04 | 54 | ### Program your board |
lru | 0:da2de84c3c04 | 55 | |
lru | 0:da2de84c3c04 | 56 | 1. Connect your Sequana board to the computer over USB. |
lru | 0:da2de84c3c04 | 57 | 2. Copy the hex file to the mbed device (DAPLINK removable storage device). |
lru | 0:da2de84c3c04 | 58 | 3. Your program will start automaticaly after programming has fihished. |
lru | 0:da2de84c3c04 | 59 | |
lru | 0:da2de84c3c04 | 60 | The LEDs on your platform will blink in a rotating pattern. |
lru | 0:da2de84c3c04 | 61 | |
lru | 0:da2de84c3c04 | 62 | ## Troubleshooting |
lru | 0:da2de84c3c04 | 63 | |
lru | 0:da2de84c3c04 | 64 | 1. Make sure `mbed-cli` is working correctly and its version is `>=1.8.2` |
lru | 0:da2de84c3c04 | 65 | |
lru | 0:da2de84c3c04 | 66 | ``` |
lru | 0:da2de84c3c04 | 67 | mbed --version |
lru | 0:da2de84c3c04 | 68 | ``` |
lru | 0:da2de84c3c04 | 69 | |
lru | 0:da2de84c3c04 | 70 | If not, you can update it: |
lru | 0:da2de84c3c04 | 71 | |
lru | 0:da2de84c3c04 | 72 | ``` |
lru | 0:da2de84c3c04 | 73 | pip install mbed-cli --upgrade |
lru | 0:da2de84c3c04 | 74 | ``` |
lru | 0:da2de84c3c04 | 75 | |
lru | 0:da2de84c3c04 | 76 | 2. This example requires bed OS [platform fix](https://github.com/ARMmbed/mbed-os/pull/9157) that will likely be included in 5.11.1 release. Until then, the example refers to proper commit on the master branch. |