AnyCloud Users Guide

About this document

Scope and purpose

This document helps you understand the ModusToolbox™ any cloud collection of libraries and code examples.

Document conventions




Emphasizes heading levels, column headings, menus and sub-menus


Denotes file names and paths.

Courier New

Denotes APIs, functions, interrupt handlers, events, data types, error handlers, file/folder names, directories, command line inputs, code snippets

File > New

Indicates that a cascading sub-menu opens when you select a menu item

Reference documents

Refer to the following documents for more information as needed:

1 Overview

ModusToolbox™ software is a set of tools to help you develop applications for PSoC™ 6 MCUs. These tools include GUIs, command-line programs, software libraries, and third-party software that you can use in just about any combination you need. One part of ModusToolbox™ is a collection of software libraries that help you rapidly develop Wi-Fi and Bluetooth® applications using connectivity combo devices, such as AIROC™ CYW4343W and CYW43012, with the PSoC™ 6 MCU.

These libraries are based on the industry standard lwIP TCP/IP stack and Mbed TLS network security. They provide core functionality including connectivity, security, firmware upgrade support, and application layer protocols like MQTT for applications that do not use commercial cloud management systems such as Arm Pelion or Amazon AWS IoT Core.

These libraries are intended for customers who have their own cloud device management backend, whether hosted on AWS, Google, Microsoft Azure, or another cloud infrastructure. They enable development with custom or alternative third-party cloud management approaches with a fully open, customizable, and extensible source code distribution. You can modify or extend them to match your needs.

The collection provides features such as the Wi-Fi Connection Manager, a Secure Socket layer, support for application layer cloud protocols, Bluetooth® Low Energy (LE) functionality, and Low Power Assist (LPA). They currently support TCP, MQTT, and HTTP/HTTPS client and server application layer protocols.

2 Getting started

The easiest way to get started is with an example. We provide many any cloud code examples. You can get them by creating a ModusToolbox™ application, or by downloading them from the GitHub website:

  • Creating a ModusToolbox™ application: Inside the ModusToolbox™ Project Creator tool, look for starter applications whose names start with “AnyCloud.” You can also search for “mqtt” or other terms as needed. Refer to the Project Creator user guide for more details.


3 Library Descriptions and Documentation

The ModusToolbox™ any cloud collection of libraries work together to help you easily get your IoT device connected to the cloud. Some of the libraries were written by us, while others use industry standard open source libraries. As you will see later in this document, these can be pulled into a ModusToolbox™ application using the Library Manager tool.

These libraries fit with the core PSoC™ 6 MCU libraries as shown in the following diagram. See Library Dependencies later in this document for how these any cloud libraries are related.


All libraries are available as GitHub repositories. These “repos” contain source files, readme files, and documentation such as an API reference. When you include a library in your ModusToolbox™ application, the repository is downloaded into a shared directory next to the application directory. See the ModusToolbox™ user guide for more details about an application’s structure.

The following subsections provide brief descriptions for the main any cloud libraries, as well as links to the repository where you can find more information about them.

3.1 Wi-Fi Middleware Core (wifi-mw-core)

The wifi-mw-core library bundles the core libraries that any Wi-Fi application needs. These include FreeRTOS, lwIP TCP/IP stack, Mbed TLS, Wi-Fi host driver (WHD), secure sockets interface, configuration files, and associated code to bind these components together.

See for more details.

3.2 Wi-Fi Connection Manager (WCM)

The WCM includes the wifi-mw-core library by default and provides easy to use APIs to establish and monitor Wi-Fi connections on our devices that support Wi-Fi connectivity. The WCM library also provides additional features such as Wi-Fi Protected Setup (WPS).

See for more details.

3.3 Wi-Fi Host Driver (WHD)

The WHD is an independent, embedded driver that provides a set of APIs to interact with our WLAN chips. This firmware product is easily portable to any embedded software environment, including popular IoT frameworks like Mbed OS, Amazon FreeRTOS, etc. So, the WHD includes hooks for RTOS and TCP/IP network abstraction layers. WHD supports the CYW43012, CYW4343W and CYW43438 Wi-Fi + Bluetooth® combo devices.

See for more details.

3.4 anycloud-ota

This library provides support for over-the-air (OTA) update of the application code running on a PSoC™ 6 MCU with CYW4343W or CYW43012 connectivity device, using Wi-Fi or Bluetooth®.

See for more details.

3.5 MQTT

This library includes the open source AWS IoT device SDK embedded C library plus some glue to ensure it works seamlessly in any cloud. It is based on MQTT client v3.1.1 and supports QoS levels 0, 1 and 2. Both secure and non-secure TCP connections can be used.

