This tutorial provides instructions for getting started with the ECC608a Secure Element with Windows Simulator.
You will need the following hardware.
- ECC608a secure element clickboard
- SAMD21 XPlained Pro
- mikroBUS Xplained Pro adapter
Before you begin, you must configure AWS IoT and your Amazon FreeRTOS download to connect your device to the AWS Cloud. In this tutorial, the path to the Amazon FreeRTOS download directory is referred to as <amazon-freertos>.
This tutorial contains the following getting started steps:
-
Connect your board to a host machine.
-
Install software on the host machine for developing and debugging embedded applications for your microcontroller board.
-
Cross compile an Amazon FreeRTOS demo application to a binary image.
-
Load the application binary image to your board, and then run the application.
Before you can interact with your ECC608a device, you must first program the SAMD21.
Set up the SAMD21 XPlained Pro board
-
On the CryptoAuthentication™ SOIC XPRO Starter Kit page, follow the CryptoAuthSSH-XSTK (DM320109) - Latest Firmware link to download a .zip file containing instructions (PDF) and a binary which can be programmed onto the D21.
-
Download and install the Amtel Studio 7 IDP. Make sure that you select the SMART ARM MCU driver architecture when installing Atmel Studio.
-
Use a USB 2.0 Micro B cable to attach the "Debug USB" connector to your computer, and follow the instructions in the PDF that you downloaded in the first step. (The "Debug USB" connector is the USB port closest to the POWER led and pins.)
Connect the Hardware
-
Unplug the micro USB cable from Debug USB.
-
Plug the mikroBUS XPlained Pro adapter into the SAMD21 board in the EXT1 location.
-
Plug the ATECC608a Secure 4 Click board into the mikroBUSX XPlained Pro adapter, making sure that the notched corner of the click board matches with the notched icon on the adapter board.
-
Plug the micro USB cable in to Target USB.
-
If you haven't already, create and activate an AWS account. To add an IAM user to your AWS account, see IAM User Guide.
To grant your IAM user account access to AWS IoT and Amazon FreeRTOS, you will attach the following IAM policies to your IAM user account in the next steps:
AmazonFreeRTOSFullAccess
AWSIoTFullAccess
-
Attach the AmazonFreeRTOSFullAccess policy to your IAM user.
-
Browse to the IAM console, and from the navigation pane, choose ** Users**.
-
Enter your user name in the search text box, and then choose it from the list.
-
Choose Add permissions.
-
Choose Attach existing policies directly.
-
In the search box, enter AmazonFreeRTOSFullAccess, choose it from the list, and then choose Next: Review.
-
Choose Add permissions.
-
-
Attach the AWSIoTFullAccess policy to your IAM user.
-
Browse to the IAM console, and from the navigation pane, choose ** Users**.
-
Enter your user name in the search text box, and then choose it from the list.
-
Choose Add permissions.
-
Choose Attach existing policies directly.
-
In the search box, enter AWSIoTFullAccess, choose it from the list, and then choose Next: Review.
-
Choose Add permissions.
For more information about IAM and user accounts, see IAM User Guide.
For more information about policies, see IAM Permissions and Policies.
-
-
Download the Amazon FreeRTOS repo from the Amazon FreeRTOS console or from the Amazon FreeRTOS GitHub repository.
To download Amazon FreeRTOS from the Amazon FreeRTOS console:
-
Go to the Amazon FreeRTOS console.
-
Under Predefined configurations, find Connect to AWS IoT- Platform, and then choose Download.
-
Unzip the downloaded file to a folder, and make a note of the folder path. In the tutorials, this folder is referred to as <amazon-freertos>. Note
The maximum length of a file path on Microsoft Windows is 260 characters. The longest path in the Amazon FreeRTOS download is 122 characters. To accommodate the files in the Amazon FreeRTOS projects, make sure that the path to the<amazon-freertos>
directory is fewer than 98 characters long. For example,C:\Users\Username\Dev\AmazonFreeRTOS
works, butC:\Users\Username\Documents\Development\Projects\AmazonFreeRTOS
causes build failures.
To download Amazon FreeRTOS from GitHub:
-
Browse to the Amazon FreeRTOS GitHub repository.
-
Choose Clone or download.
-
From the command line on your computer, clone the repository to a directory on your host machine.
git clone https://github.com/aws/amazon-freertos.git --recurse-submodules
-
From the <amazon-freertos> directory, check out the branch that you want to use. Note
The maximum length of a file path on Microsoft Windows is 260 characters. Lengthy Amazon FreeRTOS download directory paths can cause build failures.
In the Getting Started documentation, the path to the Amazon FreeRTOS download directory is referred to as<amazon-freertos>
.
-
-
Set up your development environment.
-
Install the latest version of WinPCap.
-
Install Microsoft Visual Studio.
Visual Studio versions 2017 and 2019 are known to work. All editions of these Visual Studio versions are supported (Community, Professional, or Enterprise).
In addition to the IDE, install the **Desktop development with C++ ** component.
Install the latest Windows 10 SDK. You can choose this under the Optional section of the Desktop development with C++ component.
-
Make sure that you have an active hard-wired Ethernet connection.
-
Build and Run the Amazon FreeRTOS Demo Project with the Visual Studio IDE
-
Load the project into Visual Studio.
In Visual Studio, from the File menu, choose Open. Choose File/Solution, navigate to the
<amazon-freertos>projects\microchip\ecc608a_plus_winsim\visual_studio\aws_demos\aws_demos.sln
file, and then choose Open. -
Retarget the Demo Project.
The provided demo project depends on the Windows SDK, but it does not have a Windows SDK version specified. By default, the IDE might attempt to build the demo with an SDK version not present on your machine. To set the Windows SDK version, right-click on aws_demos and then choose Retarget Projects. This opens the Review Solution Actions window. Choose a Windows SDK Version that is present on your machine (the initial value in the dropdown is fine), then choose OK.
-
Build and run the project.
From the Build menu, choose Build Solution, and make sure the solution builds without errors. Choose Debug, Start Debugging to run the project. On the first run, you will need to Configure Your Network Interface and recompile.
-
Provision the ECC608a.
Microchip has provided several scripting tools to help with the setup of the ATECC608a parts. Navigate to
<amazon-freertos>\vendors\microchip\secure_elements\app\example_trust_chain_tool
, and open the README.md file located there.Follow the instructions in the README.md file to provision your device. This will navigate you through:
-
Creating and registering a certificate authority with AWS.
-
Generating your keys on the ECC608a and exporting the public key and device serial number.
-
Generating a certificate for the device and registering that certificate with AWS.
-
Loading the CA certificate and device certificate onto the device.
-
-
Build and Run Amazon FreeRTOS Samples
Re-run the demo project again. This time you should connect!
For general troubleshooting information about Getting Started with Amazon FreeRTOS, see Troubleshooting Getting Started.