Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
periodic update 11/18/20 14:34 PDT
Browse files Browse the repository at this point in the history
  • Loading branch information
robhath committed Nov 18, 2020
1 parent 8de9548 commit 130ad25
Show file tree
Hide file tree
Showing 64 changed files with 2,191 additions and 500 deletions.
29 changes: 14 additions & 15 deletions doc_source/portingguide/afr-porting-mqtt.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Configuring the MQTT library for testing<a name="afr-porting-mqtt"></a>
# Configuring the coreMQTT library for testing<a name="afr-porting-mqtt"></a>

Devices on the edge can use the MQTT protocol to communicate with the AWS Cloud\. AWS IoT hosts an MQTT broker that sends and receives messages to and from connected devices at the edge\.

The MQTT library implements the MQTT protocol for devices running FreeRTOS\. The MQTT library does not need to be ported, but your device's test project must pass all MQTT tests for qualification\. For more information, see [FreeRTOS MQTT Library](https://docs.aws.amazon.com/freertos/latest/userguide/freertos-lib-cloud-mqtt.html) in the FreeRTOS User Guide\.
The coreMQTT library implements the MQTT protocol for devices running FreeRTOS\. The coreMQTT library doesn't need to be ported, but your device's test project must pass all MQTT tests for qualification\. For more information, see [coreMQTT Library](https://docs.aws.amazon.com/freertos/latest/userguide/coremqtt.html) in the *FreeRTOS User Guide\.*

## Prerequisites<a name="testing-prereqs-mqtt"></a>

To set up the FreeRTOS MQTT library tests, you need the following:
To set up the coreMQTT library tests, you need the following:
+ A port of the TLS library\.

For information about porting the TLS library to your platform, see [Porting the TLS library](afr-porting-tls.md)\.
Expand All @@ -15,23 +15,22 @@ If you are using an IDE to build test projects, you need to set up your library

## Setting up the IDE test project<a name="testing-ide-mqtt"></a>

**To set up the MQTT library in the IDE project**
+ Add all of the test source files in `freertos/libraries/c_sdk/standard/mqtt` and its subdirectories to the `aws_tests` IDE project\.
**To set up the coreMQTT library in the IDE project**

## Configuring the `CMakeLists.txt` file<a name="testing-cmake-mqtt"></a>
1. Add all the library source files in the `freertos/libraries/coreMQTT/source` directory and its subdirectories to the `aws_tests` IDE project\.

If you are using CMake to build your test project, you need to define a portable layer target for the library in your CMake list file\.
1. Add all the source files for the network layer \(used in the tests\) in the `freertos/libraries/abstractions/transport` directory and `secure_sockets` subdirectory to the `aws_tests` IDE project\.

To define a library's portable layer target in `CMakeLists.txt`, follow the instructions in [FreeRTOS portable layers](cmake-template.md#cmake-portable)\.
1. Add a `core_mqtt_config.h` file, required for building the coreMQTT library, to the config files directory at `freertos/vendors/vendor/boards/board/aws_tests/config_files`\.

The `CMakeLists.txt` template list file under `freertos/vendors/vendor/boards/board/CMakeLists.txt` includes example portable layer target definitions\. You can uncomment the definition for the library that you are porting, and modify it to fit your platform\.
1. Add the test source file at `freertos/tests/integration_test/core_mqtt_system.c` to the `aws_tests` IDE project\.

## Setting up your local testing environment<a name="testing-local-mqtt"></a>

After you set up the library in the IDE project, you need to configure some other files for testing\.
After you set up the library in the IDE project, you need to configure other files for testing\.

**To configure the source and header files for the MQTT tests**
+ To enable the MQTT tests, open `freertos/vendors/vendor/boards/board/aws_tests/config_files/aws_test_runner_config.h`, and set the `testrunnerFULL_MQTTv4_ENABLED ` macro to `1`\.
+ To enable the MQTT tests, open `freertos/vendors/vendor-name/boards/board-name/aws_tests/config_files/aws_test_runner_config.h`, and set the `testrunnerFULL_CORE_MQTT_AWS_IOT_ENABLED` macro to `1`\.

## Running the tests<a name="testing-run-mqtt"></a>

Expand All @@ -41,12 +40,12 @@ After you set up the library in the IDE project, you need to configure some othe

1. Check the test results in the UART console\. If all tests pass, then testing is complete\.

## Validation<a name="w3aac11c33c19"></a>
## Validation<a name="validation-mqtt"></a>

To officially qualify a device for FreeRTOS, you need to validate the device's ported source code with AWS IoT Device Tester\. Follow the instructions in [ Using AWS IoT Device Tester for FreeRTOS](https://docs.aws.amazon.com/freertos/latest/userguide/device-tester-for-freertos-ug.html) in the FreeRTOS User Guide to set up Device Tester for port validation\. To test a specific library's port, the correct test group must be enabled in the `device.json` file in the Device Tester `configs` folder\.

After you finish setting up the FreeRTOS MQTT library for your device, you can start porting the OTA agent library\. See [Porting the OTA library](afr-porting-ota.md) for instructions\.
After you set up the coreMQTT library for your device, you can start porting the OTA agent library\. See [Porting the OTA library](afr-porting-ota.md) for instructions\.

If your device does not support OTA functionality, you can start porting the Bluetooth Low Energy library\. See [Porting the Bluetooth Low Energy library](afr-porting-ble.md) for instructions\.
If your device doesn't support OTA functionality, you can start porting the Bluetooth Low Energy library\. See [Porting the Bluetooth Low Energy library](afr-porting-ble.md) for instructions\.

If your device does not support OTA and Bluetooth Low Energy functionality, then you are finished porting and can start the FreeRTOS qualification process\. See the [FreeRTOS Qualification Guide](https://docs.aws.amazon.com/freertos/latest/qualificationguide/) for more information\.
If your device doesn't support OTA and Bluetooth Low Energy functionality, then you are finished porting and can start the FreeRTOS qualification process\. See the [FreeRTOS Qualification Guide](https://docs.aws.amazon.com/freertos/latest/qualificationguide/) for more information\.
22 changes: 11 additions & 11 deletions doc_source/portingguide/afr-porting-pkcs.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Porting the PKCS \#11 library<a name="afr-porting-pkcs"></a>
# Porting the corePKCS11 library<a name="afr-porting-pkcs"></a>

FreeRTOS uses the open standard PKCS \#11 “CryptoKi” API as the abstraction layer for cryptographic operations, including:
+ Signing and verifying\.
Expand All @@ -7,11 +7,11 @@ FreeRTOS uses the open standard PKCS \#11 “CryptoKi” API as the abstraction

For more information, see [PKCS \#11 Cryptographic Token Interface Base Specification](http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/os/pkcs11-base-v2.40-os.html)\.

Storing private keys in general\-purpose flash memory can be convenient in evaluation and rapid prototyping scenarios\. In production scenarios, to reduce the threats of data theft and device duplication, we recommend that you use dedicated cryptographic hardware\. Cryptographic hardware includes components with features that prevent cryptographic secret keys from being exported\. To use dedicated cryptographic hardware with FreeRTOS, you need to port the PKCS \#11 API to the hardware\. For information about the FreeRTOS PKCS \#11 library, see [FreeRTOS PKCS \#11 Library](https://docs.aws.amazon.com/freertos/latest/userguide/security-pkcs.html) in the FreeRTOS User Guide\.
Storing private keys in general\-purpose flash memory can be convenient in evaluation and rapid prototyping scenarios\. In production scenarios, to reduce the threats of data theft and device duplication, we recommend that you use dedicated cryptographic hardware\. Cryptographic hardware includes components with features that prevent cryptographic secret keys from being exported\. To use dedicated cryptographic hardware with FreeRTOS, you need to port the PKCS \#11 API to the hardware\. For information about the FreeRTOS corePKCS11 library, see [FreeRTOS corePKCS11 Library](https://docs.aws.amazon.com/freertos/latest/userguide/security-pkcs.html) in the *FreeRTOS User Guide*\.

## Prerequisites<a name="porting-prereqs-pkcs"></a>

To port the PKCS \#11 library, you need the following:
To port the corePKCS11 library, you need the following:
+ An IDE project or `CMakeLists.txt` list file that includes vendor\-supplied drivers that are suitable for sensitive data\.

For information about setting up a test project, see [Setting Up Your FreeRTOS Source Code for Porting](porting-set-up-project.md)\.
Expand All @@ -21,7 +21,7 @@ To port the PKCS \#11 library, you need the following:

## Porting<a name="porting-steps-pkcs"></a>

**To port the PKCS \#11 library**
**To port the corePKCS11 library**

1. Port the PKCS \#11 API functions\.

Expand Down Expand Up @@ -79,29 +79,29 @@ If you are using an IDE for porting and testing, you need to add some source fil
**Important**
In the following steps, make sure that you add the source files to your IDE project from their on\-disk location\. Do not create duplicate copies of source files\.

**To set up the PKCS \#11 library in the IDE project**
**To set up the corePKCS11 library in the IDE project**

1. Add the source file `freertos/vendors/vendor/boards/board/ports/pkcs11/core_pkcs11_pal.c` to the `aws_tests` IDE project\.

1. Add all of the files in the `freertos/libraries/abstractions/pkcs11` directory and its subdirectories to the `aws_tests` IDE project\.

1. Add all of the files in the `freertos/libraries/freertos_plus/standard/pkcs11` directory and its subdirectories to the `aws_tests` IDE project\. These files implement wrappers for commonly grouped PKCS \#11 function sets\.

1. Add the source file `freertos/libraries/freertos_plus/standard/crypto/src/aws_crypto.c` to the `aws_tests` IDE project\. This file implements the CRYPTO abstraction wrapper for mbedTLS\.
1. Add the source file `freertos/libraries/freertos_plus/standard/crypto/src/iot_crypto.c` to the `aws_tests` IDE project\. This file implements the CRYPTO abstraction wrapper for mbedTLS\.

1. Add all of the source and header files from `freertos/libraries/3rdparty/mbedtls` and its subdirectories to the `aws_tests` IDE project\.

1. Add `freertos/libraries/3rdparty/mbedtls/include` and `freertos/libraries/abstractions/pkcs11` to the compilers include path\.
1. Add `freertos/libraries/3rdparty/mbedtls/include` and `freertos/libraries/abstractions/pkcs11` to the compiler's include path\.

### Configuring the `CMakeLists.txt` file<a name="testing-cmake-pkcs"></a>

If you are using CMake to build your test project, you need to define a portable layer target for the library in your CMake list file\.
If you're using CMake to build your test project, you need to define a portable layer target for the library in your CMake list file\.

To define a library's portable layer target in `CMakeLists.txt`, follow the instructions in [FreeRTOS portable layers](cmake-template.md#cmake-portable)\.

The `CMakeLists.txt` template list file under `freertos/vendors/vendor/boards/board/CMakeLists.txt` includes example portable layer target definitions\. You can uncomment the definition for the library that you are porting, and modify it to fit your platform\.

See below for an example portable layer target definition for the PKCS \#11 library that uses the mbedTLS\-based software implementation of PKCS \#11 and supplies a port\-specific PKCS \#11 PAL file\.
See the following example portable layer target definition for the corePKCS11 library that uses the mbedTLS\-based software implementation of PKCS \#11 and supplies a port\-specific PKCS \#11 PAL file\.

```
# PKCS11
Expand Down Expand Up @@ -137,8 +137,8 @@ After you set up the library in the IDE project, you need to configure some othe

Testing is complete when all tests pass\.

## Validation<a name="w3aac11c29c17"></a>
## Validation<a name="pkcs-validation"></a>

To officially qualify a device for FreeRTOS, you need to validate the device's ported source code with AWS IoT Device Tester\. Follow the instructions in [ Using AWS IoT Device Tester for FreeRTOS](https://docs.aws.amazon.com/freertos/latest/userguide/device-tester-for-freertos-ug.html) in the FreeRTOS User Guide to set up Device Tester for port validation\. To test a specific library's port, the correct test group must be enabled in the `device.json` file in the Device Tester `configs` folder\.

After you finish porting the FreeRTOS PKCS \#11 library to your device, you can start porting the TLS library\. See [Porting the TLS library](afr-porting-tls.md) for instructions\.
After you finish porting the corePKCS11 library to your device, you can start porting the TLS library\. See [Porting the TLS library](afr-porting-tls.md) for instructions\.
2 changes: 1 addition & 1 deletion doc_source/portingguide/afr-porting-ss.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@ To port the TLS library, see [Porting the TLS library](afr-porting-tls.md)\.

To officially qualify a device for FreeRTOS, you need to validate the device's ported source code with AWS IoT Device Tester\. Follow the instructions in [Using AWS IoT Device Tester for FreeRTOS](https://docs.aws.amazon.com/freertos/latest/userguide/device-tester-for-freertos-ug.html) in the FreeRTOS User Guide to set up Device Tester for port validation\. To test a specific library's port, the correct test group must be enabled in the `device.json` file in the Device Tester `configs` folder\.

After you finish porting the FreeRTOS Secure Sockets library to your device, you can start porting the PKCS \#11 library\. See [Porting the PKCS \#11 library](afr-porting-pkcs.md) for instructions\.
After you finish porting the FreeRTOS Secure Sockets library to your device, you can start porting the corePKCS11 library\. See [Porting the corePKCS11 library](afr-porting-pkcs.md) for instructions\.
2 changes: 1 addition & 1 deletion doc_source/portingguide/afr-porting-tcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ The lightweight IP \(lwIP\) TCP/IP stack is an open source third\-party TCP/IP s
**Note**
These porting sections only provide instructions for porting to a platform's Ethernet or Wi\-Fi driver\. The tests only ensure that the Ethernet or Wi\-Fi driver can connect to a network\. You cannot test sending and receiving data across a network until you have ported the Secure Sockets library\.

A Secure Sockets library implementation already exists for the FreeRTOS\+TCP TCP/IP stack and the lwIP stack\. If you are using FreeRTOS\+TCP or lwIP, you do not need to port the Secure Sockets library\. After you finish porting the FreeRTOS\+TCP stack or the lwIP stack to your device, you can start [Porting the PKCS \#11 library](afr-porting-pkcs.md)\. Even if you do not need to create a port for the Secure Sockets library, your platform still needs to pass the AWS IoT Device Tester tests for the Secure Sockets library for qualification\.
A Secure Sockets library implementation already exists for the FreeRTOS\+TCP TCP/IP stack and the lwIP stack\. If you are using FreeRTOS\+TCP or lwIP, you do not need to port the Secure Sockets library\. After you finish porting the FreeRTOS\+TCP stack or the lwIP stack to your device, you can start [Porting the corePKCS11 library](afr-porting-pkcs.md)\. Even if you do not need to create a port for the Secure Sockets library, your platform still needs to pass the AWS IoT Device Tester tests for the Secure Sockets library for qualification\.
6 changes: 3 additions & 3 deletions doc_source/portingguide/afr-porting-tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ To port the FreeRTOS TLS library, you need the following:
+ A port of the FreeRTOS Secure Sockets library\.

For information about porting the Secure Sockets library to your platform, see [Porting the Secure Sockets library](afr-porting-ss.md)\.
+ A port of the FreeRTOS PKCS \#11 library\.
+ A port of the corePKCS11 library\.

For information about porting the PKCS \#11 library to your platform, see [Porting the PKCS \#11 library](afr-porting-pkcs.md)\.
For information about porting the corePKCS11 library to your platform, see [Porting the corePKCS11 library](afr-porting-pkcs.md)\.
+ An AWS account\.

For information about setting up an AWS account, see [How do I create and activate a new Amazon Web Services account?](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) on the AWS Knowledge Center\.
Expand Down Expand Up @@ -107,4 +107,4 @@ After you have ported the TLS library and tested your ports, you must run the Se

To officially qualify a device for FreeRTOS, you need to validate the device's ported source code with AWS IoT Device Tester\. Follow the instructions in [ Using AWS IoT Device Tester for FreeRTOS](https://docs.aws.amazon.com/freertos/latest/userguide/device-tester-for-freertos-ug.html) in the FreeRTOS User Guide to set up Device Tester for port validation\. To test a specific library's port, the correct test group must be enabled in the `device.json` file in the Device Tester `configs` folder\.

After you finish porting the FreeRTOS TLS library to your device, you can start setting up the MQTT library for testing\. See [Configuring the MQTT library for testing](afr-porting-mqtt.md) for instructions\.
After you finish porting the FreeRTOS TLS library to your device, you can start setting up the coreMQTT library for testing\. See [Configuring the coreMQTT library for testing](afr-porting-mqtt.md) for instructions\.
8 changes: 4 additions & 4 deletions doc_source/portingguide/afr-porting-wifi.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The FreeRTOS Wi\-Fi library interfaces with vendor\-supplied Wi\-Fi drivers\. Fo
If your device does not support Wi\-Fi networking, you can skip porting the FreeRTOS Wi\-Fi library and start [Porting a TCP/IP stack](afr-porting-tcp.md)\.

**Note**
For qualification, your device must connect to the AWS Cloud\. If your device does not support Wi\-Fi, you can use an ethernet connection instead\. A port of the FreeRTOS Wi\-Fi library is not necessarily required\.
For qualification, your device must connect to the AWS Cloud\. If your device does not support Wi\-Fi, you can use an Ethernet connection instead\. A port of the FreeRTOS Wi\-Fi library is not necessarily required\.

## Prerequisites<a name="porting-prereqs-wifi"></a>

Expand Down Expand Up @@ -37,14 +37,14 @@ To port the Wi\-Fi library, you need the following:

## Testing<a name="porting-testing-wifi"></a>

If you are using an IDE to build test projects, you need to set up your library port in the IDE project\.
If you're using an IDE to build test projects, you need to set up your library port in the IDE project\.

### Setting up the IDE test project<a name="testing-ide-wifi"></a>

If you are using an IDE for porting and testing, you need to add some source files to the IDE test project before you can test your ported code\.
If you're using an IDE for porting and testing, you need to add some source files to the IDE test project before you can test your ported code\.

**Important**
In the following steps, make sure that you add the source files to your IDE project from their on\-disk location\. Do not create duplicate copies of source files\.
In the following steps, make sure that you add the source files to your IDE project from their on\-disk location\. Don't create duplicate copies of source files\.

**To set up the Wi\-Fi library in the IDE project**

Expand Down
4 changes: 2 additions & 2 deletions doc_source/portingguide/afr-porting.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ If your device does not support Wi\-Fi, you can use an ethernet connection to co

1. [Porting the Secure Sockets library](afr-porting-ss.md)

1. [Porting the PKCS \#11 library](afr-porting-pkcs.md)
1. [Porting the corePKCS11 library](afr-porting-pkcs.md)

1. [Porting the TLS library](afr-porting-tls.md)

1. [Configuring the MQTT library for testing](afr-porting-mqtt.md)
1. [Configuring the coreMQTT library for testing](afr-porting-mqtt.md)

1. [Configuring the HTTPS client library for testing](afr-porting-https.md)
**Note**
Expand Down
Loading

0 comments on commit 130ad25

Please sign in to comment.