Ublox EMMY-W1, LILY-W1, JODY-W2 User Manual

Fi and Bluetooth modules with
W1 module with
Android integration for NXP­based modules
EMMY-W1, LILY-W1 and JODY-W2
Application note
Abstract
This document describes the procedures for integrating u-blox Wi­Android BSP. Based on an example that describes how to integrate the EMMY­Android 9, the same procedures are also relevant for integrating other u-blox modules based on NXP chipsets with different Android versions.
UBX-19035432 - R02 C1-Public www.u-blox.com
Android integration for NXP-based modules - Application note
u-blox or third parties may hold intellectual property rights in the products, names, logos and designs included in this document. Copying, reproduction, modification or disclosure to third parties of this document or any part thereof is only permitted with the express written permission of u The information contained herein is provided “as is” and u implied, is given, including but not limited purpose of the information. This document may be revised by u documents, visit www.u Copyright © u

Document information

Title Android integration for NXP-based modules
Subtitle EMMY-W1, LILY-W1 and JODY-W2
Document type Application note
Document number UBX-19035432
Revision and date R02 8-Sep-2020
Disclosure restriction C1-Public
This document applies to the following products:
Product name Firmware version (tested) Product status
EMMY-W1 SD-WLAN-UART-BT-8887-U16-MMC-W15.44.19.p36-15.100.19.p36-C4X15657_A2-GPL
SD-WLAN-SD-BT-8887-U16-MMC-W15.68.19.p38-15.26.19.p38-C4X15659_A2-MGPL
LILY-W1 SD-UAPSTA-8801-U16-X86-W14.68.36.p146-C4X14666_B0-MGPL
USB-UAPSTA-8801-U16-X86-W14.68.36.p146-C4X14666_B0-MGPL
JODY-W2 SD-WLAN-UART-BT-8987-U16-MMC-W16.87.10.p33-16.26.10.p33-C4X16651-MGPL
SD-WLAN-SD-BT-8987-U16-MMC-W16.68.10.p33-16.26.10.p33-C4X16651-MGPL
Mass production
Mass production
Engineering Sample
UBX-19035432 - R02 Document information Page 2 of 40 C1-Public
-blox AG.
-blox.com.
to, with respect to the accuracy, correctness, reliability and fitness for a particular
-blox.
-blox assumes no liability for its use. No warranty, either express or
-blox at any time without notice. For the most recent
Android integration for NXP-based modules - Application note

Contents

