Skip to content

Commit a68d01c

Browse files
committed
docs: Update documentation
Add detailed introduction and overview of the examples in README.md. Describe how the components are put together in aws-iot-example.md. Signed-off-by: Devaraj Ranganna <[email protected]>
1 parent cb47124 commit a68d01c

File tree

3 files changed

+119
-24
lines changed

3 files changed

+119
-24
lines changed

Docs/aws-iot-example.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,49 @@
11
# AWS FreeRTOS MQTT example with OTA support
22

3+
## Introduction
4+
35
This AWS FreeRTOS MQTT example demonstrates how to develop cloud connected
46
applications and update them securely by integrating the modular [FreeRTOS kernel](https://www.freertos.org/RTOS.html)
57
and [libraries](https://www.freertos.org/libraries/categories.html) and
68
utilizing hardware enforced security based on [Arm TrustZone (Armv8-M)](https://www.arm.com/technologies/trustzone-for-cortex-m).
79
This example is based on the [Corstone-300](https://developer.arm.com/Processors/Corstone-300)
810
platform.
911

12+
### Secure TLS Connection
13+
14+
Corstone platform communicates with the AWS IoT Core over a secure TLS
15+
connection. Mbed TLS running on the NSPE is used to establish the TLS
16+
connection. Mbed TLS makes use of the PSA Crypto APIs provided by TF-M for
17+
Crypto operations.
18+
19+
[PKCS#11](https://www.freertos.org/pkcs11/index.html) APIs to perform TLS
20+
client authentication and import TLS client certificate and private key into
21+
the device. PKCS#11 has been integrated with TF-M using a thin shim. In the
22+
integration, the PKCS#11 APIs invoke the appropriate PSA Secure Storage API or
23+
Cryptographic API via the shim. This ensures the keys and certificates are
24+
protected and the cryptographic operations are performed securely within the
25+
SPE of TF-M and is isolated from the kernel, libraries and applications in the
26+
Non-secure Processing Environment. Keys and certificates are securely stored.
27+
This is enabled by TF-M’s Internal Trusted Storage (ITS) and Protected Storage
28+
(PS) services. Signing during TLS client authentication is performed by TF-M’s
29+
Crypto service.
30+
31+
### Secure OTA Updates
32+
33+
FreeRTOS OTA Agent provides an OTA PAL layer for platforms to integrate and
34+
enable OTA updates. The demo integrates and OTA PAL implementation that makes
35+
use of the PSA Certified Firmware Update API implemented in TF-M. This allows
36+
Corstone-300 to receive new images from AWS IoT Core, authenticate using TF-M
37+
before deploying the image as the active image. The secure (TF-M) and the
38+
non-secure (FreeRTOS kernel and the application) images can be updated
39+
separately.
40+
41+
Every time the device boots, MCUBoot (bootloader) verifies that the image
42+
signature is valid before booting the image. Since the secure (TF-M) and the
43+
non-secure (FreeRTOS kernel and the application) images are singed separately,
44+
MCUBoot verifies that both image signatures are valid before booting. If either
45+
of the verification fails, then MCUBoot stops the booting process.
46+
1047
## Setting up Arm Virtual Hardware using Amazon Machine Images
1148

1249
Follow the instructions described in [Launch Arm Virtual Hardware Instance](setting-up-arm-virtual-hardware.md)

Docs/blinky.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# Blinky example
22

3+
## Introduction
4+
35
This blinky example demonstrates the integration of FreeRTOS kernel and
46
[TrustedFirmware-M](https://www.trustedfirmware.org/projects/tf-m/). The FreeRTOS application running on non-secure side uses
57
PSA APIs to fetch the firmware framework version of TrustedFirmware-M running
68
on the secure-side and prints it on the console. In addition, to simulate LED
79
blinking, `LED On` and `LED off` are printed onto the console at regular
810
intervals.
911

10-
# Setting up Arm Virtual Hardware using Amazon Machine Images
12+
## Setting up Arm Virtual Hardware using Amazon Machine Images
1113

1214
Follow the instructions described in [Launch Arm Virtual Hardware Instance](setting-up-arm-virtual-hardware.md)
1315
to setup your development environment.
@@ -17,12 +19,12 @@ console (either AWS-Web-Console or Local-Console) to Arm Virtual Hardware
1719
Instance. From now on, any command-line commands described in this document
1820
must be run on the console connected to Arm Virtual Hardware Instance.
1921

20-
# Setting up development environment
22+
## Setting up development environment
2123

2224
Follow the instructions described in [Setting Up your Development Environment](development-environment.md)
2325
to setup your development environment.
2426

25-
# Building the application
27+
## Building the application
2628

2729
To build the blinky example, run the following command:
2830
```bash
@@ -40,14 +42,14 @@ on AWS. If you would like to build it with the Arm GNU Toolchain (arm-none-eabi-
4042
[installed by yourself](./development-environment.md), append the extra option
4143
`--toolchain GNU` to the build command above.
4244

43-
# Running the application
45+
## Running the application
4446

4547
To run the blinky example, run the following command:
4648
```bash
4749
./Tools/scripts/run.sh blinky
4850
```
4951

50-
## Expected output
52+
### Expected output
5153

5254
```bash
5355
[INF] Starting bootloader

README.md

Lines changed: 75 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,74 @@
1-
# IoT Reference Integration for Corstone-3xx
1+
# IoT Reference Integration for Arm Corstone-3xx
22

33
## Introduction
44

55
This reference integration demonstrates how to develop cloud connected
66
applications and update them securely by integrating modular
77
[FreeRTOS kernel](https://www.freertos.org/RTOS.html) and [libraries](https://www.freertos.org/libraries/categories.html)
88
and utilizing hardware enforced security based on [Arm TrustZone (Armv8-M)](https://www.arm.com/architecture/learn-the-architecture/m-profile).
9+
10+
To utilize the hardware enforced security, this integration uses PSA Certified
11+
reference implementation [Trusted Firmware-M](https://www.trustedfirmware.org/projects/tf-m/).
12+
Trusted Firmware-M provides various Secure services such as Secure boot, Crypto, Secure Storage,
13+
Attestation and Update services meeting [PSA Certified requirements](https://www.psacertified.org/blog/psa-certified-10-security-goals-explained/).
914
This project is based on the [Corstone-300](https://developer.arm.com/Processors/Corstone-300)
1015
platform.
1116

12-
## Arm TrustZone (Armv8-M)
17+
Developers and partners can use this integration as a starting point to build
18+
FreeRTOS kernel and libraires based software stack on top of Arm Cortex-M based
19+
platforms. All the components are put together in a modular manner to make
20+
porting of this integration across platforms easy.
21+
22+
## Examples
1323

14-
TrustZone technology for Armv8-M is an optional Security Extension that is
15-
designed to provide a foundation for improved system security in a wide range
16-
of embedded applications. Follow the [link](https://developer.arm.com/documentation/100690/0201/Arm-TrustZone-technology)
17-
for more information on TrustZone technology for Armv8-M.
24+
This reference integration contains following two examples:
1825

19-
## Trusted Firmware M
26+
* [Blinky example](Docs/blinky.md)
27+
* Demonstrates FreeRTOS kernel and TF-M integration
28+
* [AWS IoT example](Docs/aws-iot-example.md)
29+
* Demonstrates [secure connectivity](#secure-tls-connection) to AWS IoT core using [Mbed TLS](#mbed-tls),
30+
[PKCS#11 PSA Shim](#pkcs11-psa-shim) and [coreMQTT-agent](https://docs.aws.amazon.com/freertos/latest/userguide/coremqtt-agent.html)
31+
library. In addition, [secure OTA](#secure-ota-updates) using [OTA agent](https://freertos.org/ota/index.html)
32+
and [AWS OTA PAL PSA implementation](#aws-ota-pal-psa-implementation).
33+
34+
### Secure TLS Connection
35+
36+
Corstone platform communicates with the AWS IoT Core over a secure TLS
37+
connection. Mbed TLS running on the NSPE is used to establish the TLS
38+
connection. Mbed TLS makes use of the PSA Crypto APIs provided by TF-M for
39+
Crypto operations.
40+
41+
[PKCS#11](https://www.freertos.org/pkcs11/index.html) APIs to perform TLS
42+
client authentication and import TLS client certificate and private key into
43+
the device. PKCS#11 has been integrated with TF-M using a thin shim. In the
44+
integration, the PKCS#11 APIs invoke the appropriate PSA Secure Storage API or
45+
Cryptographic API via the shim. This ensures the keys and certificates are
46+
protected and the cryptographic operations are performed securely within the
47+
SPE of TF-M and is isolated from the kernel, libraries and applications in the
48+
Non-secure Processing Environment. Keys and certificates are securely stored.
49+
This is enabled by TF-M’s Internal Trusted Storage (ITS) and Protected Storage
50+
(PS) services. Signing during TLS client authentication is performed by TF-M’s
51+
Crypto service.
52+
53+
### Secure OTA Updates
54+
55+
FreeRTOS OTA Agent provides an OTA PAL layer for platforms to integrate and
56+
enable OTA updates. The demo integrates and OTA PAL implementation that makes
57+
use of the PSA Certified Firmware Update API implemented in TF-M. This allows
58+
Corstone-300 to receive new images from AWS IoT Core, authenticate using TF-M
59+
before deploying the image as the active image. The secure (TF-M) and the
60+
non-secure (FreeRTOS kernel and the application) images can be updated
61+
separately.
62+
63+
Every time the device boots, MCUBoot (bootloader) verifies that the image
64+
signature is valid before booting the image. Since the secure (TF-M) and the
65+
non-secure (FreeRTOS kernel and the application) images are singed separately,
66+
MCUBoot verifies that both image signatures are valid before booting. If either
67+
of the verification fails, then MCUBoot stops the booting process.
68+
69+
## Software Components
70+
71+
### Trusted Firmware M
2072

2173
Trusted Firmware-M (TF-M) implements the Secure Processing Environment (SPE)
2274
for Armv8-M, Armv8.1-M architectures (e.g. the Cortex-M33, Cortex-M23,
@@ -26,10 +78,20 @@ guidelines, enabling chips, Real Time Operating Systems and devices to become
2678
PSA Certified. Follow the [link](https://tf-m-user-guide.trustedfirmware.org/introduction/readme.html)
2779
for more information on Trusted Firmware M.
2880

29-
## PKCS#11 PSA Shim
81+
### Mbed TLS
82+
83+
Project implements cryptographic primitives, X.509 certificate manipulation and
84+
the SSL/TLS and DTLS protocols. The project provides reference implementation
85+
of [PSA Cryptography API Specification](https://developer.arm.com/documentation/ihi0086/b)
86+
by supporting the cryptographic operations via. PSA Crypto APIs. Follow the
87+
[link](https://www.trustedfirmware.org/projects/mbed-tls/) for more information
88+
on Mbed TLS.
89+
90+
### PKCS11 PSA Shim
3091

31-
PKCS#11 PSA shim layer provides a reference implementation of PKCS#11 API based
32-
on [Platform Security Architecture](https://www.arm.com/architecture/psa-certified)
92+
[PKCS#11 PSA shim layer](https://github.com/Linaro/freertos-pkcs11-psa.git)
93+
provides a reference implementation of PKCS#11 API based on
94+
[Platform Security Architecture](https://www.arm.com/architecture/psa-certified)
3395
API.
3496

3597
This shim layer maps the PKCS#11 APIs to PSA Cryptography and Storage APIs
@@ -39,22 +101,16 @@ Certificate objects and key objects are protected by PSA secure service.
39101
By default, the device private/public keys are persistent while the code verify
40102
key is volatile.
41103

42-
## AWS OTA PAL PSA implementation
104+
### AWS OTA PAL PSA implementation
43105

44-
Implementation of AWS OTA PAL based on [Platform Security Architecture](https://www.arm.com/architecture/psa-certified)
106+
Implementation of [AWS OTA PAL](https://github.com/Linaro/freertos-ota-pal-psa.git)
107+
based on [Platform Security Architecture](https://www.arm.com/architecture/psa-certified)
45108
API.
46109

47110
This implementation maps the AWS OTA PAL APIs to the PSA Firmware Update and
48111
PSA Cryptography APIs. The writing, verification and activation of the update
49112
image are protected by the PSA secure services.
50113

51-
## Examples
52-
53-
This reference integration contains following two examples:
54-
55-
* [Blinky example](Docs/blinky.md)
56-
* [AWS IoT example](Docs/aws-iot-example.md)
57-
58114
## Contributing
59115

60116
See [CONTRIBUTING](CONTRIBUTING.md) for more information.

0 commit comments

Comments
 (0)