3.3.5.3 Amazon Alexa Connect Kit (ACK) Microwave Application on SAM D21 Curiosity Nano

Download

Description

The application demonstrates an integration of Amazon Alexa connect kit (ACK) SDK with host microcontroller SAM D21 and controlling microwave on SAM D21 Curiosity Nano.

This following bullet points provides links to the detailed topics:

  • Modules/Technology Used
  • Hardware Used
  • Software/Tools Used
  • Hardware Setup
  • Setting up the build platform
  • Project file structure
  • Steps to program the hex file
  • Programming/Debugging Microwave Application Project
  • Register the device
  • Running the demo
  • Comments

Modules/Technology Used

  • Peripheral Modules
    • SERCOM
    • Systick
    • Port
    • NVMCTRL

Hardware Used

Software/Tools Used

This project has been verified to work with the following versions of software tools:

Refer Project Manifest present in harmony-manifest-success.yml under the project folder firmware/src/config/default.

  • Refer the Release Notes to know the MPLAB X IDE and MCC Plugin version.

Because Microchip regularly updates tools, occasionally issue(s) could be discovered while using the newer versions of the tools. If the project does not seem to work and version incompatibility is suspected. It is recommended to double-check and use the same versions that the project was tested with. To download original version of MPLAB Harmony v3 packages, refer to document How to Use the MPLAB Harmony v3 Project Manifest Feature (DS90003305).

Hardware Setup

Hardware connections with ACK Module:

  • Connect Pin "PB02(ACK HOST INTERRUPT Pin)" of SAM D21 Curiosity Nano Evaluation Kit to "INT"(INST) pin of ACK Module.
  • Connect Pin "PB03(ACK MODULE RESET Pin)" of SAM D21 Curiosity Nano Evaluation Kit to "RESET"(RES) pin of ACK Module.
  • Connect Pin "PA20(Host MCU TX)" of SAM D21 Curiosity Nano Evaluation Kit to "ACK RX" pin of ACK Module.
  • Connect Pin "PA21(Host MCU RX)" of SAM D21 Curiosity Nano Evaluation Kit to "ACK TX" pin of ACK Module.
  • Connect Pin "VTG(Voltage Target)" of SAM D21 Curiosity Nano Evaluation Kit to "IOREF" pin of ACK Module.
  • Connect common ground between SAM D21 Curiosity Nano Evaluation Kit and ACK Module.
  • Power the SAM D21 Curiosity Nano Evaluation Kit Evaluation Kit from a Host PC through a Type-A male to Micro-B USB cable connected to Micro-B port (J105).
  • Power the ACK Module from a Host PC through a Type-A male to Micro-B USB cable connected to Micro-B port (DEBUG).
  • Note: Contact Amazon for details on the other hardware/equipment required for this demo application.

Setting up the Build Platform

  • Download and extract ACK Device SDK 4.2 from Amazon developer website.
  • Copy and paste extracted SAM D21 ACK port folder "samd21_amazon_ack" into ACK device SDK's user platform folder.
    <Your ACK SDK Downloaded
          folder>/ACK_Device_SDK_4.2.202201251359/user/platform
Note:
  • Make sure the user creates amazon.com account for downloading the SDK. The user would use the Amazon credentials to register the development device (amazon.com account provides an option to register the development device).
  • ACK Module with Espressif chipset is used in these demo's. Make sure the user download proper ACK SDK from the Amazon website.
  • Create Product and add device capabilities to the product once product is created.
  • Download the product configuration file from created product and provision the Ack module using CLI command.
  • For more information check Register the device section.

Project File Structure

  • ACK SDK file/directory structure, refer "Readme.txt" in:

    <Your ACK SDK Downloaded folder>\ACK_Device_SDK_4.2.202201251359\

  • SAM D21 ACK port file/directory is as follows:
    • user/platform/samd21_amazon_ack/
      • applications: Contains all the ACK host sample applications built on MPLABX Tools and xc32 compiler
      • bootloader: Contains bootloader for over-the-air(OTA) firmware upgrade feature
      • hmcu_port: Contains shared host specific platform and OTA files
      • ota: Contains OTA source, config and header files
      • ack_samd21_cutom_loader.c: Contains bootloader specific code
      • ack_samd21_platform.c: Contains SAMD21 platform specific code

Programming Hex File

The pre-built hex file can be programmed by following the below steps.

Steps to program the hex file:
  • Open MPLAB X IDE.
  • Close all existing projects in IDE, if any project is opened.
  • Go to File -> Import -> Hex/ELF File.
  • In the Import Image File window,
    1. Create Prebuilt Project,
      • Click the Browse button to select the prebuilt hex file.
      • Select Device as ATSAMD21G17D.
      • Ensure the proper tool is selected under Hardware Tool and click on Next button.
    2. Select Project Name and Folder,
      • Select appropriate project name and folder and click on Finish button
  • In MPLAB X IDE, click on Make and Program Device button to program the device.
  • Follow the steps in Running the Demo section below.

Programming/Debugging Microwave Application Project

Before proceeding with this step complete "Setting up the build platform" step.

  • Open the project (samd21_amazon_ack/applications/Microwave/firmware/Microwave_sam_d21_cnano.X) in MPLAB X IDE
  • Ensure SAM D21 Curiosity Nano is selected as hardware tool to program/debug the application
  • Build the code and program the device by clicking on the Make and Program button in MPLAB X IDE tool bar

Register the device

  • Create an account at developer.amazon.com website and Install the Amazon Alexa application with the same credentials on the Smartphone.
  • Visit Alexa Connect Kit - Resources and download the latest ACK Device SDK, firmware, and Module Utility for ACK Module Espressif Chipset.
  • Download the product provisioning file of the created product.
  • Check and update the existing firmware using the below command:
    java -jar <path>/ackmoduleutility.jar updatemodule -p <port> --updatefile <file path to
                  the downloaded firmware>
  • The above command updates a module over the wire with a new firmware package from Amazon.
    • Use the following command to provision a module with ACK Managed Services.
      java -jar <path>/ackmoduleutility.jar provision -p <port> --provisionconfigfile
                    <path>/ProvisioningInfo_[devicetypeid].conf
  • Create a Barcode using a unique UPC, which will be used to register the device.
    • The syntax to create the Barcode is:
      barcode --port <port> [--includedsndevice] --out <output directory> --upc
                      <upc>
      Note: The UPC can be any unused 12-digit number. Try giving random 12-digit number untill Barcode generation is success.
  • Make sure the mobile device is connected to a Wi-Fi network.
  • Go to Devices -> Add New Device -> Development Device -> ACK.
  • Scan the Barcode which got generated, i.e., DVC_XXXXXX.png.
  • Connect to the Wi-Fi network and observe the status LED on the Espressif Chipset.
    • If the user successfully registered the device. The user should see the status LED on the ACK development board change from WHITE to GREEN.
    • For more information refer Amazon ACK Module Utility Reference.
    • For more information refer Register ACK Module with Amazon by following the procedure

Running the Demo

Note: This demo does not have functional running/test steps as the other required hardware/equipment needs to be procured.
Note: Contact Amazon for help on running this demo application.

Comments