Skip to content

Latest commit

 

History

History
180 lines (127 loc) · 11.4 KB

GettingStarted_With SAME70.md

File metadata and controls

180 lines (127 loc) · 11.4 KB

Getting Started with the Microchip SAME70 Xplained Ultra

This tutorial provides instructions for getting started with the Microchip SAME70 Xplained Ultra. Microchip provides three solutions with FreeRTOS

  1. Secure Element based Wired Solution with ECC608
  2. Secure Element based Wi-Fi (Wireless) solution with ECC608 and
  3. Wired only solution (NVM Based).

If you do not have the following components, visit the AWS Partner Device Catalog to purchase one from our partner.

Pre-Requisites:

To get started with FreeRTOS, you need an AWS account, an IAM user with permission to access AWS IoT and Amazon FreeRTOS cloud services, and you need one of the supported hardware platforms. You also need to download Amazon FreeRTOS and configure your board's Amazon FreeRTOS demo project to work with AWS IoT. The following sections walk you through these requirements.

  1. Setting Up Your AWS Account and Permissions

  2. Registering your MCU Board with AWS IOT

  3. From the MicrochipTech repository, download the amazon-freertos repository (mchpdev branch).
    To clone or download the repo from Github,go to the main page of this repository and then click Clone button to clone this repo or download as zip file.


IMPORTANT

The maximum length of a file path on Microsoft Windows is 260 characters. To accommodate the files in the FreeRTOS projects, make sure that the path to the Root path directory is fewer than 40 characters long. Long FreeRTOS download directory paths can cause build failures.


  1. Demo Configuration
    • For Secure Wired/Wireless solution, use the aws_clientcredential.h and aws_clientcredentialkeys.h obtained as part of the provisioning Secure Element (ATECC608).
      • For Wireless solution, enter the WIFI SSID and password in aws_clientcredential.h.
    • For Wired only solution, refer Configuring the FreeRTOS Demos

WIFI Configuration for Cloud Connectivity (Program Amazon Root CA)