Document information ................................................................................................................................ 2
Contents .......................................................................................................................................................... 3
1 Introduction ............................................................................................................................................. 5
1.1 Scope ............................................................................................................................................................. 5
1.2 Workflow ....................................................................................................................................................... 6
2 Components and device setup .......................................................................................................... 7
2.1 Host platform ............................................................................................................................................... 7
2.2 Setup ............................................................................................................................................................. 8
2.3 Build system ................................................................................................................................................. 8
2.4 Software packages ..................................................................................................................................... 8
2.4.1 Android Open Source Project ........................................................................................................... 8
2.4.2 Driver package ..................................................................................................................................... 9
2.4.3 Vendor HAL ........................................................................................................................................ 11
3 Wi-Fi integration ................................................................................................................................. 12
3.1 Wi-Fi architecture ..................................................................................................................................... 12
3.2 Components ............................................................................................................................................... 13
3.2.1 Manifest ............................................................................................................................................. 13
3.2.2 Driver source ...................................................................................................................................... 14
3.2.2.1 Build driver ................................................................................................................................. 14
3.2.3 Firmware binary ................................................................................................................................ 16
3.2.4 Vendor HAL ........................................................................................................................................ 16
3.3 Integration with Android .......................................................................................................................... 17
3.3.1 Driver and HAL selection ................................................................................................................. 17
3.3.2 Enable HAL library ............................................................................................................................ 17
3.3.3 File placement ................................................................................................................................... 17
3.3.4 Additional packages ......................................................................................................................... 17
3.3.5 Define interfaces ............................................................................................................................... 18
3.3.6 Starting supplicant .......................................................................................................................... 18
3.3.7 Loading the Wi-Fi driver .................................................................................................................. 19
3.3.8 Patching the SE Linux policy .......................................................................................................... 20
4 Bluetooth integration ........................................................................................................................ 21
4.1 Bluetooth architecture ............................................................................................................................. 21
4.2 Components ............................................................................................................................................... 21
4.2.1 Driver source ...................................................................................................................................... 21
4.3 Integration with Android .......................................................................................................................... 22
4.3.1 Makefile changes .............................................................................................................................. 22
4.3.2 BT interface configuration .............................................................................................................. 22
4.3.3 SE-Linux labelling ............................................................................................................................. 22
4.3.4 Permission settings ......................................................................................................................... 22
4.3.5 Additional packages ......................................................................................................................... 23
UBX-19035432 - R02 Contents Page 3 of 40 C1-Public
Android integration for NXP-based modules - Application note
5 Integrating SDIO-SDIO driver ......................................................................................................... 24
5.1 Driver sources and compilation .............................................................................................................. 24
5.2 Integration with Android .......................................................................................................................... 25
5.2.1 File placement ................................................................................................................................... 25
5.2.2 Loading the driver ............................................................................................................................. 25
5.2.3 Configuring the Bluetooth interface ............................................................................................. 25
5.2.4 SE-Linux labelling ............................................................................................................................. 26
5.2.5 Permission settings ......................................................................................................................... 26
5.2.6 Patch the Bluetooth code................................................................................................................ 26
6 Flashing the image ............................................................................................................................. 27
6.1 Download and build UUU ......................................................................................................................... 27
6.2 Flashing the eMMC using Linux machine ............................................................................................ 27
6.3 Flashing the eMMC on Windows PC ..................................................................................................... 28
7 Validation .............................................................................................................................................. 29
7.1 Wi-Fi bring up ............................................................................................................................................. 29
7.2 Station mode.............................................................................................................................................. 31
7.3 Access point mode .................................................................................................................................... 32
7.4 Throughput measurements ................................................................................................................... 32
7.5 Wi-Fi Direct ................................................................................................................................................. 33
7.6 Bluetooth bring up .................................................................................................................................... 34
7.7 Bluetooth verification ............................................................................................................................... 35
Appendix ....................................................................................................................................................... 37
A Glossary ................................................................................................................................................. 37
Related documentation ........................................................................................................................... 38
Revision history .......................................................................................................................................... 39
Contact .......................................................................................................................................................... 40
UBX-19035432 - R02 Contents Page 4 of 40 C1-Public
Android integration for NXP-based modules - Application note
Module
Interface
Driver package
SD-WLAN-SD-BT-8887-U16-MMC-W15.68.19.p38-15.26.19.p38-C4X15659_A2-MGPL
SDIO-UART
SDIO-UART
SD-WLAN-UART-BT-8987-U16-MMC-W16.87.10.p33-16.26.10.p33-C4X16651-MGPL

1 Introduction

u-blox have integrated and tested several modules, based on NXP1 chipsets, with different Android versions. This application note describes the essential procedures for integrating NXP-based u-blox modules with Android 9 or above.
Although this document describes how to integrate the EMMY-W1 module with Android 9 using SDIO-UART driver package, the given procedures are also relevant for integrating other NXP-based u­blox modules.
Section 3 and section 4 explain the procedures for integrating Wi-Fi and Bluetooth using SDIO and UART, respectively.
Section 5 describes the additional changes that are required for designs that use the SDIO interface for both radios.
The Android package is provided by the host platform vendor. In this case, NXP semiconductors
who manufacture i.MX8 EVK platforms. The package is a customized version of the Android open source package 9.0.0_2.3.4.
The procedures described in this document are applicable to all u-blox modules based on NXP
chipsets – regardless of the Android package.
All vendors that manufacture host platforms for Android development must provide the
appropriate set of kernel package and Android sources.
Platform vendors normally integrate at least one Wi-Fi module with their manufactured platform.
Before starting any integration of u-blox modules, be sure to read the user guide for the EVK [2] and host platform.
The supported module interfaces and the drivers used to test them are shown in Table 1.
EMMY-W1
LILY-W1
JODY-W2
Table 1: Driver packages used for tested interfaces
SDIO-SDIO
SD-WLAN-UART-BT-8887-U16-MMC-W15.44.19.p36-15.100.19.p36-C4X15657_A2-GPL
USB USB-UAPSTA-8801-U16-X86-W14.68.36.p146-C4X14666_B0-MGPL SDIO SD-UAPSTA-8801-U16-X86-W14.68.36.p146-C4X14666_B0-MGPL SDIO-SDIO SD-WLAN-SD-BT-8987-U16-MMC-W16.68.10.p33-16.26.10.p33-C4X16651-MGPL

1.1 Scope

