MULTI-MODE WIFI, BLUETOOTH, ZIGBEE QCA4020: Multi-Mode Dual Band WiFi, Bluetooth 5, and ZigBee (802.15.4) QCA4020 miniPCIe Copyright © 5GHUB.
Purpose of the Document The purpose of this document is to explain the QCA4020 which is multi-mode dual band WiFi, Bluetooth 5, and ZigBee (802.15.4). This document contains the features of the QCA4020 and how to configure it. Document History Version A Author 5G HUB QCA4020 miniPCIe Date 8.16.2021 Description Initial Document Copyright © 5GHUB.
Table of Contents Purpose of the Document .......................................................................................................................... 2 Document History ...................................................................................................................................... 2 1 Introduction ................................................................................................................................... 4 2 QCA4020 miniPCIe Layout .............
1 Introduction This is a miniPCIe card that supports multi-mode intelligent connectivity. It supports dual-band WiFi, Bluetooth 5, and ZigBee. It is based on Qualcomm QCA4020 System-On-Chip (SoC). It has low power SoC that integrates a Cortex M4F for application processing, Cortex M0 for network stack processing, and a separate processor for Wi-Fi stack designed to enable a highly concurrent multiple radio solution.
USB Version: USB 2.0 CPU CPU Clock Speed: Up to 128 MHz CPU Cores: Arm Cortex-M4F CPU, Arm Cortex-M0 CPU, Tensilica Xtensa Security Support Security Features: Application-level Security, Hardware-based Crypto Engine, Key Provisioning Security, Qualcomm® Trusted Execution Environment (TEE), Secure Boot, Secure Storage, Software Image Encryption, True Random Number Generator Wi-Fi Security: WPS Interface 2 QCA4020 miniPCIe Layout The following figure explains the QCA4020 miniPCIe.
The following figure shows the size and dimension of the QCA4020 miniPCIe. Figure 2: QCA4020 miniPCIe Physical Dimension. 3 QCA4020 miniPCIe Pin Out The QCA4020 is miniPCIe card and interface. The following figure shows the pin out of the miniPCIe: QCA4020 miniPCIe Copyright © 5GHUB.
Figure 3: QCA4020 miniPCIe Pin out. To use the miniPCIe module, you can use USB adaptor (also know as Raspberry PI HAT). The miniPCIe pin mapping as in the table below. If the miniPCIe is used with he Raspberry PI HAT, miniPCIe pins are mapped to Raspberry PI for additional functionality and interface to Raspberry PI. Table 1: QCA4020 miniPCIe Interface.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 QCA4020 miniPCIe CHIP_PWD_L_BE T4 I2C0_MASTER_SCL DTR GPIO10_BE GPIO 19 (35) 33 I2C0_MASTER_SDA GPIO11_BE GPIO 18 (12) USB20_DM_BE USB20_DM_BE USB20_DP_BE USB20_DP_BE LED_ZIGBEE GPIO13_BE SPI_SLAVE_CLK LED_BLE SPI_SLAVE_MOSI LED_WLAN SPI_SLAVE_MISO GPIO18_BE GPIO60_BE GPIO23_BE GPIO12_BE GPIO20_BE GPIO 11 (23) SPI_SLAVE_CS_N GPIO19_BE GPIO 8 (24) Copyright © 5GHUB.
4 How to flash Image to QCA4020 miniPCIe Flashing the image o the QCA4020 miniPCIe can be done using either of the following two methods: 4.1 Method 1: Through Emergency Download Mode (EDL) In this step up, user can do the following: 1- Connect J3 (PIN 1 and PIN 2). This is the GPIO22_BE used for EDL. 2- Connect the USB cable between the PC and the USB port of M20. 4.2 Method 2: Through JTAG In this step up, user can do the following: 1- Connect J1 (PIN 1 and PIN 2).
5 QCA4020 Pin Out The QCA4020 has abundant number of pins and GPIOs and functionalities which are exposed through P1 and P2 jumper headers. The following table summarizes all pins exposed through P1 and P2 jumper headers and their hardware functionalities. Table 4: P1 and P2 PIN Mapping. QCA4020 miniPCIe SPI or I2C orQSPI UART PWMADC/ SenseADC Header and PIN GPIO # PTA P2 - PIN 1 3.
P2 - PIN 13 GPIO28_BE P2 - PIN 14 GPIO30_BE P2 - PIN 15 GPIO31_BE P2 - PIN 16 GPIO32_BE P2 - PIN 17 GPIO33_BE P2 - PIN 18 P1 - PIN 10 A0 (SENSEADC_1_BE) P1 - PIN 9 A1 (SENSEADC_0_BE) P1 - PIN 8 QCA4020 miniPCIe GND GPIO_41_BE P1 – PIN 7 GPIO48_BE P1 - PIN 6 GPIO49_BE P1 - PIN 5 GPIO54_BE SENSEADC2 P1 - PIN 4 GPIO55_BE SENSEADC3 P1 - PIN 3 GPIO56_BE SENSEADC4 P1 - PIN 2 GPIO57_BE SENSEADC5 P1 - PIN 1 GPIO58_BE SENSEADC6 Copyright © 5GHUB.
6 Software Tools to be Installed Please install the following tools - Python 2.7.X (Download Python | Python.org) Eclipse IDE for C/C++ (Eclipse IDE for C/C++ Developers | Eclipse Packages) This is a GUI-based integrated development environment Supported Version: Oxygen version - Release 4.7.2 Java: Eclipse IDE has dependency on Java, JDK 8 or higher OpenOCD (Download OpenOCD for Windows (gnutoolchains.com)) version 0.10.0 [2017-06-09] GNU Arm Embedded Toolchain (GNU ARM Toolchain) version 6.
C:\Program Files\OpenOCD-20170609\bin set path as follows: set %PATH%=%PATH%:C:\Program Files\OpenOCD-20170609\bin 7.4 GNU ARM Toolchain Install the ARM toolchain by running the “.exe” file and make sure you select the option to “Add path to environment variables” during the final step. 7.5 Setup OpenOCD Plugin Usage with Eclipse Do the following steps: 1- Go to Help > Install new software in EclipseIDE and make sure the following plugin are installed and enabled by default.
2- Set path to openOCD. Restart the Eclipse IDE and under Window -> preferences. Set path to openOCD as seen below: 3- After installing the Qualcomm SDK, QCA4020 OEM SDK+CDB, Demos samples are in the following folder: target\quart\demo\ QCA4020 miniPCIe Copyright © 5GHUB.
4- Install the QCA plugin jar file available at /target/quartz/demo/EclipseSupportFiles - Copy the jar file (QCA402x_plugin.jar) to the “dropin” folder under the Eclipse IDE installed folder. - Restart the Eclipse IDE if running. To restart Eclipse, click on the File->Restart after the plug-in is installed. 5- Make sure all environment variable are set up correctly 8 Importing “Hello World” Application 1- Install Eclipse project files for sample demo applications.
Or sh eclipseSupport.sh eclipseSupport.bat After executing the script, the Eclipse project files .cproject, .project and .settings folder are updated in the respective folders of the demo application. 4- Open Eclipse application and Go to File->Open Project and choose the folder of the “Hello World” application and check the box beside the application. Click Finish 5- To debug the project, set the Debug Config. Go to Run->Debug Configuration->GDB OpenOCD.
6- In the Debugger window, provide the openocd executable path with config option -f ${project_loc}\build\gcc\qca402x_openocd.cfg 7- Provide the arm-none-eabi-dgb executable path for the GDB client as seen below. QCA4020 miniPCIe Copyright © 5GHUB.
9 Building “Hello World” Application To build the application, do the following: 1. Go to Project properties->Configure build. Right-click on the project name in project explorer and go to Properties 2. Verify the build command and the build directory in the Builder settings tab. 3. Go to C/C++ build and set the build command to “build.bat”, and the build directory to “path to source” as in the following screenshots. 4. Click Apply and Close QCA4020 miniPCIe Copyright © 5GHUB.
5. Build the application and you will see the following message in the Console Window The output and *.elf files are generated and available under the output folder: QCA4020 miniPCIe Copyright © 5GHUB.
QCA4020 miniPCIe Copyright © 5GHUB.
10 Flash the Application to the QCA4020 miniPCIe using USB You can flash an application to the QCA4020 miniPCIe over the USB port. To do so, follow the following steps: 1- Connect a jumper on J3 to short-circuit it. This puts the QCA4020 in EDL (Emergency Download Mode) which allows to download an image to the QCA4020 flash. 2- Connect a Micro USB cable between USB port on the USB adaptor (HAT) and a USB port on a Windows PC.
When you run this tool with -h parameter, you get the following as in this screenshot: 4- Run the following command to flash the application to the QCA4020 python qflash.py --comm_port 40 --app C:\QCA4020\SDK\qca4020-or-3-4_qca_oem_sdk-cdbmaster2e23b7b0933311a33dc090ed0f647de9b31d7954\target\quartz\demo\Helloworld_demo\build\g cc\output\Quartz_HASHED.elf Noe the image to be flashed is the Quartz_HASHED.elf.
11 Flash the Application to the QCA4020 miniPCIe using JTAG You can use JTAG interface on the QCA4020 miniPCIe to flash the image. A SEGGER J-link hardware is used wit connect and interface to the JTAG. On the QCA4020 miniPCIe, do the following - Connect J1 (PIN1 and PIN2). This force JTAG mode Connect J3 (PIN1 and PIN2). This enable JTAG interface On Windows environment variables, add the following environment variable: - JLINK_PATH set it to J-link GDB server executable file (e.g., C:\Program Files (x8
Eclipse will start flashing the image to the QCA4020 miniPCIe over JTAG. You will see the following screenshot. QCA4020 miniPCIe Copyright © 5GHUB.
When flashing is completed. You will see the following screen shoot with the output: Flash Operation Completed Successfully... Stopping GDB server.... SUCCESS: The process with PID 23756 has been terminated. After finishing flashing the image, make sure to remove J1 & J3 on QCA4020 miniPCIe to exit JTAG mode. QCA4020 miniPCIe Copyright © 5GHUB.
12 Connecting QCA4020 to Serial Terminal Through UART You can use the QCA4020 miniPCIe when mounted on USB adaptor (HAT) with any device that has UART (Tx/Rx) interface such as a Raspberry PI board, Arduino board or any other hardware board, with UART interface. You can also use and connect the QCA4020 miniPCIe/USB adaptor (HAT) to a USB port in the computer through a USB-to-UART cable.
Make sure when you connect the USB-to-UART cable, it shows correctly in Windows device manager and all its driver is installed as in this screenshot. 13 Using Serial Terminal It is recommended to use Tera Term tool as the serial terminal. You can download it from here: https://osdn.net/projects/ttssh2/downloads/54081/teraterm-4.72.exe/ Launch Tera Terminal and select the Serial option and select USB-to-Serial port. QCA4020 miniPCIe Copyright © 5GHUB.
In Tera Term, choose Setup->Serial port and configure serial ports according to the following: And now you are ready to see the output from “hello World” application on the serial monitor. QCA4020 miniPCIe Copyright © 5GHUB.
If you are using JTAG mode to flash the image to the QCA4020 miniPCIe, you shall see the following output on Tera terminal QCA4020 miniPCIe Copyright © 5GHUB.
14 QCLI Demo Application CLI demo application is a comprehensive demo that provides a mechanism to demonstrate different and all features and technologies that QCA4020 miniPCIe supports. It also provides reference implementation and usage of customer facing QAPIs. The QCLI-demo application is available with the QCA4020 SDK and you can follow the same steps described before in Eclipse to build and flash it to the QCA4020 miniPCIe.
QCA4020 miniPCIe Copyright © 5GHUB.