To use WiFi (wireless) solution, you need to program the Amazon Root CA to WINC3400 Xplained Pro or WINC1500 Xplained Pro. Below are the steps

  1. Download Amazon Root CA3 in .pem format
  2. Convert the .pem format to .cer
    • Use OpenSSL command to convert .pem to .crt

      openssl x509 -outform der -in certificate.pem -out certificate.crt

    • Double click .crt file in Windows -> Select "Detail" tab --> Click "Copy to File" --> Click "Next" --> Select "DER encoded binary X.509 (.CER)" --> Click "Next" --> Input the file name as "AmazonRootCA3" --> "AmazonRootCA3.cer" file is generated
  3. Import Firmware Update Project and Upgrade
    • Install [Atmel Studio 7.0] from Windows Environment.(https://gallery.microchip.com/policies/studio)

    • Search for "Firmware Update Project" from the "New Example Project" of ASF menu in Atmel Studio

      To use WINC1500 Xplained Pro,

      • Select "WINC Firmware Update Project (v19.6.1) SAMD21 Xplained Pro" and then press the OK button to import firmware update project and related documentation
      • Place "AmazonRootCA3.cer" to the project folder src\firmware\Tools\root_certificate_downloader\binary
      • Plug the WINC1500 Xplained Pro into the SAMD21 board in the EXT1 location and connect the DEBUG USB port of the board to the host computer using a Type A to Micro B USB Cable.
      • Execute "samd21_xplained_pro_firmware_update.bat" in folder src/ to upgrade the firmware and program Root CA

Overview

This tutorial contains instructions for the following getting started steps:

  1. Connecting your board to a host machine.
  2. Installing software on the host machine for developing and debugging embedded applications for your microcontroller board.
  3. Cross compiling an Amazon FreeRTOS demo application to a binary image.
  4. Loading the application binary image to your board, and then running the application.
  5. Interacting with the application running on your board across a serial connection, for monitoring and debugging purposes.

Set Up the Microchip SAME70 Xplained Ultra Hardware

To use Secured Wired Solution

  1. Connect the PIC32 LAN8720 PHY daughter board to the ETHERNET PHY MODULE header on the SAME70 Xplained Ultra Kit.
  2. Connect one end of an Ethernet cable to the ethernet PHY available in the board, Connect the other end to your router or other internet port.
  3. Plug the mikroBUS XPlained Pro adapter into the SAME70 board in the EXT2 location.
  4. Plug the ATECC608A Trust board into the mikroBUS XPlained Pro adapter. Make sure that the notched corner of the click board matches with the notched icon on the adapter board.
  5. Select the TrustCUSTOM secure element on the ATECC608A Trust board by switch on the DIP Switch 1 of SW2. Image of ATECC608 Trust
  6. Connect the DEBUG USB port of the board to the host computer using a Type A to Micro B USB Cable.

To use Secured Wireless,

  1. Plug the WINC1500 Xplained Pro into the SAME70 board in the EXT1 location
  2. Plug the mikroBUS XPlained Pro adapter into the SAME70 board in the EXT2 location.
  3. Plug the ATECC608A Trust board into the mikroBUSX XPlained Pro adapter. Make sure that the notched corner of the click board matches with the notched icon on the adapter board.
  4. Select the TrustCUSTOM secure element on the ATECC608A Trust board by switch on the DIP Switch 1 of SW2
  5. Connect the DEBUG USB port of the board to the host computer using a Type A to Micro B USB Cable.

To use Wired only Solution,

  1. Connect the PIC32 LAN8720 PHY daughter board to the ETHERNET PHY MODULE header on the SAME70 Xplained Ultra Kit.
  2. Connect one end of an Ethernet cable to the ethernet PHY available in the board, Connect the other end to your router or other internet port.
  3. Connect the DEBUG USB port of the board to the host computer using a Type A to Micro B USB Cable.

Set Up Your Development Environment

Note

The FreeRTOS project for this device is based on MPLAB Harmony v3. To build the project, you need to use versions of the MPLAB tools that are compatible with Harmony v3, like v2.40 or higher of the MPLAB XC32 Compiler and the latest MPLAB IDE.

  1. Install Python version 3.x or later.
  2. Install the MPLAB X IDE:
  1. Install the MPLAB XC32 Compiler:
  1. Start up a UART terminal emulator like TeraTerm and open the EDBG COM Port connection with the following settings:
  • Baud rate: 115200
  • Data: 8 bit
  • Parity: None
  • Stop bits: 1
  • Flow control: None

Build and Run FreeRTOS Demo Project

Open the FreeRTOS Demo Project (MQTT Demo) in the MPLAB IDE

  1. Open MPLAB IDE. If you have more than one version of the compiler installed, you need to select the compiler that you want to use from within the IDE.
  2. From the File menu, choose Open Project.
  3. Browse to and open the project based on hardware selection.

For Secured Wired:

projects\microchip\same70_xult_ecc\mplab\aws_demos\firmware\aws_demos.X.

For Secured Wireless:

projects\microchip\same70_xult_winc1500\mplab\aws_demos\firmware\aws_demos.X.

For Wired only Solution:

projects\microchip\same70_xult\mplab\aws_demos\firmware\aws_demos.X.

Note

When you open the project for the first time, you might get an error message about the compiler. In the IDE, navigate to Tools , Options , Embedded , and then select the compiler that you are using for your project. The demo kit comes with on-board EDBG debugger/programmer, which would be used for Programming/Debugging the Amazon FreeRTOS project.

Run the FreeRTOS Demo Project

  1. Rebuild your project.
  2. On the Projects tab, right-click the aws_demos top-level folder, and then choose Debug.
  3. When the debugger stops at the breakpoint in main(), from the Run menu, choose Resume.

Monitoring MQTT Messages on the Cloud

You can use the MQTT client in the AWS IoT console to monitor the messages that your device sends to the AWS Cloud.

To subscribe to the MQTT topic with the AWS IoT MQTT client

  1. Sign in to the AWS IoT console.
  2. In the navigation pane, choose Test to open the MQTT client.
  3. In the Quality of Service select **1 ( This client will acknowledge to the Device Gateway that messages are received). **
  4. In Subscription topic , enter iotdemo/# , and then choose Subscribe to topic. This will enable you to see the periodically published messages by the MQTT Hello World example.

Output in Serial port terminal

Troubleshooting

If no messages appear in the AWS IoT console, try the following:

  1. Open a terminal window to view the logging output of the sample. This can help you determine what is going wrong.
  2. Check that your network credentials are valid.

For general troubleshooting information about Getting Started with FreeRTOS, see Troubleshooting Getting Started.