See for more details.

3.6 Secure Sockets

This includes network abstraction APIs for underlying lwIP network stack and MbedTLS security library. The secure sockets library eases application development by exposing a socket like interface for both secure and non-secure socket communication.

See for more details.

3.7 lwIP

This is a lightweight open-source TCP/IP stack.

See this third-party website for more details:

3.8 MbedTLS

This is an open source, portable, easy to use, readable and flexible SSL library that has cryptographic capabilities implemented for PSoC™ 6 MCUs.

We provide a library that extends MbedTLS to enable hardware-accelerated encryption on PSoC™ 6 MCUs. See for more details.

3.9 Low Power Assistant (LPA)

The LPA is a library and associated settings in the ModusToolbox™ Device Configurator that allow you to configure a PSoC™ 6 Host and WLAN (Wi-Fi / Bluetooth® Radio) device for optimized low-power operation. With LPA you can achieve the most aggressive power budgets by placing the host device into sleep or deep sleep modes while networks are quiet or when there is traffic that can be handled by the connectivity device.

See for more details.

3.10 HTTP Server & HTTP Client

The http-server library provides communication functions for HTTP (Hypertext Transfer Protocol) Server. The HTTP client library can work with the family of our connectivity chips. This library uses the AWS IoT Device SDK HTTP client library and implements the glue layer that is required for that library to work with our connectivity platforms. This library supports RESTful HTTP methods such as HEAD, GET, PUT, POST, DELETE, PATCH, CONNECT, OPTIONS, and TRACE to communicate with any HTTP Server.

See and for more details.

3.11 FreeRTOS

FreeRTOS is a small operating system for microcontrollers. It is supplied as standard C source files built along with the other C files in your project. This repository contains a port of FreeRTOS kernel for PSoC™ 6 and PSoC™ 4 MCUs. FreeRTOS API Documentation is available at FreeRTOS web page.

See for more details.

3.12 Command Console

This library provides a framework to add command console support to your application, including network operations such as scan and join. Support for Wi-Fi, iPerf, and Bluetooth® Low Energy (LE) commands is bundled with this library.

See for more details.

3.13 Enterprise Security

This library provides the capability for our best in class Wi-Fi enabled PSoC™ 6 devices to connect to enterprise Wi-Fi networks. This library implements a collection of the most commonly used Extensible Authentication Protocols (EAP) that are used in enterprise networks.

See for more details.

3.14 Azure C SDK port library

This library implements the port layer for the Azure SDK for Embedded C to work on PSoC™ 6 MCU connectivity-enabled platforms.

See for more details.

3.15 Trusted Firmware-M

Trusted Firmware-M is free software that provides secure world software for Arm Cortex-M processors.

See for more details.

3.16 Bluetooth® Libraries

In addition to the great Wi-Fi support in any cloud, you can use the Bluetooth® LE functionality in the AIROC™ CYW43xxx combo device to enable Bluetooth® LE for your device. For example, it can easily be used to enable Wi-Fi onboarding so that you can safely and quickly connect your device to a Wi-Fi network using Bluetooth® LE to select the network and enter the password.

The Library Manager name for the Hosted Stack library is bluetooth-freertos. The Hosted Stack library includes the BTSTACK library automatically.

See and for more details.

3.17 Smart CoEX

Bluetooth® LE and Wi-Fi operate in the same band, and in some devices, share a single radio. This can cause data transmission on one interface to interfere with the other. Such interference can impact the performance of both Wi-Fi and Bluetooth® LE. In order to avoid such interference, coexistence (coex) configurations and algorithms are introduced in the underlying WLAN and BT stacks. These configurations can be tuned from the application via the configurator to test and improve the performance of underlying Wi-Fi and Bluetooth® LE traffic when they are operated simultaneously.

This library provides an API that enables the application to configure the WLAN and Bluetooth® LE stack with the parameters that were set through the configurator.

3.18 Connectivity Middleware Tools

This section list and describes various tools used for testing and bring-up.

3.18.1 Wi-Fi Bluetooth® Tester

This application integrates the Command Console Library including Wi-Fi iPerf and Bluetooth® LE functionality. You can use this application to characterize the Wi-Fi/ Bluetooth® LE functionality and performance.

See for more details.

3.18.2 WLAN Manufacturing Test Application

The WLAN Manufacturing Test Application is used to validate the WLAN firmware and radio performance of various Wi-Fi chips.

See for more details.

  • WLAN Manufacturing Test Middleware

The WLAN Manufacturing Test Middleware application is used to validate the WLAN firmware and radio performance of Wi-Fi devices.

See for more details.

3.18.3 Wi-Fi Cert Tester Tool

