WIZnet-IoTShield-AMM592-TCP example

Committer:
hkjung
Date:
Sat Mar 16 07:38:26 2019 +0000
Revision:
0:8f339a252825
initial release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hkjung 0:8f339a252825 1 # Getting started example for Mbed OS
hkjung 0:8f339a252825 2
hkjung 0:8f339a252825 3 This guide reviews the steps required to get Blinky with the addition of dynamic OS statistics working on an Mbed OS platform. (Note: To see a rendered example you can import into the Arm Online Compiler, please see our [quick start](https://os.mbed.com/docs/mbed-os/latest/quick-start/online-with-the-online-compiler.html#importing-the-code).)
hkjung 0:8f339a252825 4
hkjung 0:8f339a252825 5 Please install [Mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
hkjung 0:8f339a252825 6
hkjung 0:8f339a252825 7 ## Import the example application
hkjung 0:8f339a252825 8
hkjung 0:8f339a252825 9 From the command-line, import the example:
hkjung 0:8f339a252825 10
hkjung 0:8f339a252825 11 ```
hkjung 0:8f339a252825 12 mbed import mbed-os-example-blinky
hkjung 0:8f339a252825 13 cd mbed-os-example-blinky
hkjung 0:8f339a252825 14 ```
hkjung 0:8f339a252825 15
hkjung 0:8f339a252825 16 ### Now compile
hkjung 0:8f339a252825 17
hkjung 0:8f339a252825 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:
hkjung 0:8f339a252825 19
hkjung 0:8f339a252825 20 ```
hkjung 0:8f339a252825 21 mbed compile -m K64F -t ARM
hkjung 0:8f339a252825 22 ```
hkjung 0:8f339a252825 23
hkjung 0:8f339a252825 24 Your PC may take a few minutes to compile your code. At the end, you see the following result:
hkjung 0:8f339a252825 25
hkjung 0:8f339a252825 26 ```
hkjung 0:8f339a252825 27 [snip]
hkjung 0:8f339a252825 28 +----------------------------+-------+-------+------+
hkjung 0:8f339a252825 29 | Module | .text | .data | .bss |
hkjung 0:8f339a252825 30 |--------------------|-----------|----------|----------|
hkjung 0:8f339a252825 31 | [fill] | 98(+0) | 0(+0) | 2211(+0) |
hkjung 0:8f339a252825 32 | [lib]/c.a | 27835(+0) | 2472(+0) | 89(+0) |
hkjung 0:8f339a252825 33 | [lib]/gcc.a | 3168(+0) | 0(+0) | 0(+0) |
hkjung 0:8f339a252825 34 | [lib]/misc | 248(+0) | 8(+0) | 28(+0) |
hkjung 0:8f339a252825 35 | [lib]/nosys.a | 32(+0) | 0(+0) | 0(+0) |
hkjung 0:8f339a252825 36 | main.o | 924(+0) | 0(+0) | 12(+0) |
hkjung 0:8f339a252825 37 | mbed-os/components | 134(+0) | 0(+0) | 0(+0) |
hkjung 0:8f339a252825 38 | mbed-os/drivers | 56(+0) | 0(+0) | 0(+0) |
hkjung 0:8f339a252825 39 | mbed-os/features | 42(+0) | 0(+0) | 184(+0) |
hkjung 0:8f339a252825 40 | mbed-os/hal | 2087(+0) | 8(+0) | 152(+0) |
hkjung 0:8f339a252825 41 | mbed-os/platform | 3633(+0) | 260(+0) | 209(+0) |
hkjung 0:8f339a252825 42 | mbed-os/rtos | 9370(+0) | 168(+0) | 6053(+0) |
hkjung 0:8f339a252825 43 | mbed-os/targets | 9536(+0) | 12(+0) | 382(+0) |
hkjung 0:8f339a252825 44 | Subtotals | 57163(+0) | 2928(+0) | 9320(+0) |
hkjung 0:8f339a252825 45 Total Static RAM memory (data + bss): 12248(+0) bytes
hkjung 0:8f339a252825 46 Total Flash memory (text + data): 60091(+0) bytes
hkjung 0:8f339a252825 47
hkjung 0:8f339a252825 48 Image: ./BUILD/K64F/GCC_ARM/mbed-os-example-blinky.bin
hkjung 0:8f339a252825 49 ```
hkjung 0:8f339a252825 50
hkjung 0:8f339a252825 51 ### Program your board
hkjung 0:8f339a252825 52
hkjung 0:8f339a252825 53 1. Connect your Mbed device to the computer over USB.
hkjung 0:8f339a252825 54 1. Copy the binary file to the Mbed device.
hkjung 0:8f339a252825 55 1. Press the reset button to start the program.
hkjung 0:8f339a252825 56
hkjung 0:8f339a252825 57 The LED on your platform turns on and off. The main thread will additionally take a snapshot of the device's runtime statistics and display it over serial to your PC. The snapshot includes:
hkjung 0:8f339a252825 58
hkjung 0:8f339a252825 59 * System Information:
hkjung 0:8f339a252825 60 * Mbed OS Version: Will currently default to 999999
hkjung 0:8f339a252825 61 * Compiler ID
hkjung 0:8f339a252825 62 * ARM = 1
hkjung 0:8f339a252825 63 * GCC_ARM = 2
hkjung 0:8f339a252825 64 * IAR = 3
hkjung 0:8f339a252825 65 * [CPUID Register Information](#cpuid-register-information)
hkjung 0:8f339a252825 66 * [Compiler Version](#compiler-version)
hkjung 0:8f339a252825 67 * CPU Statistics
hkjung 0:8f339a252825 68 * Percentage of runtime that the device has spent awake versus in sleep
hkjung 0:8f339a252825 69 * Heap Statistics
hkjung 0:8f339a252825 70 * Current heap size
hkjung 0:8f339a252825 71 * Max heap size which refers to the largest the heap has grown to
hkjung 0:8f339a252825 72 * Thread Statistics
hkjung 0:8f339a252825 73 * Provides information on all running threads in the OS including
hkjung 0:8f339a252825 74 * Thread ID
hkjung 0:8f339a252825 75 * Thread Name
hkjung 0:8f339a252825 76 * Thread State
hkjung 0:8f339a252825 77 * Thread Priority
hkjung 0:8f339a252825 78 * Thread Stack Size
hkjung 0:8f339a252825 79 * Thread Stack Space
hkjung 0:8f339a252825 80
hkjung 0:8f339a252825 81 #### Compiler Version
hkjung 0:8f339a252825 82
hkjung 0:8f339a252825 83 | Compiler | Version Layout |
hkjung 0:8f339a252825 84 | -------- | -------------- |
hkjung 0:8f339a252825 85 | ARM | PVVbbbb (P = Major; VV = Minor; bbbb = build number) |
hkjung 0:8f339a252825 86 | GCC | VVRRPP (VV = Version; RR = Revision; PP = Patch) |
hkjung 0:8f339a252825 87 | IAR | VRRRPPP (V = Version; RRR = Revision; PPP = Patch) |
hkjung 0:8f339a252825 88
hkjung 0:8f339a252825 89 #### CPUID Register Information
hkjung 0:8f339a252825 90
hkjung 0:8f339a252825 91 | Bit Field | Field Description | Values |
hkjung 0:8f339a252825 92 | --------- | ----------------- | ------ |
hkjung 0:8f339a252825 93 |[31:24] | Implementer | 0x41 = ARM |
hkjung 0:8f339a252825 94 |[23:20] | Variant | Major revision 0x0 = Revision 0 |
hkjung 0:8f339a252825 95 |[19:16] | Architecture | 0xC = Baseline Architecture |
hkjung 0:8f339a252825 96 | | | 0xF = Constant (Mainline Architecture) |
hkjung 0:8f339a252825 97 |[15:4] | Part Number | 0xC20 = Cortex-M0 |
hkjung 0:8f339a252825 98 | | | 0xC60 = Cortex-M0+ |
hkjung 0:8f339a252825 99 | | | 0xC23 = Cortex-M3 |
hkjung 0:8f339a252825 100 | | | 0xC24 = Cortex-M4 |
hkjung 0:8f339a252825 101 | | | 0xC27 = Cortex-M7 |
hkjung 0:8f339a252825 102 | | | 0xD20 = Cortex-M23 |
hkjung 0:8f339a252825 103 | | | 0xD21 = Cortex-M33 |
hkjung 0:8f339a252825 104 |[3:0] | Revision | Minor revision: 0x1 = Patch 1 |
hkjung 0:8f339a252825 105
hkjung 0:8f339a252825 106
hkjung 0:8f339a252825 107
hkjung 0:8f339a252825 108 You can view individual examples and additional API information of the statistics collection tools at the bottom of the page in the [related links section](#related-links).
hkjung 0:8f339a252825 109
hkjung 0:8f339a252825 110
hkjung 0:8f339a252825 111 ### Output
hkjung 0:8f339a252825 112
hkjung 0:8f339a252825 113 To view the serial output you can use any terminal client of your choosing such as [PuTTY](http://www.putty.org/) or [CoolTerm](http://freeware.the-meiers.org/). Unless otherwise specified, printf defaults to a baud rate of 9600 on Mbed OS.
hkjung 0:8f339a252825 114
hkjung 0:8f339a252825 115 You can find more information on the Mbed OS configuration tools and serial communication in Mbed OS in the related [related links section](#related-links).
hkjung 0:8f339a252825 116
hkjung 0:8f339a252825 117 The output should contain the following block transmitted at the blinking LED frequency (actual values may vary depending on your target, build profile, and toolchain):
hkjung 0:8f339a252825 118
hkjung 0:8f339a252825 119 ```
hkjung 0:8f339a252825 120 =============================== SYSTEM INFO ================================
hkjung 0:8f339a252825 121 Mbed OS Version: 999999
hkjung 0:8f339a252825 122 CPU ID: 0x410fc241
hkjung 0:8f339a252825 123 Compiler ID: 2
hkjung 0:8f339a252825 124 Compiler Version: 60300
hkjung 0:8f339a252825 125 RAM0: Start 0x20000000 Size: 0x30000
hkjung 0:8f339a252825 126 RAM1: Start 0x1fff0000 Size: 0x10000
hkjung 0:8f339a252825 127 ROM0: Start 0x0 Size: 0x100000
hkjung 0:8f339a252825 128 ================= CPU STATS =================
hkjung 0:8f339a252825 129 Idle: 98% Usage: 2%
hkjung 0:8f339a252825 130 ================ HEAP STATS =================
hkjung 0:8f339a252825 131 Current heap: 1096
hkjung 0:8f339a252825 132 Max heap size: 1096
hkjung 0:8f339a252825 133 ================ THREAD STATS ===============
hkjung 0:8f339a252825 134 ID: 0x20001eac
hkjung 0:8f339a252825 135 Name: main_thread
hkjung 0:8f339a252825 136 State: 2
hkjung 0:8f339a252825 137 Priority: 24
hkjung 0:8f339a252825 138 Stack Size: 4096
hkjung 0:8f339a252825 139 Stack Space: 3296
hkjung 0:8f339a252825 140
hkjung 0:8f339a252825 141 ID: 0x20000f5c
hkjung 0:8f339a252825 142 Name: idle_thread
hkjung 0:8f339a252825 143 State: 1
hkjung 0:8f339a252825 144 Priority: 1
hkjung 0:8f339a252825 145 Stack Size: 512
hkjung 0:8f339a252825 146 Stack Space: 352
hkjung 0:8f339a252825 147
hkjung 0:8f339a252825 148 ID: 0x20000f18
hkjung 0:8f339a252825 149 Name: timer_thread
hkjung 0:8f339a252825 150 State: 3
hkjung 0:8f339a252825 151 Priority: 40
hkjung 0:8f339a252825 152 Stack Size: 768
hkjung 0:8f339a252825 153 Stack Space: 664
hkjung 0:8f339a252825 154
hkjung 0:8f339a252825 155 ```
hkjung 0:8f339a252825 156
hkjung 0:8f339a252825 157 ## Troubleshooting
hkjung 0:8f339a252825 158
hkjung 0:8f339a252825 159 If you have problems, you can review the [documentation](https://os.mbed.com/docs/latest/tutorials/debugging.html) for suggestions on what could be wrong and how to fix it.
hkjung 0:8f339a252825 160
hkjung 0:8f339a252825 161 ## Related Links
hkjung 0:8f339a252825 162
hkjung 0:8f339a252825 163 * [Mbed OS Stats API](https://os.mbed.com/docs/latest/apis/mbed-statistics.html)
hkjung 0:8f339a252825 164 * [Mbed OS Configuration](https://os.mbed.com/docs/latest/reference/configuration.html)
hkjung 0:8f339a252825 165 * [Mbed OS Serial Communication](https://os.mbed.com/docs/latest/tutorials/serial-communication.html)
hkjung 0:8f339a252825 166
hkjung 0:8f339a252825 167 ### License and contributions
hkjung 0:8f339a252825 168
hkjung 0:8f339a252825 169 The software is provided under Apache-2.0 license. Contributions to this project are accepted under the same license. Please see contributing.md for more info.
hkjung 0:8f339a252825 170
hkjung 0:8f339a252825 171 This project contains code from other projects. The original license text is included in those source files. They must comply with our license guide.