Demonstrates how to import classes and libraries into a simple application. The original Mbed OS 5 wifi example has been imported and configured for the ST IDW04A1

Dependencies:   wifi-x-nucleo-idw01m1

Committer:
timo_k2
Date:
Wed May 20 15:57:51 2020 +0000
Revision:
0:ce9de1636bd7
Demonstrates how to import classes and libraries to a simple application. The original mbed OS5 wifi -example library has been imported and configured for the ST IDW04A1 Wifi-module.

Who changed what in which revision?

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