This tool is used for Wi-Fi Certification of 11n, PMF, WPA3 and 11AC. The Wi-Fi cert tester tool uses the command console asset to initialize and invokes wifi-cert middleware init function.

  • Wi-Fi Cert Middleware for All SDKs

The Wi-Fi Cert middleware provides an easy way to test WFA cert test such as 11n, PMF, WPA3 and 11AC across all SDKs providing a common interface for all SDKs.

See for more details.

3.18.4 Bluetooth® MFG tester

The Bluetooth® Manufacturing Test Application is used to validate the Bluetooth® Firmware and RF performance of Bluetooth® BR/EDR/LE devices.

4 Library Dependencies

When you include certain libraries such as wifi-mw-core or WCM, there are dependencies on other libraries to ensure everything works correctly. As an example, the following shows some of the libraries for the any cloud MQTT Client code example and where they come from.


The application includes five .mtb files directly. After the application has been created and processed, it contains numerous different libraries. See Adding Libraries later in this section for more details.

Using the wifi-mw-core library ensures you always have the essential Wi-Fi and networking libraries, plus good default configurations, in every cloud connected application you create.

4.1 Library Manager

The ModusToolbox™ Library Manager tool allows you to add and remove board support packages (BSPs) and libraries, as well as select specific versions of BSPs and libraries. Refer to the Library Manager user guide for more details. As you can see in the following image, the any cloud MQTT Client code example application already includes several libraries.


4.2 Adding Libraries

As noted earlier, when the ModusToolbox™ build system encounters a .mtb file, it adds that library of code to the application. That library may contain additional .mtb files for dependent libraries. The ModusToolbox™ build system parses the .mtb files recursively so that all dependent libraries are added automatically. You do not need to know the dependencies.

The following images show the libraries included as part of an Empty PSoC™ 6 application before and after adding the WCM library.


When adding only the WCM library to the application, several other libraries are automatically included as well (some not shown). The WCM library has its own .mtb file for the wifi-mw-core library which in turn has .mtb files for the libraries it depends upon. The same paradigm applies to various any cloud libraries that have dependencies. If you add an any cloud library that requires other libraries, they will be added automatically.

Dependencies are not necessarily bi-directional. The LPA, WCM, and mbedTLS libraries provide good examples to illustrate this concept. The WCM does not depend upon the LPA. The LPA is optional; so, adding WCM to an application does not add the LPA library. However, the LPA requires the WCM. Therefore, when you add the LPA to an application, the WCM (and all its dependencies) are added automatically. Similarly, the WCM depends upon the MbedTLS library. However, the MbedTLS library does not depend upon the WCM. It has no dependencies of its own.

4.3 Library Reference Tables

The following tables provide links to the libraries and documentation for various other categories that may be related to the any cloud libraries, based on the organization in the Library Manager tool.


Beginning with the ModusToolbox™ 2.2 tools release, we’ve implemented a MTB flow where BSPs and libraries are shared by default. As a result, some new libraries have been created. The old flow, called LIB flow, is still fully supported. For more details about these flows, refer to the ModusToolbox™ Library Manager user guide.

4.3.1 PSoC™ 6 Base Libraries

Library Name/Link


Documentation Link


core- lib

Core Library

API Refere nce

psoc6cm 0p

Arm Cortex M0 Plus Prebuilt Image

Repository readme file

MTB Flow

core-ma ke

Core Make Build System

Repository readme file


Hardware Abstraction Layer

API Reference


Peripheral Driver Library

API Reference

recipe-m ake-cat1a

PSoC™ 6 Make build Recipe

Repository readme file

LIB Flow

psoc6 hal

Hardware Abstraction Layer

API Refere nce

psoc6ma ke

GNU make Build System

Repository readme file

psoc6 pdl

Peripheral Driver Library

API Reference

4.3.2 PSoC™ 6 Middleware

Library Name/Link


Documentation Link



API Reference


C Library Support Functions

API Reference


CAPSENSE™ ADC (voltage)

API Reference


CAPSENSE™ IDAC (current)

API Reference

mbedTLS Acceleration

Infineon PSoC™ 6 MCUs acceleration for mbedTLS library.

Repository readme file


Device Firmware Update

API Reference


Emulated EEPROM

API Reference


SEGGER emWin Graphics Library


freer tos

FreeRTOS Kernel

FreeRTOS web page

MCUb oot

Secure bootloader.

Repository readme file


USB Device Library

API Reference

5 Library Configuration Files

Some libraries provide configuration header file templates, such as the FreeRTOSConfig.h file. When adding a library to an application, copy the configuration file to the top-level application directory where you can edit it to customize the library. Even though there may be multiple files with the same name in an application, the ModusToolbox™ build system automatically picks the one at the top-level.

