You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains a collection of Mbed TLS example applications based on Mbed OS. Each subdirectory contains a separate example meant for building as an executable.
4
+
The example project is part of the [Arm Mbed OS Official Examples](https://os.mbed.com/code/). This repository contains a collection of Mbed TLS example applications based on Mbed OS. Each subdirectory contains a separate example meant for building as an executable.
5
5
6
6
# Getting started
7
7
8
8
## Required hardware
9
-
* Any Mbed OS capable development board such as those listed [here](https://os.mbed.com/platforms/), which have an entropy source integrated into Mbed TLS. The single example that does not need an entropy source is `hashing`. The `tls-client` example should also have a network interface supported on your board.
10
-
* A micro-USB cable.
9
+
* Any Mbed OS capable development board such as those listed [here](https://os.mbed.com/platforms/), which have an entropy source integrated into Mbed TLS. The single example that does not need an entropy source is `hashing`. To use the `tls-client` example you should also have a network interface supported on your board.
11
10
12
11
If your board has no hardware entropy source or its entropy source is not integrated with Mbed TLS, but you want to try these examples anyway, then you may want to consider compiling Mbed TLS without real entropy sources.
13
12
14
13
*Warning!* Without entropy sources Mbed TLS does not provide any security whatsoever. If you still want to compile Mbed TLS without entropy sources, then consult the section "How to test without entropy sources" in the Mbed TLS Porting Guide.
15
14
16
15
## Required software
17
-
*[Mbed CLI](https://github.com/ARMmbed/mbed-cli) - to build the example program. To learn how to build Mbed OS applications with Mbed CLI, see the [user guide](https://github.com/ARMmbed/mbed-cli/blob/master/README.md)
18
-
*[Serial port monitor](https://os.mbed.com/handbook/SerialPC#host-interface-and-terminal-applications).
16
+
17
+
*[Mbed CLI](https://github.com/ARMmbed/mbed-cli) or [Mbed CLI 2](https://github.com/ARMmbed/mbed-tools). This will be used to configure and build the project.
19
18
20
19
An alternative to Mbed CLI is to use the [Mbed Online Compiler](https://os.mbed.com/compiler/). In this case, you need to import the example projects from [Mbed developer](https://os.mbed.com/) to your Mbed Online Compiler session using the links below:
Starting with version 6.5, Mbed OS uses Mbed CLI 2. It uses Ninja as a build system, and CMake to generate the build environment and manage the build process in a compiler-independent manner. If you are working with Mbed OS version prior to 6.5 then check the section [Mbed CLI 1](#mbed-cli-1).
1. Open a command line tool and navigate to one of the project’s subdirectories.
36
43
37
-
1. Update `mbed-os` sources using the `mbed deploy` command.
44
+
1. Update the source tree:
38
45
39
-
1. Build the application by selecting the board and build toolchain using the command `mbed compile -m K64F -t GCC_ARM`. mbed-cli builds a binary file under the project’s `BUILD` directory.
46
+
* Mbed CLI 2
47
+
```bash
48
+
$ mbed-tools deploy
49
+
```
50
+
51
+
* Mbed CLI 1
52
+
```bash
53
+
$ mbed deploy
54
+
```
40
55
41
-
1. Connect the FRDM-K64F to the computer with the micro-USB cable, being careful to use the **OpenSDA** connector on the target board. The board is listed as a mass-storage device.
56
+
1. Connect a USB cable between the USB port on the board and the host computer.
57
+
1. Run the following command to build the example project, program the microcontroller flash memory, and open a serial terminal to the device:
42
58
43
-
1. Drag the binary `BUILD/K64F/GCC_ARM/<EXAMPLE>.bin` to the board to flash the application.
59
+
* Mbed CLI 2
44
60
45
-
1. The board is automatically programmed with the new binary. A flashing LED on it indicates that it is still working. When the LED stops blinking, the board is ready to work.
You can manually copy the binary to the target, which gets mounted on the host computer through USB, rather than using the `--flash` option.
81
+
82
+
You can also open a serial terminal separately, as explained below, rather than using the `--sterm` option.
83
+
49
84
## Monitoring the application
50
85
51
86
Please browse the subdirectories for specific documentation.
@@ -54,11 +89,26 @@ Please browse the subdirectories for specific documentation.
54
89
* [hashing](./hashing/README.md): performs hashing of a buffer with SHA-256 using various APIs.
55
90
* [tls-client](./tls-client/README.md): downloads a file from an HTTPS server (os.mbed.com) and looks fora specific stringin that file.
56
91
57
-
The application prints debug messages over the serial port, so you can monitor its activity with a serial terminal emulator. Start the [serial terminal emulator](https://os.mbed.com/handbook/Terminals) and connect to the [virtual serial port](https://os.mbed.com/handbook/SerialPC#host-interface-and-terminal-applications) presented by your board. Use the following settings:
92
+
The application prints debug messages over the serial port, so you can monitor its activity with a
93
+
serial terminal emulator. The default serial baudrate has been set to 9600 for these examples.
94
+
If not using the `--sterm` option when flashing, have a client open and connected to board. You may use:
58
95
59
-
* 9600 baud.
60
-
* 8N1.
61
-
* No flow control.
96
+
- Mbed CLI 2
97
+
```bash
98
+
$ mbed-tools sterm
99
+
```
100
+
101
+
- Mbed CLI 1
102
+
```bash
103
+
$ mbed sterm
104
+
```
105
+
106
+
- [Tera Term](https://ttssh2.osdn.jp/index.html.en) for Windows
107
+
108
+
- screen or minicom for Linux
109
+
```bash
110
+
$ screen /dev/serial/<your board> 9600
111
+
```
62
112
63
113
After pressing the **RESET** button on the board, you should be able to observe the application's output.
0 commit comments