Several regular use cases supported by Wi-Fi and Bluetooth, including station mode, access point, peer to peer and BT connection, are routinely tested against the interfaces supported by u-blox modules.
1
Earlier chipsets were sold under the banner of Marvell Semiconductors. After the acquisition, the packages and libraries are
renamed with NXP as the vendor.
UBX-19035432 - R02 Introduction Page 5 of 40 C1-Public
Android integration for NXP-based modules - Application note
u-blox have used the following hardware and software components for the integration:
Android BSP: Android_9.0.0_2.3.4
Host platform: i.MX8 MQ EVK
Short range host-based module: EMMY-W1 (SDIO-UART)
Driver: SD-WLAN-UART-BT-8887-U16-MMC-W15.44.19.p36-15.100.19.p36-C4X15657_A2-
GPL
Wireless HAL: NXP Vendor HAL - v005
The main body of this document is primarily targeted towards the integration of the module
through the SDIO-UART interface. For information describing integration of the module through the SDIO-SDIO interface, see section 5. When integrating u-blox modules based on NXP chipsets, make sure that you have access to the appropriate System integration manual (SIM) and Data sheet (DS) for your product.

1.2 Workflow

Use the following workflow to integrate the module:
1. Detect the module on host platform. Check if the device is detected first on the machine after booting up. This step does not require any change in the source code. Verifying this ensures that hardware integration is correct.
2. Load the driver and firmware followed by interface up. Compile the driver and try to load during the initialization sequence. Communication with the module has been established when the interfaces are shown after the firmware download.
3. Initialize Wi-Fi background services and libraries to bring up the interface. At this point different layers in Android stack are connected and end-to-end communication is established. The stack then confirms that the vendor HAL is configured properly.
4. Connect the GUI and check for individual use-cases: Station mode, Access point, Wi-Fi Direct, and Bluetooth. For further details see section 7.
UBX-19035432 - R02 Introduction Page 6 of 40 C1-Public
Android integration for NXP-based modules - Application note

2 Components and device setup

2.1 Host platform

The u-blox EVK is evaluated together with the MCIMX8M-EVK host platform from NXP. The configuration setup for the EVK and NXP host platform communication is shown in the Figure 2.
MCIMX8M-EVK supports the following features:
Industrial grade NXP IMX8M host processor
Support for both Yocto and Android
Extensive peripherals for most evaluation scenarios
Evolving update of BSP for the host platform
For more detailed information, check the specifications of the MCIMX8M-EVK Evaluation Kit for the i.MX 8M Applications Processor [16].
Figure 1: NXP iMX8 MQEVK
UBX-19035432 - R02 Components and device setup Page 7 of 40 C1-Public
Android integration for NXP-based modules - Application note
compiler gdisk m4 libz-dev bison flex libssl-dev curl android-tools-fsutils

2.2 Setup

