This application note demonstrates execution of the demo iPerf application available for the SAM4S
Xplained Pro evaluation kit and ATWINC15x0. The iPerf application is a tool which is used for measuring
Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) bandwidth performance. This
iPerf tool is built on a client/server model and can be used to measure maximum UDP and TCP
throughput between the client and the server station.
Prerequisites
The following are the hardware and software prerequisites to test the TCP and UDP throughput using the
iPerf application for the ATWINC15x0.
Hardware Prerequisites
•ATSAM4S XPRO Board
•ATWINC15x0
•Access Point (AP)
•PC/Laptop
Software Prerequisites
•iPerf application 2.0.5 for iPerf client running on PC/Laptop
The user can run the iPerf application using the command prompt on a computer and the customized
iPerf implementation on the wireless board to measure the throughput performance. The iPerf application
contains both client and server functionality. Typically, one acts as server and the other as client, where
the iPerf application in the client side launches the test session.
The iPerf application running in the ATSAM4S XPRO board operates in the Server mode and waits to
accept the client’s connection before it initiates the bandwidth test.
1.1 SAM4S Xplained Pro
The SAM4S Xplained Pro evaluation kit is a hardware platform to evaluate the ATSAM4SD32C
microcontroller, supported by the Atmel Studio integrated development platform. The SAM4S Xplained
Pro evaluation kit is ideal for evaluation and prototyping with the SAM4S Cortex®-M4 processor-based
microcontroller. The Xplained Pro MCU series evaluation kits include an on-board Embedded Debugger,
and no external tools are necessary to program or debug the SAM4SD32C. The Xplained Pro extension
series evaluation kit offers additional peripherals to extend the features of the board and ease the
development of custom designs.
2. Creating ATWINC15x0 iPerf Project in Atmel Studio
The demo iPerf application for the SAM4S Xplained Pro with the ATWINC15x0 is available in ASF
Version 3.42 and all upcoming versions. Before creating a new iPerf project, verify the version of both the
ATWINC1500 driver and firmware being used. The ATWINC1500 firmware version needs to be equal or
higher to its driver version. The firmware upgrade details are detailed in the Appendix.
This section explains the steps for demonstrating ATWINC15x0 projects using Atmel Studio ASF example
applications.
Note: The iPerf application for SAM4S, SAMG55, SAMG53, and SAMD21 is available in ASF. In this
Application Note, iPerf application for the SAM4S is used as a reference.
1.Open Atmel Studio 7.
2.Navigate to File>New>Example Projects.
3.Search for iperf sample application for other MCU's.
4.Select the WINC1500 Iperf Example – SAM4S Xplained Pro.
Figure 2-1. Atmel Studio ATWINC1500 Project Creation
ATWINC15x0
The directory structure for iPerf application is illustrated in following figure.
To connect to the access point, the Station mode requires the Wi-Fi credentials, such as SSID and
Security type. For this demo, WPA-PSK is used as an example. The following are the steps to configure
and load the iPerf application.
1.Open the WINC1500_IPERF_SERVER_EXAMPLE1 project.
2.Configure the AP credentials; SSID and password in the iperf.h file.
Configure the AP based on the supported security methods.
To set a security type, in the iperf.h file configure IPERF_WIFI_M2M_WLAN_AUTH macro as
mentioned. The corresponding AP's SSID must be filled with IPERF_WIFI_M2M_WLAN_SSID
macro as given.
The iPerf application is available as an open source or executable binaries for many operating systems.
The following are the steps to install the iPerf application.
1.Download the iPerf 2.0.5 application from https://iperf.fr/ and save in the desired location.
2.Unzip the downloaded file to get the executable file.
3.Open command prompt in the folder path where this executable file is located.
4.1 iPerf Commands
By default, iPerf clients open a connection with the iPerf server which is typically listening at port 5001 at
specified destination. The commonly used iPerf commands are listed in the following table. For additional
commands, see https://iperf.fr/iperf-doc.php.
Table 4-1. iPerf Commands
CommandDescription
ATWINC15x0
Installing iPerf Application
-f
-i
-s
-u
-b
-c
-r
-t
Format to report; Kbits, Mbits, KBytes, and
MBytes.
Interval between periodic bandwidth reports in
seconds.
Runs in the Server mode.
Runs in the single threaded UDP mode and
specific to client.
Bandwidth to send in bits/sec.
-u indicates the default value as 1 Mbit/sec.
Runs in the client mode, connecting to host.
Individual bidirectional test.
Time in seconds to transmit. The default value is
10 secs.
The iPerf application can be executed by configuring one system as client and the other as server. The
iPerf application in ASF can work both as server and client. The demo application running in the SAM4S
Xplained Pro evaluation kit works in the Server mode and waits to accept the client’s connection before
initiating the bandwidth test. The client needs to know the IP address of the target server and
communicates with the iPerf server located at the specified IP address.
For example, the server with IP address 192.168.1.100 can be run with the TCP test, using the following
command:
iperf -c 192.168.1.100 -t 20 -i 1 -r
•-t is time in seconds to transmit (default 10 secs)
•-i is the interval between periodic bandwidth reports in seconds
•-r on the client’s command line instructs iPerf to measure bi-directional throughput sequentially,
that is, upstream and downstream
Figure 5-1. Log Output
ATWINC15x0
Executing iPerf Application
To run the UDP test, add two additional arguments as shown in the following:
iperf -c 192.168.1.100 -t 20 -i 1 -u -b 1G
•u indicates single_udp run in single threaded UDP mode
The iPerf application testing is not limited to any specific test setup. To observe the variation in throughput
results, tests are carried out in different test setups and results are captured as following.
•Setup 1 – PC is connected via Ethernet to AP and ATWINC15x0 is connected via Wi-Fi to AP.
Figure 6-1. Setup 1
For test result, see 7. Test Results.
•Setup 2 – Both PC and ATWINC15x0 are connected to AP via Wi-Fi.
Figure 6-2. Setup 2
ATWINC15x0
Test Setup
For test result, see 7. Test Results.Note: The throughput results measured in setup 2 will be comparatively lower. The aim of this test
setup is to show an alternate method to measure the throughput. To achieve better results, follow
the setup 1.
•Setup 3 – AP mode.
In the AP mode, the ATWINC15x0 acts as a SoftAP and provides the provision for other device to
connect to it and assigns IP address to the connected device.
Figure 6-3. Setup 3
For test result, see 7. Test Results.
The iPerf throughput varies as per the configuration. To record the maximum achievable throughput, the
test is conducted in different environments. To observe the variation in throughput, tests are carried out by
varying configuration and security methods. This test setup is repeated with different wireless modes
b/g/n.
To regulate the throughput value, configuration changes are made only with setup 1. This test results can
be taken as a reference and similar changes in throughput can be expected in other modes which have
different environments.
The ATWINC15x0 iPerf throughput performance is measured in the following conditions.
Table 6-1. Conditions to Measure ATWINC15x0 iPerf Throughput Performance
ConditionParameters
Firmware configuration•Security: Open, WPA. WPA2, and Enterprise
•DMA Enabled
•DMA Disabled
•SPI communication frequency 48 MHz/
20MHz
Environment•Inside shielded box
•Two setups in shield box (same frequency)
•Open air (Moderate, Extreme)
AP configurationb/g/n
6.1 Throughput Test Result Dependency Parameters
6.1.1 Direct Memory Access
The Direct Memory Access (DMA) can transfer data between memories and peripherals, and off-load
these tasks from the CPU. Therefore, DMA enables high data transfer rates with minimum CPU
intervention and frees-up CPU time.
By default, Direct Memory Access (DMA) is enabled for the demo iPerf application. The DMA is
implemented in the application using CONF_WINC_SPI_DMA_ENABLE macro. This macro is implemented
in the conf_winc file in the configuration folder.
To disable the DMA, comment out the CONF_WINC_SPI_DMA_ENABLE macro definition.
6.1.2 SPI Communication Frequency
Varying the SPI communication frequency also has a direct impact in the throughput values. The SPI
frequency can be changed using the macro defined in the conf_winc.h.
The ATWINC15x0 firmware must be updated to 19.6.1 version or latest. When a version mismatch is
detected at start-up, the Wi-Fi driver initialization fails and the m2m_wifi_init() function returns the
firmware version mismatch error code.
Figure 8-1. Firmware Mismatch Error
ATWINC15x0
Appendix - Updating Firmware
To update the firmware in the ATWINC15x0 module, use the firmware upgrade project available in ASF.
For more details on the firmware upgrade procedure, refer the Integrated Serial Flash and Memory
Microchip provides online support via our web site at http://www.microchip.com/. This web site is used as
a means to make files and information easily available to customers. Accessible by using your favorite
Internet browser, the web site contains the following information:
•Product Support – Data sheets and errata, application notes and sample programs, design
resources, user’s guides and hardware support documents, latest software releases and archived
software
•General Technical Support – Frequently Asked Questions (FAQ), technical support requests,
online discussion groups, Microchip consultant program member listing
•Business of Microchip – Product selector and ordering guides, latest Microchip press releases,
listing of seminars and events, listings of Microchip sales offices, distributors and factory
representatives
Customer Change Notification Service
Microchip’s customer notification service helps keep customers current on Microchip products.
Subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata
related to a specified product family or development tool of interest.
To register, access the Microchip web site at http://www.microchip.com/. Under “Support”, click on
“Customer Change Notification” and follow the registration instructions.
Customer Support
Users of Microchip products can receive assistance through several channels:
•Distributor or Representative
•Local Sales Office
•Field Application Engineer (FAE)
•Technical Support
Customers should contact their distributor, representative or Field Application Engineer (FAE) for support.
Local sales offices are also available to help customers. A listing of sales offices and locations is included
in the back of this document.
Technical support is available through the web site at: http://www.microchip.com/support
Microchip Devices Code Protection Feature
Note the following details of the code protection feature on Microchip devices:
•Microchip products meet the specification contained in their particular Microchip Data Sheet.
•Microchip believes that its family of products is one of the most secure families of its kind on the
market today, when used in the intended manner and under normal conditions.
•There are dishonest and possibly illegal methods used to breach the code protection feature. All of
these methods, to our knowledge, require using the Microchip products in a manner outside the
operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is
engaged in theft of intellectual property.
•Microchip is willing to work with the customer who is concerned about the integrity of their code.
•Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their
code. Code protection does not mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the
code protection features of our products. Attempts to break Microchip’s code protection feature may be a
violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software
or other copyrighted work, you may have a right to sue for relief under that Act.
Legal Notice
Information contained in this publication regarding device applications and the like is provided only for
your convenience and may be superseded by updates. It is your responsibility to ensure that your
application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY
OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS
CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE.
Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life
support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend,
indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting
from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual
property rights unless otherwise stated.
Trademarks
The Microchip name and logo, the Microchip logo, AnyRate, AVR, AVR logo, AVR Freaks, BitCloud,
chipKIT, chipKIT logo, CryptoMemory, CryptoRF, dsPIC, FlashFlex, flexPWR, Heldo, JukeBlox, KeeLoq,
Kleer, LANCheck, LINK MD, maXStylus, maXTouch, MediaLB, megaAVR, MOST, MOST logo, MPLAB,
OptoLyzer, PIC, picoPower, PICSTART, PIC32 logo, Prochip Designer, QTouch, SAM-BA, SpyNIC, SST,
SST Logo, SuperFlash, tinyAVR, UNI/O, and XMEGA are registered trademarks of Microchip Technology
Incorporated in the U.S.A. and other countries.
ClockWorks, The Embedded Control Solutions Company, EtherSynch, Hyper Speed Control, HyperLight
Load, IntelliMOS, mTouch, Precision Edge, and Quiet-Wire are registered trademarks of Microchip
Technology Incorporated in the U.S.A.
Adjacent Key Suppression, AKS, Analog-for-the-Digital Age, Any Capacitor, AnyIn, AnyOut, BodyCom,
CodeGuard, CryptoAuthentication, CryptoAutomotive, CryptoCompanion, CryptoController, dsPICDEM,
dsPICDEM.net, Dynamic Average Matching, DAM, ECAN, EtherGREEN, In-Circuit Serial Programming,
ICSP, INICnet, Inter-Chip Connectivity, JitterBlocker, KleerNet, KleerNet logo, memBrain, Mindi, MiWi,
motorBench, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient
Code Generation, PICDEM, PICDEM.net, PICkit, PICtail, PowerSmart, PureSilicon, QMatrix, REAL ICE,
Ripple Blocker, SAM-ICE, Serial Quad I/O, SMART-I.S., SQI, SuperSwitcher, SuperSwitcher II, Total
Endurance, TSHARC, USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA, and ZENA are
trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries.
GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of
Microchip Technology Inc., in other countries.
All other trademarks mentioned herein are property of their respective companies.
2018, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved.
ISBN: 978-1-5224-3966-0
Quality Management System Certified by DNV
ISO/TS 16949
Microchip received ISO/TS-16949:2009 certification for its worldwide headquarters, design and wafer
fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures are for its PIC® MCUs and dsPIC
DSCs, KEELOQ® code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design and manufacture of development
systems is ISO 9001:2000 certified.