Example of using the Enigma encryption library.

Dependencies:   Enigma

Committer:
hudakz
Date:
Tue Sep 24 16:58:11 2019 +0000
Revision:
3:83f583d06005
Parent:
0:3381509d20af
Example of using the Enigma encryption library.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hudakz 0:3381509d20af 1 # Getting started example for Mbed OS
hudakz 0:3381509d20af 2
hudakz 0:3381509d20af 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).)
hudakz 0:3381509d20af 4
hudakz 0:3381509d20af 5 Please install [Mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
hudakz 0:3381509d20af 6
hudakz 0:3381509d20af 7 ## Import the example application
hudakz 0:3381509d20af 8
hudakz 0:3381509d20af 9 From the command-line, import the example:
hudakz 0:3381509d20af 10
hudakz 0:3381509d20af 11 ```
hudakz 0:3381509d20af 12 mbed import mbed-os-example-blinky
hudakz 0:3381509d20af 13 cd mbed-os-example-blinky
hudakz 0:3381509d20af 14 ```
hudakz 0:3381509d20af 15
hudakz 0:3381509d20af 16 ### Now compile
hudakz 0:3381509d20af 17
hudakz 0:3381509d20af 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:
hudakz 0:3381509d20af 19
hudakz 0:3381509d20af 20 ```
hudakz 0:3381509d20af 21 mbed compile -m K64F -t ARM
hudakz 0:3381509d20af 22 ```
hudakz 0:3381509d20af 23
hudakz 0:3381509d20af 24 Your PC may take a few minutes to compile your code. At the end, you see the following result:
hudakz 0:3381509d20af 25
hudakz 0:3381509d20af 26 ```
hudakz 0:3381509d20af 27 [snip]
hudakz 0:3381509d20af 28
hudakz 0:3381509d20af 29 Image: ./BUILD/K64F/GCC_ARM/mbed-os-example-blinky.bin
hudakz 0:3381509d20af 30 ```
hudakz 0:3381509d20af 31
hudakz 0:3381509d20af 32 ### Program your board
hudakz 0:3381509d20af 33
hudakz 0:3381509d20af 34 1. Connect your Mbed device to the computer over USB.
hudakz 0:3381509d20af 35 1. Copy the binary file to the Mbed device.
hudakz 0:3381509d20af 36 1. Press the reset button to start the program.
hudakz 0:3381509d20af 37
hudakz 0:3381509d20af 38 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:
hudakz 0:3381509d20af 39
hudakz 0:3381509d20af 40 * System Information:
hudakz 0:3381509d20af 41 * Mbed OS Version: Will currently default to 999999
hudakz 0:3381509d20af 42 * Compiler ID
hudakz 0:3381509d20af 43 * ARM = 1
hudakz 0:3381509d20af 44 * GCC_ARM = 2
hudakz 0:3381509d20af 45 * IAR = 3
hudakz 0:3381509d20af 46 * [CPUID Register Information](#cpuid-register-information)
hudakz 0:3381509d20af 47 * [Compiler Version](#compiler-version)
hudakz 0:3381509d20af 48 * CPU Statistics
hudakz 0:3381509d20af 49 * Percentage of runtime that the device has spent awake versus in sleep
hudakz 0:3381509d20af 50 * Heap Statistics
hudakz 0:3381509d20af 51 * Current heap size
hudakz 0:3381509d20af 52 * Max heap size which refers to the largest the heap has grown to
hudakz 0:3381509d20af 53 * Thread Statistics
hudakz 0:3381509d20af 54 * Provides information on all running threads in the OS including
hudakz 0:3381509d20af 55 * Thread ID
hudakz 0:3381509d20af 56 * Thread Name
hudakz 0:3381509d20af 57 * Thread State
hudakz 0:3381509d20af 58 * Thread Priority
hudakz 0:3381509d20af 59 * Thread Stack Size
hudakz 0:3381509d20af 60 * Thread Stack Space
hudakz 0:3381509d20af 61
hudakz 0:3381509d20af 62 #### Compiler Version
hudakz 0:3381509d20af 63
hudakz 0:3381509d20af 64 | Compiler | Version Layout |
hudakz 0:3381509d20af 65 | -------- | -------------- |
hudakz 0:3381509d20af 66 | ARM | PVVbbbb (P = Major; VV = Minor; bbbb = build number) |
hudakz 0:3381509d20af 67 | GCC | VVRRPP (VV = Version; RR = Revision; PP = Patch) |
hudakz 0:3381509d20af 68 | IAR | VRRRPPP (V = Version; RRR = Revision; PPP = Patch) |
hudakz 0:3381509d20af 69
hudakz 0:3381509d20af 70 #### CPUID Register Information
hudakz 0:3381509d20af 71
hudakz 0:3381509d20af 72 | Bit Field | Field Description | Values |
hudakz 0:3381509d20af 73 | --------- | ----------------- | ------ |
hudakz 0:3381509d20af 74 |[31:24] | Implementer | 0x41 = ARM |
hudakz 0:3381509d20af 75 |[23:20] | Variant | Major revision 0x0 = Revision 0 |
hudakz 0:3381509d20af 76 |[19:16] | Architecture | 0xC = Baseline Architecture |
hudakz 0:3381509d20af 77 | | | 0xF = Constant (Mainline Architecture) |
hudakz 0:3381509d20af 78 |[15:4] | Part Number | 0xC20 = Cortex-M0 |
hudakz 0:3381509d20af 79 | | | 0xC60 = Cortex-M0+ |
hudakz 0:3381509d20af 80 | | | 0xC23 = Cortex-M3 |
hudakz 0:3381509d20af 81 | | | 0xC24 = Cortex-M4 |
hudakz 0:3381509d20af 82 | | | 0xC27 = Cortex-M7 |
hudakz 0:3381509d20af 83 | | | 0xD20 = Cortex-M23 |
hudakz 0:3381509d20af 84 | | | 0xD21 = Cortex-M33 |
hudakz 0:3381509d20af 85 |[3:0] | Revision | Minor revision: 0x1 = Patch 1 |
hudakz 0:3381509d20af 86
hudakz 0:3381509d20af 87
hudakz 0:3381509d20af 88
hudakz 0:3381509d20af 89 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).
hudakz 0:3381509d20af 90
hudakz 0:3381509d20af 91
hudakz 0:3381509d20af 92 ### Output
hudakz 0:3381509d20af 93
hudakz 0:3381509d20af 94 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.
hudakz 0:3381509d20af 95
hudakz 0:3381509d20af 96 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).
hudakz 0:3381509d20af 97
hudakz 0:3381509d20af 98 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):
hudakz 0:3381509d20af 99
hudakz 0:3381509d20af 100 ```
hudakz 0:3381509d20af 101 =============================== SYSTEM INFO ================================
hudakz 0:3381509d20af 102 Mbed OS Version: 999999
hudakz 0:3381509d20af 103 CPU ID: 0x410fc241
hudakz 0:3381509d20af 104 Compiler ID: 2
hudakz 0:3381509d20af 105 Compiler Version: 60300
hudakz 0:3381509d20af 106 RAM0: Start 0x20000000 Size: 0x30000
hudakz 0:3381509d20af 107 RAM1: Start 0x1fff0000 Size: 0x10000
hudakz 0:3381509d20af 108 ROM0: Start 0x0 Size: 0x100000
hudakz 0:3381509d20af 109 ================= CPU STATS =================
hudakz 0:3381509d20af 110 Idle: 98% Usage: 2%
hudakz 0:3381509d20af 111 ================ HEAP STATS =================
hudakz 0:3381509d20af 112 Current heap: 1096
hudakz 0:3381509d20af 113 Max heap size: 1096
hudakz 0:3381509d20af 114 ================ THREAD STATS ===============
hudakz 0:3381509d20af 115 ID: 0x20001eac
hudakz 0:3381509d20af 116 Name: main_thread
hudakz 0:3381509d20af 117 State: 2
hudakz 0:3381509d20af 118 Priority: 24
hudakz 0:3381509d20af 119 Stack Size: 4096
hudakz 0:3381509d20af 120 Stack Space: 3296
hudakz 0:3381509d20af 121
hudakz 0:3381509d20af 122 ID: 0x20000f5c
hudakz 0:3381509d20af 123 Name: idle_thread
hudakz 0:3381509d20af 124 State: 1
hudakz 0:3381509d20af 125 Priority: 1
hudakz 0:3381509d20af 126 Stack Size: 512
hudakz 0:3381509d20af 127 Stack Space: 352
hudakz 0:3381509d20af 128
hudakz 0:3381509d20af 129 ID: 0x20000f18
hudakz 0:3381509d20af 130 Name: timer_thread
hudakz 0:3381509d20af 131 State: 3
hudakz 0:3381509d20af 132 Priority: 40
hudakz 0:3381509d20af 133 Stack Size: 768
hudakz 0:3381509d20af 134 Stack Space: 664
hudakz 0:3381509d20af 135
hudakz 0:3381509d20af 136 ```
hudakz 0:3381509d20af 137
hudakz 0:3381509d20af 138 ## Troubleshooting
hudakz 0:3381509d20af 139
hudakz 0:3381509d20af 140 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.
hudakz 0:3381509d20af 141
hudakz 0:3381509d20af 142 ## Related Links
hudakz 0:3381509d20af 143
hudakz 0:3381509d20af 144 * [Mbed OS Stats API](https://os.mbed.com/docs/latest/apis/mbed-statistics.html)
hudakz 0:3381509d20af 145 * [Mbed OS Configuration](https://os.mbed.com/docs/latest/reference/configuration.html)
hudakz 0:3381509d20af 146 * [Mbed OS Serial Communication](https://os.mbed.com/docs/latest/tutorials/serial-communication.html)
hudakz 0:3381509d20af 147
hudakz 0:3381509d20af 148 ### License and contributions
hudakz 0:3381509d20af 149
hudakz 0:3381509d20af 150 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.
hudakz 0:3381509d20af 151
hudakz 0:3381509d20af 152 This project contains code from other projects. The original license text is included in those source files. They must comply with our license guide.