mbed-os-example-blinky for ST B-L475E-IOT01A board.

Committer:
sorayut
Date:
Thu Nov 28 13:18:36 2019 +0000
Revision:
0:2611c221737b
ST IoT Node Mbed OS LED Blinky

Who changed what in which revision?

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