If you want to put the application-specific configuration files in a different location, you must specify the path to that directory (relative to the application’s root directory) in the application’s Makefile INCLUDE variable. The build system includes files in that path before it searches through the application’s hierarchy.

The following are some examples of configuration files that you may need:

5.1 Wi-Fi Middleware Core

The template files are in the wifi-mw-core/configs subdirectory. See also the Quick Start in the library’s file (

  • FreeRTOSConfig.h: Settings for FreeRTOS.

Use this file as a template for FreeRTOS configuration instead of the one from the FreeRTOS library. It has some modifications specific to any cloud.

  • mbedtls_user_config.h: Settings for Mbed TLS.

In addition to copying this file, you must also configure the macro MBEDTLS_USER_CONFIG_FILE to specify the file’s location and add the macro to the list of DEFINES in the application’s Makefile. For example, if you put the file in the top level, you would include this in the Makefile:


Note that many code examples use this format instead:


  • lwipopts.h: Settings for lwIP. Applications may choose to modify this file in order to optimize memory consumption based on the Wi-Fi characteristics of the application.

5.1.1 Optimizing Smaller Memory Devices

Depending on your application or device size, you may need to reduce flash and RAM usage. The configuration files included with the lwIP and MbedTLS libraries provide various parameters to enable or disable features and optimize your application’s size. For example, the MBEDTLS_SSL_SRV_C parameter enables code when the device is expected to function as a SSL/TLS server. If you don’t need this feature, you can disable it to save flash:


Refer to the Wi-Fi Middleware Core documentation ( for specific details about the parameters to adjust.

5.2 MQTT

The template file is in the mqtt/include subdirectory. See also the Quick Start in the library’s file (

  • core_mqtt_config.h: Settings for MQTT.

5.3 OTA

The template file is in the anycloud-ota/configs subdirectory. See also the library’s file (

  • cy_ota_config.h: Settings for OTA.

6 Supported Devices

The any cloud collection of libraries supports the PSoC™ 62S1 (1 M), PSoC™ 62S2 (2 M), and PSoC™ 62S3 (512 k), as well as some PSoC™ 64 Secure MCUs; however, smaller flash devices do not support all use cases or examples. When selecting examples or implementing your application, take the following into account:

  • PSoC™ 62S1 and PSoC™ 62S3 do not support OTA. This support will be added in future releases.

  • Command Console cannot have all features enabled on PSoC™ 62S1 and PSoC™ 62S3 due to low memory footprint. The command framework feature to add application/product use-case-specific commands is supported on these devices. Read the documentation for more information.

  • Read about optimizing Mbed TLS and lwIP for your particular use cases in Optimizing Smaller Memory Devices.

7 Working with Examples

As described previously, the best way to learn is to download some examples and work through them. The examples include files that guide you through the process to create and configure the application.

If you’re already familiar with ModusToolbox™ software, then create the any cloud TCP Client example using your normal process. If you’re new to ModusToolbox™ software, use the Eclipse IDE for ModusToolbox™. Refer to the Eclipse IDE quick start guide as needed.

After creating the application, open the Library Manager and notice that several of the any cloud libraries discussed in this guide are already present.


Then, create another application from an example, such as any cloud WLAN Low Power. Notice for this application that the LPA library is included.

Experiment with a few examples, and notice the differences in the libraries included, as well as various configuration options set for them. Obviously, review the code as well.

8 Adding and Configuring Low Power

The any cloud WLAN Low Power example is one of several that demonstrate the low power features in ModusToolbox™ software. Among the low power features are the power settings accessible in the Device Configurator.


There are settings for the PSoC™ 6 MCU and the connectivity combo device. For more details about how to configure low power, refer to the LPA Guide here:

9 Adding and configuring Bluetooth®

As you have probably already discovered, there are several Bluetooth® examples as well. For example, the any cloud Wi-Fi Onboarding Using Bluetooth® LE shows how to use Bluetooth® on the combo device to help connect the Wi-Fi device to an access point. It also shows how to enable low-power modes on both the Wi-Fi and Bluetooth® devices. For more details, refer to the example’s file.

Revision history

Revi sion




06/29 /2020

New document.


10/05 /2020

Updated the libraries.

Added optimizing smaller memory devices.

Added supported devices.


10/23 /2020

Updated diagram to remove ble-ota.


12/20 /2020

Added http and coex.


05/11 /2021

Updated for version 1.4 changes.


05/24 /2021

Updated for version 1.4.1 changes.


10/05 /2021

Updated for version 1.5 changes.


12/15 /2021

Updated for fiscal Q1 2022.