Getting started with the Cypress CYW954907AEVAL1F Development Kit
Important
This reference integration is hosted on the Amazon-FreeRTOS repository which is deprecated. We recommend that you start here when you create a new project. If you already have an existing FreeRTOS project based on the now deprecated Amazon-FreeRTOS repository, see the Amazon-FreeRTOS Github Repository Migration Guide.
This tutorial provides instructions for getting started with the Cypress CYW954907AEVAL1F
Development Kit. If you don't have the Cypress CYW954907AEVAL1F 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 coreMQTT Mutual Authentication demo. The FreeRTOS port for this board currently doesn't support the TCP server and client demos.
Before you begin, you must configure AWS IoT and your FreeRTOS download to connect your device
to the AWS Cloud. See First steps
for instructions. In this tutorial, the path to the FreeRTOS download directory is referred to
as
.freertos
Important
-
In this topic, the path to the FreeRTOS download directory is referred to as
.freertos
-
Space characters in the
path can cause build failures. When you clone or copy the repository, make sure the path that you create doesn't contain space characters.freertos
-
The maximum length of a file path on Microsoft Windows is 260 characters. Long FreeRTOS download directory paths can cause build failures.
-
Because the source code may contain symbolic links, if you're using Windows to extract the archive, you may have to:
-
Enable Developer Mode
or, -
Use a console that is elevated as administrator.
In this way, Windows can properly create symbolic links when it extracts the archive. Otherwise, symbolic links will be written as normal files that contain the paths of the symbolic links as text or are empty. For more information, see the blog entry Symlinks in Windows 10!
. If you use Git under Windows, you must enable Developer Mode or you must:
-
Set
core.symlinks
to true with the following command:git config --global core.symlinks true
-
Use a console that is elevated as administrator whenever you use a git command that writes to the system (for example, git pull, git clone, and git submodule update --init --recursive).
-
-
As noted in Downloading FreeRTOS, FreeRTOS ports for Cypress are currently only available on GitHub
.
Overview
This tutorial contains instructions for the following getting started steps:
-
Installing software on the host machine for developing and debugging embedded applications for your microcontroller board.
-
Cross compiling a FreeRTOS demo application to a binary image.
-
Loading the application binary image to your board, and then running the application.
-
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 FreeRTOS demo. Visit the WICED Software
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-
on your machine where m
.n
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-
folder for the SDK is created in the m
.n
Documents
folder by default.
To create the environment variable on Windows
-
Open Control Panel, choose System, and then choose Advanced System Settings.
-
On the Advanced tab, choose Environment Variables.
-
Under User variables, choose New.
-
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
-
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 -
Restart your machine.
-
Open a terminal and run the following commands:
cd
freertos
/vendors/cypress/WICED_SDKperl platform_adjust_make.pl
chmod +x make
Establishing a serial connection
To establish a serial connection between your host machine and your board
-
Connect the board to your host computer with a USB Standard-A to Micro-B cable.
-
Identify the USB serial port number for the connection to the board on your host computer.
-
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.
Monitoring MQTT messages on the cloud
Before you run the FreeRTOS demo project, you can set up 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
-
Sign in to the AWS IoT console
. -
In the navigation pane, choose Test, then choose MQTT test client to open the MQTT client.
-
In Subscription topic, enter
, and then choose Subscribe to topic.your-thing-name
/example/topic
Build and run the FreeRTOS demo project
After you set up a serial connection to your board, you can build the FreeRTOS demo project, flash the demo to your board, and then run the demo.
To build and run the FreeRTOS demo project in WICED Studio
-
Launch WICED Studio.
-
From the File menu, choose Import. Expand the
General
folder, choose Existing Projects into Workspace, and then choose Next. -
In Select root directory, select Browse..., navigate to the path
, and then select OK.freertos
/projects/cypress/CYW954907AEVAL1F/wicedstudio -
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.
-
Expand the WICED Platform menu and choose WICED Filters off.
-
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.
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:
-
Browse to
and double-click onWICED-Studio-SDK-PATH
\WICED-Studio-6.2\43xxx_Wi-Fi\tools\OpenOCD\Win32openocd-all-brcm-libftdi.exe
. -
Browse to
and double-click onWICED-Studio-SDK-PATH
\WICED-Studio-6.2\43xxx_Wi-Fi\tools\drivers\CYW9WCD1EVAL1InstallDriver.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 FreeRTOS, see Troubleshooting getting started.