Amazon FreeRTOS
User Guide

Getting Started with the Cypress CYW943907AEVAL1F Development Kit

This tutorial provides instructions for getting started with the Cypress CYW943907AEVAL1F Development Kit. If you do not have the Cypress CYW943907AEVAL1F Development Kit, visit the AWS Partner Device Catalog to purchase one from our partner.

Note

This tutorial walks you through setting up and running the MQTT Hello World demo. The Amazon FreeRTOS port for this board currently does not support the TCP server and client demos.

Before you begin, you must configure AWS IoT and your Amazon FreeRTOS download to connect your device to the AWS Cloud. See First Steps for instructions. In this tutorial, the path to the Amazon FreeRTOS download directory is referred to as <amazon-freertos>.

Important

The maximum length of a file path on Microsoft Windows is 260 characters. To accommodate the files in the Amazon FreeRTOS projects, make sure that the path to the Amazon FreeRTOS download directory is fewer than 43 characters long.

As noted in Downloading Amazon FreeRTOS, Amazon FreeRTOS ports for Cypress are currently only available on GitHub.

Overview

This tutorial contains instructions for the following getting started steps:

  1. Installing software on the host machine for developing and debugging embedded applications for your microcontroller board.

  2. Cross compiling an Amazon FreeRTOS demo application to a binary image.

  3. Loading the application binary image to your board, and then running the application.

  4. Interacting with the application running on your board across a serial connection, for monitoring and debugging purposes.

Setting Up Your Development Environment

Download and Install the WICED Studio SDK

In this Getting Started guide, you use the Cypress WICED Studio SDK to program your board with the Amazon FreeRTOS demo. Visit the WICED Software website to download the WICED Studio SDK from Cypress. You must register for a free Cypress account to download the software. The WICED Studio SDK is compatible with Windows, macOS, and Linux operating systems.

Note

Some operating systems require additional installation steps. Make sure that you read and follow all installation instructions for the operating system and version of WICED Studio that you are installing.

Set Environment Variables

Before you use WICED Studio to program your board, you must create an environment variable for the WICED Studio SDK installation directory. If WICED Studio is running while you create your variables, you need to restart the application after you set your variables.

Note

The WICED Studio installer creates two separate folders named WICED-Studio-m.n on your machine where m and n are the major and minor version numbers respectively. This document assumes a folder name of WICED-Studio-6.2 but be sure to use the correct name for the version that you install. When you define the WICED_STUDIO_SDK_PATH environment variable, be sure to specify the full installation path of the WICED Studio SDK, and not the installation path of the WICED Studio IDE. In Windows and macOS, the WICED-Studio-m.n folder for the SDK is created in the Documents folder by default.

To create the environment variable on Windows

  1. Open Control Panel, choose System, and then choose Advanced System Settings.

  2. On the Advanced tab, choose Environment Variables.

  3. Under User variables, choose New.

  4. For Variable name, enter WICED_STUDIO_SDK_PATH. For Variable value, enter the WICED Studio SDK installation directory.

To create the environment variable on Linux or macOS

  1. Open the /etc/profile file on your machine, and add the following to the last line of the file:

    export WICED_STUDIO_SDK_PATH=installation-path/WICED-Studio-6.2
  2. Restart your machine.

  3. Open a terminal and run the following commands:

    cd <amazon-freertos>/vendors/cypress/WICED_SDK
    perl platform_adjust_make.pl
    chmod +x make

Establishing a Serial Connection

To establish a serial connection between your host machine and your board

  1. Connect the board to your host computer with a USB Standard-A to Micro-B cable.

  2. Identify the USB serial port number for the connection to the board on your host computer.

  3. Start a serial terminal and open a connection with the following settings:

    • Baud rate: 115200

    • Data: 8 bit

    • Parity: None

    • Stop bits: 1

    • Flow control: None

For more information about installing a terminal and setting up a serial connection, see Installing a Terminal Emulator.

Build and Run the Amazon FreeRTOS Demo Project

After you set up a serial connection to your board, you can build the Amazon FreeRTOS demo project, flash the demo to your board, and then run the demo.

To build and run the Amazon FreeRTOS demo project in WICED Studio

  1. Launch WICED Studio.

  2. From the File menu, choose Import. Expand the General folder, choose Existing Projects into Workspace, and then choose Next.

  3. In Select root directory, select Browse..., navigate to the path <amazon-freertos>/projects/cypress/CYW943907AEVAL1F/wicedstudio, and then select OK.

  4. Under Projects, check the box for just the aws_demo project. Choose Finish to import the project. The target project aws_demo should appear in the Make Target window.

  5. Expand the WICED Platform menu and choose WICED Filters off.

  6. In the Make Target window, expand aws_demo, right-click the demo.aws_demo file, and then choose Build Target to build and download the demo to your board. The demo should run automatically after it is built and downloaded to your board.

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 Subscription topic, enter iotdemo/#, and then choose Subscribe to topic.

Troubleshooting

  • If you are using Windows, you might receive the following error when you build and run the demo project:

    : recipe for target 'download_dct' failed make.exe[1]: *** [download_dct] Error 1

    To troubleshoot this error, do the following:

    1. Browse to WICED-Studio-SDK-PATH\WICED-Studio-6.2\43xxx_Wi-Fi\tools\OpenOCD\Win32 and double-click on openocd-all-brcm-libftdi.exe.

    2. Browse to WICED-Studio-SDK-PATH\WICED-Studio-6.2\43xxx_Wi-Fi\tools\drivers\CYW9WCD1EVAL1 and double-click on InstallDriver.exe.

  • If you are using Linux or macOS, you might receive the following error when you build and run the demo project:

    make[1]: *** [download_dct] Error 127

    To troubleshoot this error, use the following command to update the libusb-dev package:

    sudo apt-get install libusb-dev

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