Figure 2 shows the typical setup configuration for EVK with host platform communication.
i.MX8 MQ EVK
(NXP)
Figure 2: EVK and host platform communication
u-blox EVK
UART communication via USB (Bluetooth)
SDIO communication (Wi-Fi) sddsdsdsdsds(hshshshshshs(Wi-Fi)
SMA connectors for Wi-Fi and Bluetooth antennas

2.3 Build system

A Linux host (for example Ubuntu 16.04 LTS) is required. You use this host to compile the Android code. The recommended hardware requirements for the host include:
Intel i7 or Xeon recommended
16GB+ RAM
200GB+ hard disk (SSD recommended)

2.4 Software packages

Different packages such as the Android open source code, drivers and HAL package required to integrate the u-blox modules based on the NXP chipset with Android 9 or above are explained in brief in the sections below.

2.4.1 Android Open Source Project

This section explains the procedure for building the Android image from scratch on an NXP i.MX8 platform. The following software packages are available for the host platform:
Android 9.0.0_2.3.4
The following process is generally relevant for the above packages and any future versions of the
Android BSP from NXP. The version of the Linux kernel integrated with this image is:
Follow the process outlined below to build the hardware image:
1. Install the appropriate packages.
$: apt install uuid uuid-dev zlib1g-dev liblz-dev liblzo2-2 liblzo2-dev lzop git­core curl u-boot-tools mtd-utils android-tools-fsutils openjdk-8-jdk device-tree-
2. Setup the download.
Install the
repo tool first when using the manifest repository.
4.14.98.
UBX-19035432 - R02 Components and device setup Page 8 of 40 C1-Public
Android integration for NXP-based modules - Application note
Interface
See chapters 3 and 4.
$: export PATH=${PATH}:~/bin
$: source ./imx-p9.0.0_2.3.4/imx_android_setup.sh $: source build/envsetup.sh
$: mkdir ~/bin
$: curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $: chmod a+x ~/bin/repo
3. Download the manifest.
Download and extract the source directory from the link:
https://www.nxp.com/webapp/Download?colCode=P9.0.0_2.3.4_ANDROID_SOURCE&appType=l icense
The directory includes the necessary configuration to fetch packages from the different repositories.
4. Setup the source.
Run the setup script to clone Android source code. It is a modified version of open-source package to cater the host platforms developed by NXP. It will have changes pertaining to device trees, display drivers etc.. This typically takes 5-6 hours - dependent on the network speed and machine.
Path: imx-p9.0.0_2.3.4/
At this point, all the files and directories needed for Android image building are downloaded in the folder
android_build. Before starting the build procedure, integrate the device driver and make
the necessary changes in different layers to work with the Wi-Fi and Bluetooth module.
5. Setup the build environment.
Enter the following terminal command to configure the Android build:
Path: imx-p9.0.0_2.3.4/android_build/
6. Enter the Android images can be found in
lunch commandthe build has completed successfully. All build artefacts and
android_build/out/target/product/evk_8mq/.

2.4.2 Driver package

The reference driver developed by NXP is distributed exclusively to customers that have signed a Limited Use License Agreement (LULA-M) with u-blox or Nondisclosure Agreement (NDA) with NXP. To obtain the driver package and vendor HAL, contact u-blox support for your area, as shown in the Contact section of this document.
The EMMY-W1 module is based on the NXP 88W8887 chipset. It can be connected to the host in couple of ways using different physical interfaces that use the driver packages, as shown in Table 3. For information about the specific driver packages used for testing each module variant, see Table 1.
Driver package
SDIO-UART-XX SDIO UART
SDIO-SDIO-XX SDIO SDIO
Table 2: Physical interfaces and driver packages
Wi-Fi Bluetooth
For information about the specific driver packages used for testing each module variant, see Table 1.
The SDIO-UART driver package structure is described below:
UBX-19035432 - R02 Components and device setup Page 9 of 40 C1-Public
Remarks
See section 5.
Android integration for NXP-based modules - Application note
SD-WLAN-UART-BT-8887-U16-MMC-W15.44.19.p36-15.100.19.p36-C4X15657_A2-GPL (Dec 2019)
├── FwImage sduart8887_combo_a2.bin is used for operating │ ├── sd8887_wlan_a2.bin Wi-Fi and Bluetooth modules in Android. Rest │ ├── sduart8887_combo_a2.bin are needed for individual radios. │ └── uart8887_bt_a2.bin ├── SD-UAPSTA-8887-U16-MMC-W15.44.19.p36-C4X15657_A2-app-src.tgz ├── SD-UAPSTA-8887-U16-MMC-W15.44.19.p36-C4X15657_A2-GPL-src.tgz ├── SD-UAPSTA-8887-U16-MMC-W15.44.19.p36-C4X15657_A2-mlan-src.tgz └── UART-BT-8887-U16-X86-15.100.19.p36-2.2-M2614100-GPL-src.tgz
UBX-19035432 - R02 Components and device setup Page 10 of 40 C1-Public
Android integration for NXP-based modules - Application note
NXP_Vendor_hal_005
└── wlan_lib  Glue layer between wpa_supplicant and the framework

2.4.3 Vendor HAL

Both the driver package (SD-WLAN-UART-BT-8887-U16-MMC-W15.44.19.p36-15.100.19.p36­C4X15657_A2-GPL) and vendor HAL (NXP Vendor HAL - v005) are developed by NXP
2
. It is expected that the HAL structure will remain the same for all future packages. Moreover, all extracted library content must be kept in specific path so that the HAL can compile together with future Android builds.
├── libbt Source code for vendor HAL for Bluetooth │ └── conf Conf file specific to Bluetooth of the combo chip └── wlan
├── 1.2 Service to integrate with native Wi-Fi framework ├── config Config files needed to start wpa_supplicant ├── libwifi-hal Library which provides services specific to scanning └── wifi_hal-mrvl collection of stats used by the host framework.
2
The driver and vendor HAL have been previously developed by Mavell and some places in the soure code still use Marvell designations.
UBX-19035432 - R02 Components and device setup Page 11 of 40 C1-Public
Android integration for NXP-based modules - Application note

3 Wi-Fi integration

3.1 Wi-Fi architecture

Android applications use managers to access system services like Wi-Fi. These managers access some of the vendor-specific functionalities through Hardware Abstraction Layer (HAL).
The Wi-Fi manager accesses the kernel through several layers, including HAL, as shown in Figure 3.
Figure 3: Android Wi-Fi architecture
WifiSettings is an application in the default AOSP build used to control Wi-Fi connections. It uses WifiManager to access Wi-Fi services.
WifiManager provides the following functionalities:
Provides a list of configured networks
Monitors the current active Wi-Fi network
Scans local access points and connects to the network that caters best for the user.
Each action of the Wi-Fi operation is managed in several different logical layers of the module. The initialization process is shown in Figure 4.
UBX-19035432 - R02 Wi-Fi integration Page 12 of 40 C1-Public
Loading...
+ 28 hidden pages