The blog is to run BlueZ stack on a linux host machine to initialize Cypress Bluetooth Controller, which is connected to Ubuntu machine through UART transport. The blog contains the necessary packages to install, the commands to be send to configure the Ubuntu Host
-- CYW920706WCDEVAL Board (recommended to download an empty Application)
-- Linux System/ Linux Machine (preferably Ubuntu)
Plug in the CYW920706WCDEVAL board to the Host Linux Machine(in my case i used a Ubuntu Laptop). Check the dmesg logs to see the device files generated to which the UART transport has bound. In my case, the CYW920706WCDEVAL board had a PUART and HCI UART. Hence, the dmesg displayed two device files.
Eg: dmesg log for enumeration
If the dmesg logs didn't display the device files to which the board had bound, then it could be because the fdti LKM(loadable Kernel Module) was not loaded in the kernel during boot. You could manually add it using the following command.
>>> modprobe ftdi_sio
Check whether the VID and PID parameters of the USB device is getting added to the following file
>>>c/sys/bus/usb-serial/drivers/ftdi_sio/new_id
else add the PID and VID to the file the following location.
>>>echo <vid> <pid> > /sys/bus/usb-serial/drivers/ftdi_sio/new_id
Replug the device back to the host machine and check the dmesg logs to see bonded device files.
After a reboot, the ftdio_sio LKM might get unloaded. To make the LKM load after every reboot, you could define a rule in the rules.d list.
To find about more about adding rules in the rules.d list , check the following page
https://unix.stackexchange.com/questions/226041/adding-usb-device-to-rules-d
Download the necessary packages for Bluez from the link given below and run the following commands. Additional packages contains utilities to check the status of Bluez Daemon.
>>>tar -xvf bluez-5.??.tar.xz
>>>cd bluez-5.??.tar.xz
>>>./configure
>>>make
>>>make install
Additional packages to download are given here.(if they are missing in your system).
>>>sudo apt-get install libdbus-1-dev libudev-dev libical-dev libreadline-dev bluetooth bluez-tools rfkill rfcomm
Once done with the download, check whether the Bluetooth adapter is unblocked.
>>> rfkill list all
>>> rfkill unblock all
Check the status of the corresponding systemd(system daemon) service:
>>>systemctl status bluetooth.service
The daemon can be reloaded with the following commands:
>>>systemctl daemon-reload
>>>systemctl restart bluetooth
Use hciattach command to attach the serial device via HCI UART to the BlueZ stack.
eg:
>>>sudo hciattach /dev/ttyUSB0 -t 10 any 115200 noflow nosleep
The hciattach utility tries to send a HCI reset to the device via the HCI UART. Check the dmesg logs to see the status of HCI reset. If a reset timeout is happening, do a manual reset of the device while the reset commands are being send to the device by the host machine.
Once successful, you are ready to send the hci command using the hcitool utility.
The following picture shows dmesg logs for hciattach. Here, timeout is happening when host tries to send a HCI reset. This can be resolved by manually resetting the device.
Use the following command to check the hci devices
eg:
>>>hcitool dev
Device:
hci0 5C:AC:4C:F8:1F:80
hci1 20:70:6A:20:f4:9B
The following diagram shows the commands to send to determine whether the device has been attached to the hci interface generated in the host.
It also gives further details like the BD address and the traffic the is going in the BT device.
For scanning LE devices:
>>> hcitool -i hci1 lescan
LE SCAN initiated in the interface hci1 created for the new device.
For sending specific HCI commands, use the following format:
>>>hcitool cmd <ogf> <ocf> [parameters]
eg: Write Local Name Command (ocf :HCI_Write_Local_Name -- 0x0013 & ogf: 0x03 )
For HCI Control and Baseband commands <ogf> is 0x03
(ABCD -- 0x41 0x42 0x43 0x44 )
The following picture show the usage of the hcitool cmd
Package Version
v5.4.18-gamera-android-2
Release Date
2020-10-12
Description
Cypress Android release for the broad market based on the NXP Android 10.0.0_2.0.0 release.
This release has been qualified on the NXP i.MX8MQuad Evaluation Kit (EVK) platform.
Customers wishing to leverage the Android Open Source Platform now have an out of the box Android solution for Cypress's connectivity parts.
The release package includes:
* backports-wireless
* cypress-fmac-patches
* firmware
* nvram
* aosp-patches
* utilities
* build.sh
* Cirrent Agent 1.50
* README
Test Environment:
* ARM64 (NXP i.MX8MQuad Evaluation Kit)
* NXP Android 10.0.0_2.0.0
* 4354/45455/43012 Sanity and VTS
Change Log
[2020-10-12]
* Update FMAC drivers
* Upgrade supporting NXP Android NXP to 10.0.0_2.0.0
Show LessPackage Version
v5.4.18-2020_0925
Release Date
2020-09-25
Description
Yocto is a widely used custom embedded Linux distribution creation tool. The Yocto project provides a flexible set of tools and a space where embedded developers worldwide can share technologies, software stacks, configurations, and best practices to create tailored Linux images for embedded and IoT devices, or anywhere a customized Linux OS is needed. This release allows you to enable the Cypress Wi-Fi connectivity software in your Yocto projects, making it easier than ever to get started quickly with the Cypress connectivity software.
Files in this release:
* SD card image (core-image-base-imx6sxsabresd-v5.4.18-2020_0925.wic.tar.gz)
* Yocto script package (cypress-yocto-scripts-v5.4.18-2020_0925.tar.gz)
Change Log
[2020-09-25]
1. Initial Post
Show LessPackage Version
v5.4.18-2020_0925
Release Date
2020-09-25
Description
This is Cypress's Linux brcmfmac driver and firmware support package.
Brcmfmac is an open-source driver project.
Files in this release:
* Backports package (cypress-backports-v5.4.18-2020_0925-module-src.tar.gz)
* Firmware/clm_blob files (cypress-firmware-v5.4.18-2020_0925.tar.gz)
* Cypress fmac patch files (cypress-patch-v5.4.18-2020_0925.tar.gz)
* Device tree files (cypress-devicetree-2020-09-25.tar.gz)
* hostapd/wpa_supplicant patch (cypress-hostap_2_9-2020_0925.tar.gz)
* Cirrent Agent (cypress-cirrent-1.60.tar.gz)
* README
Checksum
fb71c344e705f5bc9fdae3ce0fbfa299f0af0939ff3ec782aeca0308911d830d cypress-fmac-v5.4.18-2020_0925.zip
5642225573606342615849a2a2db04ad5697f35e669313d2b3492cef3aa10813 cypress-backports-v5.4.18-2020_0925-module-src.tar.gz
ce3bb31020e5ffe24fe549802440c137d14a05ad77af3e8e1fb9e184db96ed55 cypress-cirrent-1.60.tar.gz
d5422a4d1348ca619987cd65e99542ef99a6ea8bb531351bcaf90fcf4849dcac cypress-devicetree-2020-09-25.tar.gz
0b3ce60d745975e45ca1197dad8b7dd2618c5b5ccd8327b0ca69ece99b3edb0f cypress-firmware-v5.4.18-2020_0925.tar.gz
17c50c4398ccfb75e6f886483fc460832e90cde1e2058bc58332672b390bc218 cypress-hostap_2_9-2020_0925.tar.gz
44dfc2c35dc202e6a9cfa1ef20a865c737c89cca212d95e3e08b29311194a147 cypress-patch-v5.4.18-2020_0925.tar.gz
Change Log
[2020-09-25]
This Blog gives an insight into compilation of Fmac source for an android platform.
Cross-compilation tool for building the fmac source for android is obtained by fetching the Android NDK package. The Native Development Kit (NDK) along with the Android studio is a set of tools that allow you to leverage C and C++ code in your Android apps. You can use it either to build from your own source code, or to take advantage of existing prebuilt libraries.
However the toolchain provided in the package can be used independently for compiling the FMAC source.
Download the NDK package for your machine type from the following link:
https://developer.android.com/ndk/downloads
Following table is for selecting the toolchain for the architecture of host machine on which cross compilation is being done:
Architecture | Toolchain name |
ARM-based | arm-linux-androideabi-<gcc-version> |
x86-based | x86-<gcc-version> |
MIPS-based | mipsel-linux-android-<gcc-version> |
ARM64-based | aarch64-linux-android-<gcc-version> |
X86-64-based | x86_64-<gcc-version> |
MIPS64-based | mips64el-linux-android--<gcc-version> |
The NDK provides the make-standalone-toolchain.sh
shell script to allow you to perform a customized toolchain installation from the command line.
The script is located in the $NDK/build/tools/
directory, where $NDK
is the installation root for the NDK. An example of the use of this script appears below, where toolchain for arm64 is built.
$NDK/build/tools/make-standalone-toolchain.sh --toolchain=aarch64-linux-android-4.9 --platform=android-21 --install-dir=/tmp/my-android-toolchain
--platform à is to provide the android API level.
For more information on Android API level check the following link:
https://source.android.com/setup/start/build-numbers
Download and unzip the latest FMAC release(at the time of writing the blog) from the following link:
https://community.cypress.com/docs/DOC-20842
(android_v5.4.18-gamera-android-rc2_cy-imx-android-10.0-rc2_REL_PKG)
Once the FMAC driver source is configure and patched, compile can be done using the make utility with appropriate cross-compiler toolchain.
make KLIB=$KERNEL_HOME KLIB_BUILD=$KERNEL_HOME CROSS_COMPILE=$COMPILER_DIR/aarch64-linux-android-4.9/bin/aarch64-linux-android- ARCH=arm64 KCFLAGS=-mno-android defconfig-brcmfmac
$ make KLIB=$KERNEL_HOME KLIB_BUILD=$KERNEL_HOME CROSS_COMPILE=$ COMPILER_DIR/aarch64-linux-android-4.9/bin/aarch64-linux-android- ARCH=arm64 KCFLAGS=-mno-android modules -j4
$cp /v4.14.34-backports/compat/compat.ko
$cp /v4.14.34-backports/net/wireless/cfg80211.ko
$cp /v4.14.34-backports/drivers/net/wireless/broadcom/brcm80211/brcmutil/brcmutil.ko
$cp /v4.14.34-backports/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
Show LessMultiple regulatory and wireless test tools exist from Cypress, module partners and third parties which can help customers get to production. These tools are required for testing on both RTOS and Linux/Android based customer platforms. The tools themselves often exist as either firmware that runs within the customer’s embedded design, or, as a client that runs on the customer’s PC and utilizes an interface exposed on the customer design; several choices below contain both elements.
The following is a list of the most common tools used by Cypress Wi-Fi/Combo and Bluetooth standalone customers:
WL Client utility which interfaces to MFG FW externally through a Linux or PC host
Cypress WLAN client utility (“WL”) is intended for developers who are evaluating and/or testing the Cypress CYW43xx combo and embedded Wi-Fi chip solutions. The WL Client is provided in binary within the FMAC/Linux release and runs from a terminal emulation program (e.g. bash) that is connected to the Android or Linux device's console port. Under RTOS, the provided x86 based executable (WICED/ModusToolbox/STM CubeMX) runs on a PC via a command shell and communicates to the target platform over a standard connection provided on the device under test. Note that for a non-standard Linux and Android platform, the source needs to be re-compiled by Cypress or the module partner for the target ARM Cortex A-Class platform. Often, a successful recompile of WL is not possible and it is advised for the field team to work with the business unit to process an SLA (Software License Agreement) and NDA (Non-Disclosure Agreement) so that WL source can be provided to the customer. Note that the version of WL provided must match the release of the MFG FW being utilized for the testing.
Manufacturing and Test Application (“MFG FW”)
MFG FW runs on the customer design (Wi-Fi Radio) as an embedded application and processes the full suite of “WL” Wi-Fi configuration and test commands sent by the WL Client. Under the Linux/FMAC platform, MFG FW is provided by the module partner. Under RTOS, MFG FW source is provided within the WICED SDK and can be recompiled for other ARM Cortex M-Class processor platforms such at ModusToolbox and ST Micro’s CubeMX. Work is underway to evaluate new methods of distribution for this tool, including a version which eliminates the need for a client. Note that the MFG FW version being used must match the release of WL being utilized for the testing.
WICED Manufacturing Bluetooth Test (“WMBT”)
WICED based Bluetooth testing over HCI on both standalone Bluetooth controllers and Wi-Fi/Bluetooth Combo devices. The WICED Manufacturing Bluetooth test tool (WMBT) is used to test and verify the RF performance of the Cypress SoC Bluetooth BR/EDR/LE devices under WICED. For LE tests, standard procedures from the Bluetooth Core Specification are utilized and support for vendor specific commands (VSCs) is also included. Each test sends a Host Controller Interface (HCI) or WICED HCI command from an application (running on PC) to the device (running an application setup to process the commands) and then waits for an HCI Command Complete event from the device. Within WMBT under WICED, all ancillary dependencies on files such the HCD are handled within the SDK itself.
CyBluetool
OS agnostic (Linux/RTOS) graphical user interface (GUI) version of WMBT. As such, is also used to test and verify the RF performance of the Cypress SoC Bluetooth BR/EDR/LE devices. For LE tests, standard procedures from the Bluetooth Core Specification are utilized and support for vendor specific commands (VSCs) is also included. Each test sends a Host Controller Interface (HCI) command from an application (running on PC) to the device (running an application setup to process the commands) and then waits for an HCI Command Complete event from the device. Note that within CyBluetool, all ancillary dependencies on files such the HCD are handled externally and module partners will provide the necessary files to their customers for the specific module under test.
CySmart
CySmart is a Bluetooth LE host emulation tool for Windows PCs. The tool provides an easy-to-use Graphical User Interface (GUI) to enable customers to test and debug their Bluetooth LE peripheral applications. Requiring a Cypress BLE dongle to emulate a host device in the GAP central role, the tool supports device discovery, connection establishment, pairing and bonding, and provides the ability to access the Generic Attribute Profile (GATT) server database for the PRoC BLE, PSoC4 BLE and the PSoC6 BLE devices as well as the EZ-BLE family of modules.
HCITool
Similar to Cypress’ own CyBluetool, HCITool is BlueZ’s (Third Party) OS agnostic HCI based Bluetooth configuration and test tool. Like the other Bluetooth tools described earlier, the tool also requires access to an HCI port on the customer design to send/receive both standard HCI and VSC commands. Very popular choice on Linux and RTOS based customer platforms.
Cypress is responsible for the maintenance and support of the Cypress based tools. Third parties assume a similar responsibility for their own tools, and Cypress may provide user guides for these tools if it benefits customers. Except for third-party tool, Cypress also is responsible for the distribution of all Bluetooth based configuration and test tools noted in the previous section (i.e. Websites, within SDKs/Software Releases, etc.). Cypress relies on module partners and our own FAEs to distribute MFG FW and the WL Client to their customers.
In addition to the tools noted above, there are multiple documents available from Cypress and our module partners that customers can leverage to navigate the regulatory/test process.
Some of the more utilized documents include:
Cypress Wi-Fi Regulatory Manual: https://www.cypress.com/file/453451/download
Comprehensive Regulatory Guide which includes a regulatory power template that customers should fill out with their designated test house and submit to Cypress L1 after first consulting the module partner they’ve selected.
OTP Programming and NVRAM Development in SDIO Mode: https://www.cypress.com/documentation/application-notes/an214808-otp-programming-and-nvram-development-sdio-mode
Describes the method for creating an nvram.txt file, which is then used to test a new board design, optimize NVRAM values, and program the one-time programmable (OTP) nonvolatile memory in a device that uses a WLAN SDIO host interface. Customers should consult with their module partner and regulatory house before modifying any of the values within the nvram.txt file.
WICED™ Manufacturing Test User Guide: https://www.cypress.com/file/385966/download
For customers going into production, this document explains how to setup production and regulatory testing under WICED by processing WL commands. Commonly used in conjunction with the WL Tool for Embedded 802.11 Systems guide below.
WL Tool for Embedded 802.11 Systems: CYW43xx Technical Information: https://community.cypress.com/docs/DOC-2360
Also for customers going into production, this guide provides a detailed WL command reference which can be leveraged under both Linux/Android and RTOS platforms.
CyBluetool User Guide: https://community.cypress.com/docs/DOC-16475
Used to test and verify the RF performance of the Cypress SoC Bluetooth BR/EDR/LE devices.
CyBluetool User Guide (Murata): https://community.cypress.com/docs/DOC-16907 (located on their private site)
Murata’s created their own version of the CyBluetool User Guide to help better support their customers.
HCI-Based Bluetooth Testing
https://community.cypress.com/docs/DOC-19558
The purpose of this document is to demonstrate the use of common HCI commands needed for Bluetooth radio testing using third-party tool like BlueZ’s HCITool. Note that the commands contained within this document are intended for use with Cypress' own Bluetooth BR/EDR and BLE Controllers and not our competitors devices.
FCC Regulatory Certification Guide (Murata): https://wireless.murata.com/datasheet?/RFM/data/murata_wifi_bt_fcc_guide.pdf
Murata provided guide which walks customers through the regulatory process for both their SIP Reference (Limited Modular) and Full Modular certified modules.
In addition to the list above, there are also regulatory/test documents included within software releases/SDKs (WMBT for Bluetooth testing), provided by third party tool/stack vendors such as BlueZ (HCITool for BT testing)
Cypress or the module partner remains responsible for the regulatory/test documents each produces and provides to customers. Each party provides feedback to one another on the respective documentation, which provides a path for continuous improvement.
Show LessPackage Version
v5.4.18-gamera-android-rc2
Release Date
2020-07-17
Description
Cypress’ first Android release for the broad market based on the Google 2019 Android 10 release. This release has been qualified on the NXP iMX8 platform. Customers wishing to leverage the Android Open Source Platform now have an out of the box Android solution for Cypress’s connectivity parts.
The release package includes:
* backports-wireless
* cypress-fmac-patches
* firmware
* nvram
* aosp-patches
* utilities
* build.sh
* Cirrent Agent 1.50
* README
Test Environment:
* ARM64 (IMX8MQ)
* Android 10.0.0
* 4354 Sanity and VTS
* 43012 VTS
Change Log
[2020-07-17]
Cypress’ connectivity software solutions for Arm® Cortex-A class host processors are designed to support your product’s lifecycle journey from design and part selection through product maintenance, including complex regional radio spectrum regulatory compliance and Wi-Fi Alliance interoperability certifications you need to bring your product to the market quickly.
Show LessPackage Version
v5.4.18-2020_0625
Release Date
2020-06-25
Description
Yocto is a widely used custom embedded Linux distribution creation tool. The Yocto project provides a flexible set of tools and a space where embedded developers worldwide can share technologies, software stacks, configurations, and best practices to create tailored Linux images for embedded and IoT devices, or anywhere a customized Linux OS is needed. This release allows you to enable the Cypress Wi-Fi connectivity software in your Yocto projects, making it easier than ever to get started quickly with the Cypress connectivity software. Bluetooth in Yocto will be released in the near future.
Files in this release:
* SD card image (core-image-base-imx6sxsabresd-v5.4.18-2020_0625.sdcard.tar.gz)
* Yocto script package (cypress-yocto-scripts-v5.4.18-2020_0625.tar.gz)
Change Log
[2020-06-25]
1. Initial Post
Show LessPackage Version
v5.4.18-2020_0625
Release Date
2020-06-27
Description
This is Cypress's Linux brcmfmac driver and firmware support package.
Brcmfmac is an open-source driver project.
Files in this release:
* Backports package (cypress-backports-v5.4.18-2020_0625-module-src.tar.gz)
* Firmware/clm_blob files (cypress-firmware-v5.4.18-2020_0625.tar.gz)
* Cypress fmac patch files (cypress-patch-v5.4.18-2020_0625.tar.gz)
* Device tree files (cypress-devicetree-2020-06-24.tar.gz)
* hostapd/wpa_supplicant patch (cypress-hostap_2_9-2020_0625.tar.gz)
* Cirrent Agent (cypress-cirrent-1.50.tar.gz)
* README
Checksum
d05807b21f089effe3286037793420d61007d697ac9e191ada09896818059767 cypress-fmac-v5.4.18-2020_0625.zip
d560a92bd7b9e06f736b62acfee55d1e9beab0d0f5e1b03f2a0b03938f6e6f2c cypress-backports-v5.4.18-2020_0625-module-src.tar.gz
b02abfd70975fdb082d3525306177ca2b14e35c3748653badb7e1d15f8eb94dc cypress-cirrent-1.50.tar.gz
03b61f7b74513f1bbf3153169a0741bd957a4d0f74e743a7cc53ce6cf0b093de cypress-devicetree-2020-06-24.tar.gz
15f2535d79b0b4d067c8627617e42ca737ea141b9d3987c6c068ee4efb2b1005 cypress-firmware-v5.4.18-2020_0625.tar.gz
86f0e383842be36e17a7ae144d40080c0366af93f2628b98c9bfa2205257719e cypress-hostap_2_9-2020_0625.tar.gz
9fc83faed66dd04d80a8bae76c3f74529e74131381467bacaed275d9b7abda4d cypress-patch-v5.4.18-2020_0625.tar.gz
Change Log
[2020-06-27]