mbed-os-examples
/
mbed-os-example-mbed5-cpu-stats
Example to demonstrate usage of `mbed_stats_cpu_get()` API usage
README.md@26:6561ca58e48c, 2019-10-23 (annotated)
- Committer:
- mbed_official
- Date:
- Wed Oct 23 19:02:02 2019 +0100
- Revision:
- 26:6561ca58e48c
- Parent:
- 15:86c93f5d67c4
Merge https://github.com/ARMmbed/mbed-os-example-cpu-stats
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-cpu-stats
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:3114f82feb68 | 1 | # Getting started with CPU Stats on Mbed OS |
mbed_official | 0:3114f82feb68 | 2 | |
mbed_official | 0:3114f82feb68 | 3 | This guide reviews the steps required to get CPU statistics on Mbed OS platform. |
mbed_official | 0:3114f82feb68 | 4 | |
mbed_official | 0:3114f82feb68 | 5 | Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli). |
mbed_official | 0:3114f82feb68 | 6 | |
mbed_official | 0:3114f82feb68 | 7 | ## Import the example application |
mbed_official | 0:3114f82feb68 | 8 | |
mbed_official | 0:3114f82feb68 | 9 | From the command-line, import the example: |
mbed_official | 0:3114f82feb68 | 10 | |
mbed_official | 0:3114f82feb68 | 11 | ``` |
mbed_official | 0:3114f82feb68 | 12 | mbed import mbed-os-example-cpu-stats |
mbed_official | 0:3114f82feb68 | 13 | cd mbed-os-example-cpu-stats |
mbed_official | 0:3114f82feb68 | 14 | ``` |
mbed_official | 0:3114f82feb68 | 15 | |
mbed_official | 0:3114f82feb68 | 16 | ### Now compile |
mbed_official | 0:3114f82feb68 | 17 | |
mbed_official | 0:3114f82feb68 | 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: |
mbed_official | 0:3114f82feb68 | 19 | |
mbed_official | 0:3114f82feb68 | 20 | ``` |
mbed_official | 0:3114f82feb68 | 21 | mbed compile -m K64F -t ARM |
mbed_official | 0:3114f82feb68 | 22 | ``` |
mbed_official | 0:3114f82feb68 | 23 | |
mbed_official | 0:3114f82feb68 | 24 | Your PC may take a few minutes to compile your code. At the end, you see the following result: |
mbed_official | 0:3114f82feb68 | 25 | |
mbed_official | 0:3114f82feb68 | 26 | ``` |
mbed_official | 0:3114f82feb68 | 27 | [snip] |
mbed_official | 0:3114f82feb68 | 28 | +------------------+-------+-------+------+ |
mbed_official | 0:3114f82feb68 | 29 | | Module | .text | .data | .bss | |
mbed_official | 0:3114f82feb68 | 30 | +------------------+-------+-------+------+ |
mbed_official | 0:3114f82feb68 | 31 | | [lib]\c_w.l | 11473 | 16 | 348 | |
mbed_official | 0:3114f82feb68 | 32 | | [lib]\cpprt_w.l | 36 | 0 | 0 | |
mbed_official | 0:3114f82feb68 | 33 | | [lib]\fz_wm.l | 18 | 0 | 0 | |
mbed_official | 0:3114f82feb68 | 34 | | [lib]\m_wm.l | 48 | 0 | 0 | |
mbed_official | 0:3114f82feb68 | 35 | | anon$$obj.o | 32 | 0 | 1024 | |
mbed_official | 0:3114f82feb68 | 36 | | main.o | 530 | 8 | 0 | |
mbed_official | 0:3114f82feb68 | 37 | | mbed-os\drivers | 165 | 0 | 0 | |
mbed_official | 0:3114f82feb68 | 38 | | mbed-os\events | 2139 | 8 | 1568 | |
mbed_official | 0:3114f82feb68 | 39 | | mbed-os\features | 132 | 0 | 304 | |
mbed_official | 0:3114f82feb68 | 40 | | mbed-os\hal | 1910 | 34 | 128 | |
mbed_official | 0:3114f82feb68 | 41 | | mbed-os\platform | 3695 | 104 | 604 | |
mbed_official | 0:3114f82feb68 | 42 | | mbed-os\rtos | 17302 | 2310 | 4592 | |
mbed_official | 0:3114f82feb68 | 43 | | mbed-os\targets | 10707 | 112 | 324 | |
mbed_official | 0:3114f82feb68 | 44 | | Subtotals | 48187 | 2592 | 8892 | |
mbed_official | 0:3114f82feb68 | 45 | +------------------+-------+-------+------+ |
mbed_official | 0:3114f82feb68 | 46 | Total Static RAM memory (data + bss): 11484 bytes |
mbed_official | 0:3114f82feb68 | 47 | Total Flash memory (text + data): 50779 bytes |
mbed_official | 0:3114f82feb68 | 48 | |
mbed_official | 0:3114f82feb68 | 49 | Image: .\BUILD\K64F\ARM\mbed-os-example-cpu-stats.bin |
mbed_official | 0:3114f82feb68 | 50 | |
mbed_official | 0:3114f82feb68 | 51 | ``` |
mbed_official | 0:3114f82feb68 | 52 | |
mbed_official | 0:3114f82feb68 | 53 | ### Program your board |
mbed_official | 0:3114f82feb68 | 54 | |
mbed_official | 0:3114f82feb68 | 55 | 1. Connect your Mbed device to the computer over USB. |
mbed_official | 0:3114f82feb68 | 56 | 1. Copy the binary file to the Mbed device. |
mbed_official | 0:3114f82feb68 | 57 | 1. Press the reset button to start the program. |
mbed_official | 15:86c93f5d67c4 | 58 | |
mbed_official | 15:86c93f5d67c4 | 59 | ### License and contributions |
mbed_official | 15:86c93f5d67c4 | 60 | 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. |
mbed_official | 15:86c93f5d67c4 | 61 | |
mbed_official | 15:86c93f5d67c4 | 62 | This project contains code from other projects. The original license text is included in those source files. They must comply with our license guide |