TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING HARDWARE, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. To the extent permitted by applicable law, Cypress reserves the right to make changes to this document without
further notice. Cypress does not assume any liability arising out of the application or use of any product or circuit described in
this document. Any information provided in this document, including any sample design information or programming code, is
provided only for reference purposes. It is the responsibility of the user of this document to properly design, program, and test
the functionality and safety of any application made of this information and any resulting product. Cypress products are not
designed, intended, or authorized for use as critical components in systems designed or intended for the operation of
weapons, weapons systems, nuclear installations, life-support devices or systems, other medical devices or systems
(including resuscitation equipment and surgical implants), pollution control or hazardous substances management, or other
uses where the failure of the device or system could cause personal injury, death, or property damage (“Unintended Uses”).
A critical component is any component of a device or system whose failure to perform can be reasonably expected to cause
the failure of the device or system, or to affect its safety or effectiveness. Cypress is not liable, in whole or in part, and you
shall and hereby do release Cypress from any claim, damage, or other liability arising from or related to all Unintended Uses
of Cypress products. You shall indemnify and hold Cypress harmless from and against all claims, costs, damages, and other
liabilities, including claims for personal injury or death, arising from or related to any Unintended Uses of Cypress products.
Cypress, the Cypress logo, Spansion, the Spansion logo, and com
binations thereof, WICED, PSoC, CapSense, EZ-USB, FRAM, and Traveo are trademarks or registered trademarks of Cypress in the United States and other countries. For a more
complete list of Cypress trademarks, visit cypress.com. Other names and brands may be claimed as property of their respective owners.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **2
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **4
Safety Information
The CYW954907AEVAL1F EVK is intended for use as a development platform for hardware or software in a laboratory environment. The board is an open-system design, which does not include a
shielded enclosure. Due to this reason, the board may cause interference with other electrical or
electronic devices in close proximity. In a domestic environment, this product may cause radio interference. In such cases, take adequate preventive measures. Also, do not use this board near any
medical equipment or RF devices.
Attaching additional wiring to this product or modifying the product operation from the factory default
may affect its performance and cause interference with other apparatus in the immediate vicinity. If
such interference is detected, suitable mitigating measures must be taken.
The CYW954907AEVAL1F contains electrostatic discharge (ESD)-sensitive devices.
Electrostatic charges readily accumulate on the human body and any equipment, and can
discharge without detection. Permanent damage may occur on devices subjected to highenergy discharges. Proper ESD precautions are recommended to avoid performance
degradation or loss of functionality. Store unused CYW954907AEVAL1F in the protective
shipping package.
End-of-Life/Product Recycling
This kit has an end-of-life cycle of five years from the year of manufacturing mentioned
on the back of the box. Contact your nearest recycler for discarding the kit.
General Safety Instructions
ESD Protection
ESD can damage boards and associated components. Cypress recommends that the user perform
procedures only at an ESD workstation. If an ESD workstation is not available, use appropriate ESD
protection by wearing an antistatic wrist strap attached to the chassis ground (any unpainted metal
surface) on the board when handling parts.
Handling Boards
CYW954907AEVAL1F boards are sensitive to ESD. Hold the board only by its edges. After removing the board from its box, place it on a grounded, static-free surface. Use a conductive foam pad if
available. Do not slide the board over any surface. Any physical action on CYW954907AEVAL1F
such as changing wires, jumper settings, or measuring voltages can cause stress on the
CYW954907AEVAL1F printed circuit board assembly (PCBA). You must ensure that the PCBA has
proper support on the bottom side to avoid stress on the PCBA when the EVK is in operation.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **5
1.Introduction
Thank you for your interest in the CYW954907AEVAL1F Evaluation Kit (EVK). The CYW954907AEVAL1F EVK enables customers to evaluate and develop single-chip Wi-Fi applications using
CYW54907 devices.
The CYW954907AEVAL1F EVK uses WICED Studio 6.0 (or later) to develop and debug your
CYW54907 project. CYW954907AEVAL1F EVK offers footprint-compatibility with Arduino shields. In
addition, the kit features an RJ-45 Ethernet connector, and onboard programmer/debugger and
serial bridge chip. The CYW954907AEVAL1F EVK supports only 3.3 V as the operating voltage.
WICED Studio 6.0 (or later) supports application development using a WICED development board
(CYW954907AEVAL1F). The development system is compatible with the Windows, OS X, and Linux
operating systems. This document provides instructions for utilizing peripherals, such as I2C or SPI,
in WICED sample applications using the WICED Studio Integrated Development Environment (IDE).
Note: This document applies to WICED Studio 6.0 (or later).
The CYW954907AEVAL1F EVK is available through the Cypress Online Store or through our distrib-
utors.
1.1CYW954907AEVAL1F EVK Contents
The CYW954907AEVAL1F EVK includes the following:
■ One CYW954907AEVAL1F Evaluation Board with assembled Arduino headers
■ One USB 2.0 Type-A to Micro-B cable
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **6
Figure 1-1. CYW954907AEVAL1F Kit Contents
Introduction
Inspect the contents of the kit. If you find any part missing, contact your nearest Cypress sales office
for assistance: www.cypress.com/support.
Hardware Not Included with the Kit
The CYW954907AEVAL1F EVK does not come with all the hardware needed to perform the demonstrations documented in this guide.
The following hardware is not included with this kit:
■ RJ-45 Ethernet cable
■ External power supply
■ Dual external antenna
■ Potentiometer
■ Jumper Wires
■ SD card
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **7
1.2CYW954907AEVAL1F Board Details
The CYW954907AEVAL1F board consists of the blocks shown in Figure 1-2 and Figure 1-3.
1. Reset Switch (SW2)
2. RJ45 Connector (J14)
3. Micro USB (Programming and Debugging) (J5)
4. 5-12V Power Input (J8)
5. WICED Header (J6)
6. Arduino Header (J13)
7. User Switch 1 (SW3)
8. User Switch 2 (SW1)
9. Arduino Header (J9)
10. PCB Antenna-Main (ANT1)
11. Connector for External Antenna 1 (J1)
12. CYW54907 Type 1PS Module (Murata) (U14)
13. PCB Antenna-Diversity (ANT0)
14. Connector for External Antenna 0 (J2)
15. On-board /External JTAG Switch (SW4)
16. External JTAG Header (J3)
17. Arduino Header (J10)
18. Arduino Header (J12)
19. External PHY chip(U12) - BCM5241
20. External ADC Chip (U3)
21. Micro SD Connector/slot (J7)
Introduction
Figure 1-2. CYW954907AEVAL1F Evaluation Board
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **8
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **9
1.3WICED Studio Development System Overview
WICED Studio 6.0 (or later) supports application development using the WICED Evaluation Board
(CYW954907AEVAL1F EVK). Tabs and their location in the WICED IDE are as shown in Figure 1-4.
Figure 1-4 illustrates the following:
1. Edit your application firmware.
2. Help Window that contains instructions on building and downloading applications.
3. Explore existing applications/firmware and library of the Software Development Kit (SDK).
4. View Build messages in the Console window.
5. Create and edit Make Targets for the platform to build your Application/Project.
Figure 1-4. WICED IDE
Introduction
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **10
1.4WICED Studio Code Examples
WICED Studio includes libraries and code examples supporting both Bluetooth and Wi-Fi platforms.
Selecting the 43xxx_Wi-fi Filter will show only Wi-Fi platform related files in the project explorer as
shown in Figure 1-5.
Application examples can speed up the design process by serving as templates for development.
Code examples are located under the apps category (in the Project explorer window), as shown in
Figure 1-6. Code examples under apps are further grouped into demo, snip, test, waf (WICED Appli-
cation Framework), and wwd (WICED Wi-Fi Driver Application) directories.
The demo directory contains applications that combine various WICED features into a single application. The snip directory contains application snippets that demonstrate how to use various WICED
libraries and API functions. The test directory contains applications that are used for simple test and
utility. The waf directory contains applications that are part of WICED Application framework, for
instance, the bootloader. The wwd directory contains applications that are developed using the low
level wwd API calls and do not rely on higher level WICED APIs. Located within each subdirectory in
the apps folder is a README.txt that lists and summarizes the applications located within the folder.
It should also be noted that not all applications are supported in all platforms. The snip directory contains a README.txt with a matrix on what applications are supported in what platforms. For more
details on the WICED software stack and APIs, review the Application notes and documents available in the doc folder <WICED SDK installation folder>/WICED-Studio-6.0/43xxx_Wi-Fi/doc.
WICED-QSG204 available in the same path is a good document to start with.
Introduction
Figure 1-5. Filter for Wi-Fi Code Example in WICED Studio
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **11
Figure 1-6. Code Examples under apps Category
Introduction
1.5Kit Code Examples
In addition to the examples available in WICED Studio, this EVK includes a few additional code
examples, which can be used to quickly evaluate CYW54907 using this kit. These examples are
described in the Code Examples chapter.
1.6Getting Started
To learn quickly about CYW954907AEVAL1F EVK, refer to the CYW954907AEVAL1F Quick Start
Guide inside the kit box.
This user guide will help you get acquainted with CYW954907AEVAL1F EVK:
■ The Software Installation chapter describes the installation of the kit software. This includes
extracting the required files for WICED Studio 6.0 (or later).
■ The Kit Operation chapter describes the major sections of the kit such as the on-board program-
mer/debugger chip, reset control, headers, programming and debugging of the kit, and Ethernet
interface.
■ The Hardware chapter describes the CYW954907AEVAL1F EVK hardware and its different
blocks.
■ The Code Examples chapter describes code examples that will help you understand how to get
started with WLAN basic examples.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **12
1.7IoT Resources and Technical Support
Cypress provides a wealth of data at www.cypress.com/internet-things-iot to help you to select the
right IoT device for your design, and quickly and effectively integrate the device into your design.
Cypress provides customer access to a wide range of information, including technical documentation, schematic diagrams, product bill of materials, PCB layout information, and software updates.
Customers can acquire technical documentation and software from the Cypress Support Community
website (https://community.cypress.com). For assistance, go to: www.cypress.com/support.
1.8Additional Learning Resources
Visit CYW954907AEVAL1F EVK and CYW54907 for additional learning resources including data-
sheets and application notes.
1.9Document Conventions
Table 1-1. Document Conventions for Guides
ConventionUsage
Courier New
ItalicsDisplays file names and reference documentation.
[Bracketed, Bold]
File > Open
Bold
Times New Roman
Text in gray boxesDescribes Cautions or unique functionality of the product.
Displays file locations, user entered text, and source code:
C:\ ...cd\icc\
Displays keyboard commands in procedures:
[Enter] or [Ctrl] [C]
Represents menu paths:
File > Open > New Project
Displays commands, menu paths and icon names in procedures:
Click the File icon and then click Open.
Displays an equation:
2 + 2 = 4
Introduction
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **13
1.10Acronyms
Table 1-2. List of Acronyms used in this Document
AcronymDefinition
SPISerial Peripheral Interface
EVKEvaluation Kit
SDKSoftware Development Kit
WICEDWireless Internet Connectivity for Embedded Devices
JTAGJoint Test Action Group
2
C
I
MQTTMessage Queue Telemetry Transport
PORPower-on-Reset
PMUPower Management Unit
VTRIMVoltage Trimming
LPOLow Power Oscillator
GPIOGeneral Purpose Input Output
UARTUniversal Asynchronous Receiver/Transmitter
AWSAmazon Web Services
IDEIntegrated Development Environment
WLANWireless Local Area Network
Introduction
Inter-Integrated Circuit
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **14
2.Software Installation
This chapter describes the steps to install the software tools and packages on a PC for using the
CYW954907AEVAL1F EVK. This includes the WICED IDE in which the projects will be built and
used for programming.
2.1Before You Begin
All Cypress software installations require administrator privileges. Ensure that you have the required
privileges on the system for successful installation. Before you install the kit software, close any
other Cypress software that is currently running. Ensure you have installed WICED Studio 6.0 (or
later).
2.2Install Software
Follow these steps to install the CYW954907AEVAL1F Evaluation Kit software:
1. Download and install WICED Studio 6.0 (or later) from this web page. Following is a screenshot
of the Installer Window when opened.
2. Select two Folders, one for the IDE and the other for the SDK. The folder for the SDK contains
the Framework for developing Wi-Fi applications.
3. As a last step in installation, installer will ask to select between Wi-Fi and Bluetooth platform.
Select 43xxx_Wi-Fi as default.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **15
Software Installation
4. Download the CY954907AEVAL1F_KitPackage.zip software from here. The software is available as a zip file.
5. Locate the WICED Wi-Fi-SDK directory in your PC. The default location is C:\Users\<user name>\Documents\WICED-Studio-6.0\43xxx_Wi-Fi, as shown in Figure 2-1. However, it may be
in a different location depending on the path you choose when installing WICED Studio.
USB to serial UART with 3.3V TTL Adapter cable allows to connect between Host or computer
and CYW89072EVAL. This connection refers as a regular serial communication
Figure 2-1. WICED SDK Directory
6. Copy the CY954907AEVAL1F_KitPackage.zip file and extract to a temporary location such as
"temp". The zip file will extract two directories called "apps" and "resources" inside the temp/CYW954907AEVAL1F_KitPackage/ directory. Select both of them, Copy (CTRL+C) and paste
(CTRL+V) into C:\Users\<user name>\Documents\WICED-Studio-6.0\43xxx_Wi-Fi. Choose the
option to merge with existing folders.
Alternately, copy the CY954907AEVAL1F_KitPackage.zip to the location specified above and
use the Extract Here option if you have 7-Zip or another unzip utility. The zip file should be
merged to the existing folders. If WICED Studio 6.0 (or later) is opened with 43xxx_Wi-Fi as the
WICED Filter (Figure 1-5), then the new folders appear as shown in Figure 2-2.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **16
Figure 2-2. Setup Package in WICED Studio 6.0 (or later)
Software Installation
7. The CY954907AEVAL1F_KitPackage.zip package contains three code examples which add to
the existing set of examples available in WICED Studio 6.0 or later. Unzipping creates the kits
directory under apps, and adc_measure in the resources\apps directory.
After unzipping, if the projects are not visible in WICED Studio 6.0 (or later), then right-click the
top most folder (43xxx_Wi-Fi) and click Refresh, as shown in Figure 2-3.
Figure 2-3. Refresh Top Folder
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **17
3.Kit Operation
This chapter introduces you to the CYW954907AEVAL1F EVK and the features that will be used as
part of Kit operation. Features such as Wi-Fi connection and programming/debugging are discussed
in this chapter. The chapter also describes the USB-UART that can be used to communicate with the
CYW54907 device on this EVK.
3.1Theory of Operation
Figure 3-1 illustrates the block diagram of the CYW954907AEVAL1F EVK. This board contains
CYW54907 based SiP which is a Type 1PS Wireless module. This module is an embedded network
controller solution from Murata. This board also contains a USB-Serial interface / JTAG programmer
/ debugger. This board features Arduino form-factor compatible headers, which enables Arduino
shields to be plugged on top, extending its capabilities. This board also features two user switches,
two user LEDs, an RJ-45 connector for Ethernet, and a reset switch for the wireless module.
Figure 3-1. Block Diagram of CYW954907AEVAL1F EVK
3.2On-board programmer/Debugger and Serial Interface Chip
An FT-2232-HQ chip is used for onboard programming, debugging and USB-Serial functionality. It
connects to the computer over a USB interface and connects to the CYW54907 based SiP module
over JTAG and UART pins. Alternately, you can use the External JTAG connector (J3) along with
switch SW4 (in all closed positions) in order to use JTAG from connectors such as Olimex.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **18
3.3CYW954907AEVAL1F Kit Connection
The CYW954907AEVAL1F EVK can be powered by the following options:
■ External power supply
■ USB
When using external power supply, you should use a 5 V - 12 V, 2A power supply with 2.1 mm DC
Jack (center pin positive). When powered from USB, there are two logical USB devices: a USBJTAG device and a USB-UART device. Drivers for the CYW954907AEVAL1F EVK are automatically
installed during the WICED SDK installation process. When you connect the kit for first time to your
PC, it will initiate the driver search as shown in Figure 3-2.
Figure 3-2. Driver Software Installation
Kit Operation
3.3.1Verifying Driver Installation
To verify the successful completion of driver installation, perform these steps:
1. Right-click My Computer > Properties.
2. In the System Properties window, select Device Manager.
a. The WICED USB Serial Port is listed under Ports (COM & LPT) as shown in Figure 3-3.
b. The WICED USB JTAG Port is listed under WICED USB JTAG Devices as shown in
Figure 3-3.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **19
Kit Operation
In Figure 3-3, the Device Manager window identifies the WICED USB Serial COM port as COMXX.
The assigned port number varies between systems. If the device displays two WICED USB Serial
Ports (WICED USB Serial port and WICED USB JTAG Port) instead of one, then follow the link mentioned in this post.
Figure 3-3. Verifying Device Driver Installation
3.3.2Troubleshooting
If an error occurred during the automatic driver installation process, the driver may be manually
installed from the following directory: <WICED-SDK>\Drivers\Windows\wiced_uart.
If the CYW954907AEVAL1F EVK does not appear in the Device Manager, verify that the +3V3 LED
is turned ON and check the USB cable.
3.3.3 External Power Supply
The CYW954907AEVAL1F EVK can be supplied using an external power supply (5V-12V, 2A), using
a 2.5 mm DC Jack with center pin positive. When using external power supply and also connecting a
USB cable (for programming/debugging or USB-UART), the voltage on the external power supply
should be greater than that of the USB supply, if not the kit will be actually sourcing its power from
USB rather than the external power supply.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **20
Kit Operation
3.4Building, Programming, and Debugging CYW954907AEVAL1F EVK
3.4.1Building and Programming a Project for CYW954907AEVAL1F in WICED Studio
IDE
To build and program a project for CYW954907AEVAL1F EVK, perform the following steps:
1. To open the WICED IDE on Windows PC, go to Start > All Programs > Cypress > WICED-Stu-
dio.
2. Select 43xxx_Wi-Fi in the WICED Target selector drop-down box as shown in Figure 1-4. Build-
ing a project requires a corresponding make target, located in the Make Target window. All Applications should go under the apps directory. The make target path will contain the directory
hierarchy starting from apps with directory names separated by a period. The project name is
followed by a hyphen and then the platform name. Finally, the actions to be performed after the
build are specified such as download and run. For example, to build, download, and run the
application scan which exists in apps\snip\scan, create the following make target:
snip.scan-CYW954907AEVAL1F download run
This project will periodically scan for Wi-Fi access points and will list them using the serial to USB
connection on the kit.
Note: By default, kit comes pre-programmed with the same snip.scan example.
Perform these steps to create the make target, build, program, and test application scan:
3. Right-click 43xxx_Wi-Fi in Make Target window as shown in Figure 3-4 and click New.
Figure 3-4. Creating New Make Target
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **21
Kit Operation
4. Enter snip.scan-CYW954907AEVAL1F download run in the Target name field and click the OK
button
Note: The list of all commands that can be provided in the Make target is listed in <WICED-SDK
installation directory>/ 43xxx_Wi-Fi/Makefile.
snip.scan-CYW954907AEVAL1F download run indicates the following:
snip = directory inside apps folder
scan = Sub-directory and name of the application to be built. For example, to build the console application under test directory in apps, then use test.console instead of snip.scan.
CYW954907AEVAL1F = Board/platform name
download = Indicates download to target
run = Resets the target and starts execution
5. Double-click (alternately, right-click and select Build Target) the Clean Make Target to remove
any output from the previous build. It is recommended to do Make clean when any new files are
added or removed to the corresponding Target.
Note: Ensure that you have connected CYW954907AEVAL1F EVK to the same PC via USB prior to
executing the build target.
6. Double-click (alternatively right-click and select Build Target) the snip.scan-CYW954907AE-
VAL1F download run make target to build and download it to the CYW954907AEVAL1F EVK.
The project is built and programmed into the CYW954907AEVAL1F EVK, as shown in
Figure 3-5.
Figure 3-5. Successful Build and Program
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **22
Kit Operation
7. To view output messages with a terminal emulation program (such as Tera Term), follow these
steps:
a. Start the terminal emulation program.
b. You will see the following window. Click on Serial and select corresponding COM Port for your
WICED device. Then click on OK
c. In the Terminal Emulator, go to Setup -> Serial port…. Select the correct COM port and Baud
rate as follows.
Note: Exact Port number will vary with the corresponding PC port
d. Press the Reset button (see Figure 1-1) on the CYW954907AEVAL1F EVK to view the appli-
cation start-up messages.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **23
Kit Operation
8. The output of the Terminal Emulation program should be similar to what is shown in Figure 3-6.
Figure 3-6. Console Output
3.4.2Troubleshooting
If a download_dct error message is displayed despite connecting the board, follow the steps outlined in this post.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **24
3.4.3Debugging a Project using Breakpoints
After programming a project, it is possible to debug it in CYW954907AEVAL1F EVK using the built in
debugger.
Note that the scan example used in 3.4.1 Building and Programming a Project for CYW954907AE-
VAL1F in WICED Studio IDE section is also used here. Steps outlined in 3.4.1 Building and Program-
ming a Project for CYW954907AEVAL1F in WICED Studio IDE should be first followed with a slight
change (adding -debug to the
Make Target command and removing run). Instead of
snip.scan-CYW954907AEVAL1F download run
The following make command should be used:
snip.scan-CYW954907AEVAL1F-debug download
If -debug is not added then it will be built for release. The important difference between the debug
and release configurations is optimization. Debug is built with no optimization and release is built
with optimization. It is possible to debug without using debug as well, but with many variables and
lines optimized away, many breakpoints might not get hit.
It should be noted that Breakpoints must be placed after starting a debug session in WICED Studio
5.0 or later. If there are any breakpoints that were created prior to the start of debug session, their
properties must be changed to be enabled for all Threads.
Kit Operation
Perform these steps to debug the project:
1. Execute the make target described above to download the project to the device.
2. Click the arrow next to the Debug icon as shown in Figure 3-7 and select 43xxx-Wi-Fi_De-
bug_Windows. The Confirm Perspective Switch dialog appears; click the Yes button. The Debug
session starts and halts in the start_GCC.s file.
Note:
■ The Confirm Perspective Switch dialog is not displayed if you have previously selected the
Remember my decision checkbox in the Confirm Perspective Switch dialog.
■ If any MakeFile/Build error occurs, then clean (using the Clean make target), re-build, and down-
load to the CYW954907AEVAL1F EVK again. The Debug session starts and halts in the
start_GCC.s file.
■ In the Debug Perspective, the Project explorer window goes away by default. To view the source
files, switch back to the "C/C++" perspective.
■ To switch between perspectives, use the "C/C++" or "Debug" icon at the top right corner of
screen.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **25
Figure 3-7. Debugging Project
Kit Operation
3. Open the scan.c file from the Project Explorer window. Click on the line with WPRINT_AP-
P_INFO( ( "Waiting for scan results...\n" ) ); and press the [Ctrl +Shift+B]
keys on your keyboard. A Blue hollow circle along with a check mark appears next to the line
number, as shown in Figure 3-8.
4. From the main menu, click Run > Resume. Execution will stop at the breakpoint that you added.
To continue after hitting the breakpoint, click Resume again.
5. To disable the breakpoint, press the [Ctrl+Shift+B] keys again on the same line, or deselect the
corresponding checkbox in the Breakpoints window.
Note: If the Breakpoint window does not appear, then choose Window > Show View > Break-
points.
6. To terminate the Debugging session, click Run > Terminate, or click on the red Square icon.
Once you terminate the session, click on "C/C++" in the upper right corner to return to the C/C++
perspective.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **26
Figure 3-8. Placing Breakpoint in Code
Kit Operation
7. If Breakpoints are created prior to starting the current Debug session, they will not be associated
with the current thread and will be indicated with a Blue circle without a check mark. To enable
the Breakpoints in the current thread, associate the properties from the Breakpoints window with
the current thread.
Note: If you do not see any breakpoints in the Breakpoints window, click the Show Breakpoints
Supported by Selected Target icon as shown in Figure 3-9. The breakpoints are displayed.
8. Right-click the desired breakpoint checkbox and click Breakpoint Properties…. Click the
last_built.elf check box, as shown in Figure 3-10. The check mark appears before the actual
breakpoint indicating its association with the current execution.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **27
Figure 3-9. Show Breakpoints Icon
Figure 3-10. Enabling Breakpoint for Current Execution
Kit Operation
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **28
4.Hardware
This chapter describes the CYW954907AEVAL1F EVK hardware and its different blocks, such as
Bootstrap, reset control, Arduino-compatible headers, and module connectors.
The schematic is available at the following location after installing the software from Software Instal-
Bootstrap options available in the CYW954907AEVAL1F EVK are shown in Ta bl e 4- 1. The pins are
sampled at power-on reset (POR) to determine various operating modes. Sampling occurs a few
milliseconds after an internal POR or de- assertion of the external POR. After the POR, each pin
assumes the GPIO or alternative function specified in CYW54907 Alternate GPIO function table in
the CYW54907 Datasheet s(002-19312).
Care should be taken to ensure SPI mode and SDIO Host are not turned on at the same time since
they share the same set of lines. For more information regarding bootstrap options, refer to the
CYW54907 Datasheet (002-19312).
Bootstrap options other than GPIO_7 and GPIO_13, are not available for the user to modify in this
board.
To change Bootstrap options for GPIO_7 and GPIO_13, refer the "Bootstraps, Flash" page of schematics.
Table 4-1. Bootstrap Options Available in CYW954907AEVAL1F EVK
Strap Pull
00
1
0
00
R135=10K to
WLAN_VDDIO
GPIO_1
GPIO_7
GPIO_11
PinStrp Function
gSPI Mode
0 = Enable gSPI Mode
1 = Disable gSPI Mode
WCPU Boot Mode:
0 = TCROM Boot
1 = TCMSRAM Boot
ACPU Boot Mode:
0 = SOCROM Boot
1 = SOCSRAM Boot
Chip defaultBoard Default
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **29
Table 4-1. Bootstrap Options Available in CYW954907AEVAL1F EVK
Hardware
PinStrp Function
GPIO_13
RF_SW_CTRL_5
RF_SW_CTRL_7
RF_SW_CTRL_9
4.2User Switches
There are two user switches available on the board named USER_1 and USER_2. Tab le 4 -2 shows
the Pin names and Enumeration used in WICED for the switches.
Table 4-2. User Switch available on the board
SDIO Mode:
0 = SDIO Device
1 = SDIO Host
Host DAP Clock Sel
1 = Enable XTAL clock for DAP sub system
0 = Disable Use Test clock TCK for DAP sub system
PMU resource initialization mode selection
1 = Mode 1
0 = Mode 2
LPO( Low Power oscillator) Selection:
0 = LPO from HIB (Hibernation Block)
1 = Internal 32KHz LPO
Strap Pull
Chip defaultBoard Default
1
0
00
00
00
R141=10K to
WLAN_VDDIO
Switch
USER_1 (SW3)PWM_5WICED_GPIO_18WICED_BUTTON1
USER_2 (SW1)GPIO_8WICED_GPIO_4WICED_BUTTON2
CYW54907 Pin
Name
WICED_ENUM_ID
Alternate Enumeration in
WICED
Figure 4-1. User Switch Circuit Diagram
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **30
4.3LED
There are two user LEDs available named LED_1 and LED_2. Tab le 4 -3 shows the Pin name and
Enumeration used in WICED for these LEDs.
Table 4-3. User LED Available on the Board
Hardware
SwitchCYW54907 Pin NameWICED_ENUM_ID
LED_1PWM_3WICED_GPIO_16WICED_LED1
LED_2GPIO_9WICED_GPIO_5WICED_LED2
Alternate Enumeration in
Figure 4-2. User LED Circuit Diagram
WICED
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **31
4.4Reset Control
CYW54907 device can be reset using the "Target Reset" switch SW2 or a reset command from the
on-board programmer/debugger and serial interface chip, as shown in Figure 4-3. The CYW54907/
BCM54907 datasheet states that HIB_REG_ON_IN needs to be delayed by at least 2 cycles of the
32.768 kHz clock after VBAT and VDDIO have reached 90% of their final values. To ensure proper
boot up, the RC delay circuit for HIB_REG_ON_IN is essential as shown in Figure 4-4.
Figure 4-3. Reset Circuit Diagram
Hardware
Figure 4-4. HIB_REG_ON_IN RC Delay Circuit
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **32
4.5Ethernet
The Ethernet MAC Controller in the CYW54907 interfaces to an external PHY chip BCM5241 using
the Media Independent Interface (MII) as shown in Figure 4-5. The same signals are also listed in
Ta bl e 4 -4 . CYW54907 also supports Reduced Media Independent Interface (RMII). The controller
can transmit and receive data at 10 Mbps and 100 Mbps.
Table 4-4. CYW54907 EMAC to PHY Chip Connection
SL. NOCYW54907 Pin NameNet Name in SchematicBCM5241 Pin Name
1RMII_G_RXCMII_RXCRXC
2RMII_G_COLMII_COLCOL/ENERGYDET
3RMII_G_CRSMII_CRSCRS/STANDBY
4RMII_G_TXCMII_TXC_RMII_REF_CLKTXC
5RMII_G_TXD0MII_TXD0TXD0
6RMII_G_TXD1MII_TXD1TXD1
7RMII_G_TXD2MII_TXD2TXD2
8RMII_G_TXD3MII_TXD3TXD3
9RMII_G_RXD0MII_RXD0RXD0/PHYAD0
10RMII_G_RXD1MII_RXD1RXD1/ANEN_L
11RMII_G_RXD2MII_RXD2RXD2/F100
12RMII_G_RXD3MII_RXD3RXD3/ISOLATE
13RMII_MDIOMII_MDIOMDIO
14RMII_MDCMII_MDCMDC
15RMII_G_TXENMII_TXENTXEN
16RMII_G_RXDVMII_RXDV_CRS_DVRXDV
17PWM_2PWM_2RESET_L
Hardware
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **33
Figure 4-5. Ethernet MAC Controller to External PHY Connection
Hardware
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **34
4.6Micro SD Connector/Slot
Micro SD connector is connected to the SDIO Interface of CYW54907. CYW54907 supports both
SDIO 3.0 Host and device modes. Figure 4-6 shows the interface between Micro SD connector and
CYW54907. Same signals are also listed in Table 4-5.
Table 4-5. Micro SD Connector signals
SL.NoCYW54907 Based SIP Pin NameMicro SD Connector/Slot Name
1SDIO_DATA_0DAT0
2SDIO_DATA_1DAT1
3SDIO_DATA_2DAT2
4SDIO_DATA_3CD/DAT3
5SDIO_CMDCMD
6SDIO_CLKCLK
7PWM_0DETECT
Figure 4-6. Micro SD Connector Circuit Diagram
Hardware
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **35
4.7JTAG Connector
4.7.1On-board Programmer/Debugger and Serial Interface Chip
The on-board programmer/debugger chip uses JTAG to program/debug CYW54907 based SiP
module.
Ta bl e 4 -6 shows the connection between CYW54907 and On-board Programmer/Debugger chip. In
addition to the connections listed in the table, JTAG_SEL and GPIO_8_TAP_SEL lines have been
pulled high to make sure programming/debugging is enabled through JTAG in in CYW54907.
Table 4-6. Connection between CYW54907 and On-board Programmer/Debugger
Hardware
SL. NoCYW54907 Based SIP Pin Name
1GPIO_2_JTAG_TCKFTDI_JTAG_TCK
2GPIO_3_JTAG_TMSFTDI_JTAG_TMS
3GPIO_4_JTAG_TDIFTDI_JTAG_TDI
4GPIO_5_JTAG_TDOFTDI_JTAG_TDO
5GPIO_6_JTAG_TRST_LFTDI_JTAG_TRST
4.7.2External JTAG
To use External JTAG connector (J3), set all positions in switch SW4 to closed and connect your
external JTAG debugger. Ensure the drivers for the debugger hardware are installed in the same PC
where WICED Studio is installed. When using Olimex connectors, for example Olimex_ARM-USBTINY-H, add "JTAG=Olimex_ARM-USB-TINY- H" in your make target to debug. Figure 4-7 shows
the relevant part of the schematic for connecting an External JTA G dev ice. Figure 4-8 shows the
connection between Olimex and the CYW954907AEVAL1F EVK.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **36
Figure 4-8. JTAG to Olimex Connection
Hardware
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **37
4.8Connectors
4.8.1WICED Header
J6 is the WICED header available on CYW954907AEVAL1F EVK. This is a 44-pin header containing
I2C, SDIO, UART, SPI, PWM lines, and I/Os. Note that some signals are shared with Arduino header
(UART0 Tx/Rx) and On-board Programmer/debugger chip (UART1). Tab le 4 -7 illustrates the J6 pinout.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **39
4.8.2Arduino-Compatible Headers
J9, J13, J12 and J10 are the Arduino headers available in the CYW954907AEVAL1F EVK. Table 4-8
shows the pinout of the Arduino Header. Note the following points while connecting an Arduino
shield to the board:
■ 5V pin of Header (J9) is not connected to the board.
■ The maximum current that an Arduino shield can sink from the board depends on the application
that is running. In general, 100 mA is the worst-case scenario.
■ The Arduino Analog reference is connected to the 3V3 (3.3V) power supply through R21 which is
not populated by default. In other words, the analog reference is not driven by default.
■ An external ADC attached to CYW54907 helps to achieve Analog functionality on the Arduino
headers.
Table 4-8. Arduino Header Pinout
Hardware
Eval Board
Header
J10.1GPIO_0D0N/A
J10.2GPIO_1D1N/A
J10.3GPIO_13D2N/A
J10.4GPIO_7D3WICED_PWM_6
J10.5GPIO_14D4N/A
J10.6GPIO_16D5WICED_PWM_3
J10.7GPIO_15D6WICED_PWM_4
J10.8I2S0_SD_IND7WICED_I2S_1
J12.1I2S1_SD_IND8WICED_I2S_3
J12.2PWM_4D9WICED_PWM_5
J12.3GPIO_11D10WICED_PWM_2
J12.4GPIO_10D11WICED_PWM_1
J12.5GPIO_12D12N/A
J12.6GPIO_9D13WICED_LED2
J12.7GNDGNDN/A
J12.8ARD_AREFAREFN/A
J12.9I2C_1_SDASDAWICED_I2C_2
J12.10I2C_1_SCLSCLWICED_I2C_2
J13.1ARD_AD0A0N/A
J13.2ARD_AD1A1N/A
J13.3ARD_AD2A2N/A
J13.4ARD_AD3A3N/A
J13.5ARD_AD4_SDAA4N/A
J13.6ARD_AD5_SCLA5N/A
J9.1NCNCN/A
J9.2ARD_IOREFIOREFN/A
J9.3ARD_RESETRESETN/A
J9.43V33.3VN/A
CYW54907 Pin
Name/ Kit
Signal Name
ARDUINO Header
Name
WICED
Enumeration
Alternate
Enumeration
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **40
Table 4-8. Arduino Header Pinout
Hardware
Eval Board
Header
J9.5NC5VN/A
J9.6GNDGNDN/A
J9.7GNDGNDN/A
J9.8VIN_EXTVINN/A
CYW54907 Pin
Name/ Kit
Signal Name
ARDUINO Header
Name
WICED
Enumeration
Enumeration
4.9UART Port Configuration on CYW954907AEVAL1F Kit
The CYW54907 has three UART ports: slow UART, fast UART, and GCI UART. Slow UART and GCI
UART are 2-wire interfaces while fast UART is a 4-wire interface that can support up to a 3 Mbps
baud rate. Slow UART is routed to the On-board Programmer/de-bugger chip for UART to USB communication. The UART peripherals are defined in platforms/CYW954907AEVAL1F/plat-form.c. Following table (also available in platforms/CYW954907AEVAL1F/platform.h)
shows the UART pins available on the Kit.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **41
4.10External ADC
CYW54907 does not have any in-built ADC block. Analog measurements from the Arduino header
analog pins is achieved using an external ADC chip (MAX11615) connected to CYW54907 through
an I2C interface (I2C_0 module-Slave Address 0x33). Ta ble 4 -9 lists the connections between
CYW54907 and the external ADC Circuit diagram is shown in Figure 4-9.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **42
4.11PWM
There are six dedicated PWM outputs available on CYW54907. These PWMs can be multiplexed
onto different pins. You can find their definitions in platforms/CYW954907AEVAL1F/plat-form.c inside WICED Studio.
The PWMs can be re-assigned to other pins by changing the first argument of the platform_pw-m_t platform_pwm_peripherals structure in platform.c. Table 4-10 through Tab le 4 -14
show the possible combinations and their Arduino header locations.
Table 4-10. WICED_PWM_1 Combinations
PIN_GPIO_10 (DEFAULT)J12.4Arduino D11 (MOSI)
PIN_GPIO_0J10.1Arduino D0
PIN_GPIO_8−−
PIN_GPIO_12J12.5Arduino D12 (MISO)
PIN_GPIO_14−−
PIN_GPIO_16J10.6Arduino D5
PIN_PWM_0−−
Hardware
Pin MUX SelectionHeader PinHeader Name
Table 4-11. WICED_PWM_2 Combinations
Pin MUX SelectionHeader PinHeader Name
PIN_GPIO_11 (DEFAULT)J12.3Arduino D10
PIN_GPIO_1J10.1Arduino D0
PIN_GPIO_7J10.4Arduino D3
PIN_GPIO_9J12.9Arduino SCK
PIN_GPIO_13J10.3Arduino D2
PIN_GPIO_15J10.7Arduino D6
PIN_PWM_1−−
Table 4-12. WICED_PWM_3 Combinations
Pin MUX SelectionHeader PinHeader Name
PIN_GPIO_16 (DEFAULT)J10.6Arduino D5
PIN_GPIO_8−−
PIN_GPIO_0J10.1Arduino D0
PIN_GPIO_10J12.4Arduino D11 (MOSI)
PIN_GPIO_12J12.5Arduino D12 (MISO)
PIN_GPIO_14−−
PIN_PWM_2−−
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **43
Table 4-13. WICED_PWM_4 Combinations
Pin MUX SelectionHeader PinHeader Name
PIN_GPIO_15 (DEFAULT)J10.7Arduino D6
PIN_GPIO_1J10.1Arduino D0
PIN_GPIO_7J10.4Arduino D3
PIN_GPIO_9J12.9Arduino SCK
PIN_GPIO_11J12.3Arduino D10
PIN_GPIO_13J10.3Arduino D2
PIN_PWM_3−−
Table 4-14. WICED_PWM_5 Combinations
Pin MUX SelectionHeader PinHeader Name
PIN_PWM_4 (DEFAULT)J6.1Arduino A1
PIN_GPIO_0J10.1Arduino D0
PIN_GPIO_8−−
PIN_GPIO_10J12.4Arduino D11 (MOSI)
PIN_GPIO_12J12.5Arduino D12 (MISO)
PIN_GPIO_14−−
PIN_GPIO_16J10.6Arduino D5
Hardware
Table 4-15. WICED_PWM_6 Combinations
Pin MUX SelectionHeader PinHeader Name
PIN_GPIO_7 (DEFAULT)J10.4.4Arduino D3
PIN_GPIO_1J10.1Arduino D0
PIN_GPIO_9J12.9Arduino SCK
PIN_GPIO_11J12.3Arduino D10
PIN_GPIO_13J10.3Arduino D2
PIN_GPIO_15J10.7Arduino D6
PIN_PWM_5−−
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **44
5.Code Examples
This chapter demonstrates the functionality of CYW54907 devices using the CYW954907AEVAL1F
EVK code examples. Download and extract the zip file from the CYW954907AEVAL1F EVK web
page as specified in Software Installation section. The code examples once un-zipped can be
viewed in WICED Studio 6.0 (or later). In addition to the added examples there are already many
apps (snip.gpio, test.console, and so on) that are available in WICED Studio 6.0.
5.1Using Code Examples
Code examples already added can be compiled after creating Make Targets. Refer to Building and
Programming a Project for CYW954907AEVAL1F in WICED Studio IDE for the process of creating
targets.
Create the following three Make Targets in WICED Studio 6.0 (or later):
■ “snip.gpio-CYW954907AEVAL1F download run" for the gpio example which is already
■ “kits.CYW954907AEVAL1F.adc_measure-CYW954907AEVAL1F download run" for the
adc_measure project.
5.2GPIO
5.2.1Project Description
The gpio project demonstrates toggling of LEDs and turning them off when one of the User
switches is pressed.
The gpio project consists of the following files:
■ gpio.c: This file contains the main application function application_start() which is the entry
point and execution of the firmware application.
■ gpio.mk: This is the makefile which adds the source of the application.
5.2.2Hardware Connections
No specific hardware connections are required for this project because all connections are hardwired on the CYW954907AEVAL1F EVK.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **45
5.2.3Verify Output
Perform these steps to verify the output:
Create and run a Make Target for the gpio project using the description specified in Building and
Programming a Project for CYW954907AEVAL1F in WICED Studio IDE.
After initialization of the platform, LEDs will keep flashing (toggling). When a User switch is pressed,
corresponding LED turns off.
The example also prints a message to the debug UART at startup. Open a Terminal Emulation program and connect to the WICED serial port as detailed in step 8 in the section UART Port Configura-
tion on CYW954907AEVAL1F Kit.
5.3Config_join_ping
5.3.1Project Description
The config_join_ping project demonstrates connectivity between CYW954907AEVAL1F EVK
and a Wi-Fi access point. This example is based on existing examples available in the WICED Studio 6.0 (or later) SDK namely, apps/snip/scan, apps/snip/dct_read_write and test/console. On startup, this application shows a console through which the user can enter commands
to scan, configure, join, and ping Wi-Fi access points.
Code Examples
The config_join_ping project consists of the following files:
■ config_join_ping.c: This file contains the main application function application_start()
which is the entry point and execution of the firmware application. It also contains the function
definitions for joining, pinging, printing Wi-Fi configuration, scanning Wi-Fi and the scan result
handler.
■ config_join_ping.mk: This is the makefile which adds the sources, components (in this
application, console and ping are used), and the name of the application. Note that the name of
the makefile must match the name of the project folder for the make process to work properly.
Also, the "NAME" string in the makefile must be unique among all projects in the apps folder.
5.3.2Hardware Connections
No specific hardware connections are required for this project because all connections are hardwired on the CYW954907AEVAL1F EVK.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **46
5.3.3Flow Chart
Figure 5-1 illustrates the config_join_ping flow chart.
Figure 5-1. config_join_ping Flow Chart
Code Examples
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **47
5.3.4Verify Output
Perform these steps to verify the output:
Create and run a Make Target for the config_join_ping project using the description specified in
Building and Programming a Project for CYW954907AEVAL1F in WICED Studio IDE. Open a Termi-
nal Emulation program and connect to the WICED serial port as detailed in step 8 in the section
UART Port Configuration on CYW954907AEVAL1F Kit.
After initialization of the platform, Wi-Fi and other components, the cursor will stop and wait for you to
enter commands.
Type the command help to see the list of available commands as shown in Figure 5-2.
Figure 5-2. Initial Console Output
Code Examples
Type the command scan to find the list of available Wi-Fi access points as shown in Figure 5-3.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **48
Figure 5-3. Scan Output
Code Examples
Type the command config <SSID> <password> . This command writes the given configuration
in the Device Configuration Table (DCT). These values are stored in flash memory on the board.
Type the command print_config to validate if the SSID and password match and are appropriately written in the DCT.
Type the command join. The join command joins the network specified by the SSID and password
from the DCT. Ping the Access point (usually 192.168.1.1) or 8.8.8.8 (IP address of Google, if your
AP is connected to internet) and check if the network is up and responding. The message "PingReply 11ms" is displayed as shown in Figure 5-4.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **49
Figure 5-4. Join and Ping
To disconnect from the access point, use the command disconnect.
Code Examples
The console component maintains a history of commands typed, which can be accessed using the
Up/Down arrow keys.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **50
5.4ADC_measure
5.4.15.4.1 Project Description
This project demonstrates measuring values from the external ADC chip on the board and posting
the values to a web page accessible from the WLAN network. This code example is based on existing code example (apps/demo/temp_control) available in the WICED Studio 6.0 (or later) . On
startup, the adc_measure code example joins the Wi-Fi Access Point specified in the wifi_con-fig_dct.h file and starts a web page where the ADC count is reported.
The project consists of the following files:
■ adc_measure.c: This file contains the main application function application_start() which is the
entry point and execution of the firmware application. It also contains the function definitions for
initializing, conducting ADC measurement, starting the web page, and processing an ADC
update.
■ adc_measure.mk: This is the makefile which adds the sources, components (in this application,
component HTTP_server, device_configuration, Xively, SNTP and Gedday are used) and the
name of the application. It also adds the required resources for the web page which is available in
the resources/apps directory.
■ i2c.c: This file contains the required function definitions for initializing and taking ADC samples
from the external ADC (MAX 11615) available in the CY9W54907AEVAL1F EVK.
■ wifi_config_dct.h: This file contains the Wi-Fi Access Point credentials (SSID and pass
phrase key) and soft AP credentials. Enter the client access point name and password credentials prior to building the application. These are specified as CLIENT_AP_SSID and CLIENT_AP_PASSPHRASE. Note that the security type may also have to be changed if the access
point does not use WPA2 security. The Wi-Fi access point must be connected to the internet to
get the current time using Network Time protocol (NTP). If the Wi-Fi access point is not connected to the internet, then it will assume 00:00:00 UTC time and will start the web page.
Code Examples
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **51
5.4.2Hardware Connections
Connect a potentiometer (10 kΩ) between VCC and GND with the center terminal connected to
channel 1 of the ADC (pin A1 in the Arduino header) as shown in Figure 5-5. If you do not have a
potentiometer to test, then you can connect a wire between VCC and ADC channel 2 (to simulate full
scale) or a wire between GND and ADC channel 1 (to simulate zero scale). Alternately, you can connect an adjustable DC power supply to ADC channel 1.
Figure 5-5. Potentiometer Connection
Code Examples
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **52
5.4.3Flow Chart
Figure 5-6 illustrates the adc_measure flow chart.
Figure 5-6. adc_measure Flow Chart
Code Examples
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **53
5.4.4Access Point Credentials
Enter your credentials (SSID and pass phrase key) in wifi_config_dct.h file. The CLIENT_AP_SSID macro should be updated with your access point's SSID, the CLIENT_AP_PASS-
PHRASE macro should be updated with your access point's pass phrase key, and the
CLIENT_AP_SECURITY macro should be updated with the security type of your access point. This
is "WICED_SECURITY_WPA2 _MIXED _PSK" if the access point uses WPA2-PSK. If the AP uses
different security then choose the correct one defined in
enum wiced_security_t from 43xxx_Wi-Fi\WICED\WWD\include\wwd_constants.h.
5.4.5Verify Output
Create and run a Make Target for the adc_measure project similar to the procedure provided in
Building and Programming a Project for CYW954907AEVAL1F in WICED Studio IDE. If connection
to the Wi-Fi access point is successful, then wait for NTP time request to complete. Output of the terminal program should be similar to the screenshot in Figure 5-7.
Figure 5-7. NTP Success
Code Examples
Enter the IP address as the URL in your web browser, as shown in the terminal output in Figure 5-7.
For example, 10.40.2.134. The browser will show the output as shown in Figure 5-8. It should be
noted that the PC and CYW954907AEVAL1F EVK should be connected to the same access point.
Rotate the potentiometer and verify that the value shown on web page changes accordingly. One
easy way to validate the correct functioning is to rotate the potentiometer to one of the extremes and
observe if the full- scale value appears. In case you do not have access to a potentiometer, then you
can use an adjustable power supply or wires to connect 3.3V and GND to the ADC input alternatively.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **54
Figure 5-8. Webpage
Code Examples
5.5Publish_subscribe_aws
5.5.1Project Description
This project demonstrates publishing a message to a Thing in the Amazon Web Services (AWS)
cloud and subscribing to the same messages. A Thing is a representation of a specific device or log-
ical entity. For more information, refer to the AWS Documentation. This example is based on existing
code example (apps/aws_iot/publish and apps/aws_ iot/subscribe.) available in WICED Studio 6.0
(or later). On startup, the publish_subscribe_aws code example joins a Wi-Fi access point specified
in the wifi_config_dct.h file, connects to AWS, subscribes to the specified topic and then alternately
tries to publish LIGHT ON and LIGHT OFF messages.
The project consists of the following files:
■ publish_subscribe.c: This file contains the main application function application_start()
which is the entry point and execution of the firmware application. It also contains the function
definitions for initializing, publishing and subscribing to AWS.
■ publish_subscribe_aws.mk: This is the makefile which adds the sources, protocols, compo-
nents (in this application, the MQTT component is used) and the name of the application. It also
adds the required resources for the web page which are available in the resources/apps directory. Note that this project uses certificates from apps/aws_iot directory.
■ wifi_config_dct.h: This file contains the Wi-Fi access point credentials (SSID and pass
phrase key) and soft AP credentials. The user should enter the client access point name and
password credentials prior to building the application. These are specified as CLIENT_AP_SSID
and CLIENT_AP_PASSPHRASE. Note that the security type may also have to be changed if the
access point does not use WPA2 security. The Wi-Fi access point must have access to the internet to connect with AWS.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **55
5.5.2Hardware Connections
No specific hardware connections are required for this project because all connections are hardwired on the CYW954907AEVAL1F EVK.
5.5.3Flow Chart
Code Examples
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **56
5.5.4Verify Output
5.5.4.1Set up an AWS Account and Create a Thing, Policy, and Certificate
An AWS account allows you to view AWS account activity, view usage reports, and manage AWS
Security Credentials. When you sign up for AWS, your AWS account is automatically signed up for
all services in AWS, including AWS IoT. You are charged only for the services that you use.
For more information about AWS IOT, see the help pages of AWS here.
To set up a new account, perform these steps:
1. Open https://aws.amazon.com and choose Create an AWS Account.
2. Follow the online instructions. Part of the sign-up procedure involves receiving a phone call and
entering a PIN using the phone keypad.
3. In the Console Home page, select your AWS Region in this example Asia pacific (Singapore) is
used, and choose the AWS IoT service. The AWS IoT Console window appears.
Create a Thing
To create a Thing, perform these steps:
1.In the AWS IoT Console window, choose Manage > Things on the left-hand panel, and then click
the Create button as shown in Figure 5-9.
Code Examples
Figure 5-9. Create Thing
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **57
Code Examples
2. Each Thing is uniquely identified by its name. Assign a name in the Name field, and click the
Create thing button. For example, 54907_aws.
Note: It is possible to exchange messages without a need to create a thing (by having a certificate
with an attached policy), but it is recommended by AWS to create the same.
3. In the created Thing window, click the left arrow to navigate back to the AWS IoT Console win-
dow.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **58
Code Examples
Create a Policy
To create a policy, perform these steps:
1. In the AWS IoT Console window, go to Secure > Policies, and then click the Create button. The
Create a policy window appears.
2. Assign a policy name in the Name field. For example, 54907_policy.
3. In Add statement, specify the Action as iot:*.
4. Assign a Amazon Resource Name (ARN) in the Resource ARN field. To use a wildcard, change
the last part of Resource ARN from "arn:aws:iot:us-east-1:xxxxxxxxxxxx:topic/
replaceWithATopic" to "arn:aws:iot:us-east-1:xxxxxxxxxxxx:*
Notes:
■ Use the region that you selected when you set up your account.
■ Replace xxxxxxxxxxxx with the appropriate value for your ARN.
■ In the ARN name, ensure to change "topic/replaceWithATopic" to "*", where "*" indicates
all topics. If you want to use the certificates only for a specific topic (in our case,
"54907_led_onoff" is the one defined as WICED_TOPIC macro in publish_subscribe.c ), use
the following Resource ARN "arn:aws:iot:us-east-1:xxxxxxxxxxxx:54907_led_onoff".
5. Select the check box Allow Effect and then click the Create button as shown in Figure 5-10.
6. In the created policy window, click to navigate back to the AWS IoT Console window.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **59
Figure 5-10. Create policy
Code Examples
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **60
Code Examples
Create a Certificate for a Thing
To create a certificate, perform these steps:
1. In the AWS IoT Console window, go to Manage > Things, and then click the created Thing (for
example: 54907_aws). The created Thing window appears.
2. In the left navigation pane, click Security and then click the Create certificate button as shown
in Figure 5-11.
Figure 5-11. Create Certificate
3. On the Certificate created page, click the Download button for the certificate and private key to
save each of them to your PC.
Notes:
■ The certificate and private key cannot be revisited later for download and must be saved while
creating the Certificate.
■ Backup the existing <WICED-SDK>\43xxx_Wi-Fi\resources\apps\aws_iot\cli-
ent.cer and rename the downloaded certificate as client.cer in the <WICED-SDK>\43xxx-
_Wi-Fi\resources\apps\aws_iot\.
■ Backup the existing <WICED-SDK>\43xxx_Wi-
Fi\resources\apps\aws_iot\privkey.cer and rename the downloaded private key as
privkey.cer in <WICED-SDK>\43xxx_Wi-Fi\resources\apps\aws_iot\.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **61
Code Examples
4. Click the Activate button and then click the Attach a policy button as shown in Figure 5-12. The
Add authorization to certificate window appears (see Figure 5-13).
Figure 5-12. Activate and Attach policy
5. Select the check box next to the policy you want to choose and then click the Done button, as
shown in Figure 5-13.
Figure 5-13. Select policy
6. In the created policy window, click to navigate back to the AWS IoT Console window.
7. Go to Security > Certificates. The Certificates window appears.
8. Click the created certificate. The Certificate ARN window appears.
9. Click Policies in the left-hand panel to validate if the correct policy is linked.
10. Click Things in the left-hand panel to validate if the correct Thing is linked.
11. Click the specific Thing. The Thing ARN window appears.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **62
12. In left navigation pane, choose Interact.
13. Copy the Endpoint from the HTTPS tab as shown in Figure 5-14
Figure 5-14. Endpoint.
Code Examples
14. Navigate to the publish_subscribe.c file to update the MQTT_BROKER_ADDRESS macro with
the endpoint address copied from HTTPS tab. Remove the first string before "." In endpoint and
replace it with * and copy it to the REGION macro. In this case, it is "*.iot.ap-southeast-
1.amazonaws.com".
15. The created Thing, policy and certificate are used to interact with the AWS IoT.
5.5.4.2Access Point Credentials
Enter your credentials (SSID and pass phrase key) in the wifi_config_dct.h file. The CLIENT_AP_S-
SID macro should be updated with your access point's SSID, the CLIENT_AP_PASSPHRASE macro
should be updated with your access point's pass phrase key and the CLIENT_AP_SECURITY macro
should be updated with the security type of your access point. This is "WICED_SECURITY _WPA2_-MIXED_PSK " if your access point uses WPA2-PSK. If your AP uses different security then choose
correct one defined in enum wiced_security_t from 43xxx_Wi- Fi\WICED\WWD\include\wwd_-constants.h.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **63
5.5.4.3Build, Program, and Verify
Your Wi-Fi access point must be connected to the internet to verify the example. Build and program
the publish_subscribe_aws example using a similar procedure to the one provided in Building,
Programming, and Debugging CYW954907AEVAL1F EVK. Once programmed, the CYW954907AE-
VAL1F EVK will try to connect to AWS IoT and subscribe to the specified topic. After that if you press
switch USER _1 it will turn LED_1 on and off alternatively as shown in Figure 5-15. Note that this is
being done over the cloud. That is, pushing the switch publishes a message to the cloud. The LED
turns on in response to a notification from the cloud. You can also see observe the messages inside
the AWS console itself. In the AWS IoT Console window, go to Dashboard > Messages published
and you should be able to see the number of messages exchanged as shown in
Figure 5-15. Publish_Subscribe Output
Code Examples
Go to Test. Type a topic name and click on Subscribe to topic. Publish to the same topic.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **64
Code Examples
You will see the message published as follows in Monitor section.
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **65
Figure 5-16. Messages Published
Code Examples
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **66
Revision History
Document Revision History
Document Title: CYW954907AEVAL1F Evaluation Kit User Guide
Document Number: 002-22338
RevisionECN#Issue Date
**60106851/2/2018SHJLInitial release
Origin of
Change
Description of Change
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **67
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.