| Skill Level | Area of Focus | Operating System | Platform/Hardware |
|---|---|---|---|
| Beginner | Bluetooth, IoT, Education, Embedded, Smart Home | RTOS | QCA 402x WiFi/BLE/ZigBee |
This project is intended to help you get familiar with the QCA4020 System-On-Chip (SoC) Product Development kit. The QCA4020 IoT solution offers Wi-Fi, Bluetooth low energy (BLE), and 802.15.4 capable radios in a single-chip package.CLI- based demo application that is included in the SKD provides a mechanism to demonstrate different features and technologies that QCA402x supports.
Objective
The objective of this demo is to get familiar with the QCA4020 development kit and understand how developers can test all the features using the QCLI_Demo application.
What is the QCLI_Demo application?
QCLI_Demo is a sample application that is included in the SDK. It is designed to provide a command line interface to most of the features available on the QCA402x development platform. The command framework is implemented as a set of nested menus and each menu provides a list of sub-commands that correspond to a feature or technology.
How does the QCLI_Demo tap into various features of the QCA4020 development kit?
The QCLI_Demo uses the QAPIs framework to demonstrate different features. It is designed to provide a reference implementation and usage of customer facing QAPI’s
So, what are QAPIs?
Qualcomm® API (QAPI) is an interface provided by Qualcomm Technologies, Inc. and/or its subsidiaries to abstract OEM software from low-level system software. QAPI provides access to low-level system software exposing SoC hardware/peripherals, I/O interfaces, communication interfaces, network services, security services, hardware/software configuration and power management interfaces, and all other associated functionality deemed part of a chip support package. QAPI is meant to enhance portability of application-specific OEM software by abstracting it from low-level system software provided by Qualcomm Technologies.
Materials Required / Parts List / Tools
Additional Resources
Build / Assembly Instructions
In the Box
The contents of the QCA4020 Development kit, as seen above, include:
- QCA4020 development board
- USB to Micro USB cables
- Power supply
- Jumpers
- Setup guide
For the time being, you can set the kit aside while you install the software components and set up the development environment on your computer. During the setup process, you will only briefly use the kit while installing the FTDI drivers for JTAG.
Setup the development environment
- Install Python version 2.7.X
Some of the support scripts are Python-based so be sure to install Python 2.7.X because the support scripts do not support Python 3. After installation, add the path to python.
Example: If python.exe is in the folder
C:\CRMApps\Apps\Python276-64%PATH%=%PATH%:C:\CRMApps\Apps\Python276-64Supported Version: Oxygen version - Release 4.7.2
After installation, add path to Java.
Example: If Java.exe is in
C:\ProgramData\Oracle\Java\javapath%PATH%=%PATH%: C:\Program Files\Java\jdk1.8.0_161\binOpenOCD plugin is required to establish the connection between Eclipse IDE and onboard FTDI JTAG debugger. After installation, add the path to OpenOCD.
Example: If openocd.exe is in
C:\Program Files\OpenOCD-20170609\binset %PATH%=%PATH%:C:\Program Files\OpenOCD-20170609\binInstall by running the ".exe" file and make sure you select the option to "Add path to environment variables" during the final step.
- Install GNU MCU plugin for Eclipse
Go to Help > Install new softwareLocation: "http://gnu-mcu-eclipse.netlify.com/v4-neonupdates" Enter details and click "OK" as seen below.
click "Next".
Restart the Eclipse IDE and under
Window > preferences- Go to
Run >Debug Configurations > GDB OpenOCD DebuggingIf you have already built the image, select Disable auto build. If image is not built, select Use workspace settings.
-f ${project_loc}\build\gcc\qca402x_openocd.cfgThe SDK contains sample demo applications with source code to demonstrate different features and technologies that QCA402x supports. Demos are in the following folder:
target\quart\demo\<name_of_demo><SDK_source>/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 menu of Eclipse IDE and select the Restart menu item after the plug-in is installed.
- Download the zadig application from http://zadig.akeo.ie/.
- Connect the J85 connector on the development board to the host PC using the included Micro-USB cable.
- Once the QCA4020 Development board is connected to the host PC, the Device Manager shows two COM ports. The lower port number is for JTAG and the upper port number is for serial connection.
- Run zadig.exe file and go to
Options > List AllMake sure that the paths are set correctly under the environment variables.
They should be set as seen below.
Congratulations, you have now successfully set up the development environment for the QCA4020 development kit. The next section shows you how to import the sample “Hello World” application.
Import sample "QCLI_Demo" application
- Install Eclipse project files for sample demo applications.
To install there is
eclipseSupport.bateclipseSupport.sh<SDK_source>/target<SDK_source>/targetsh eclipseSupport.sheclipseSupport.batAfter executing the script, the Eclipse project files .cproject, .project and .settings folder are updated in the respective folders of the demo applications.
File > Open ProjectsExample: <path>/target/quartz/demo/QCLI_DemoNext, build the application.
Build the Application
- Configure the QCLI demo:
The QCLI demo provides a CLI menu for all the features and technologies supported on QCA402x. A user may choose to disable certain features (for example, due to lack of flash space). For this purpose, a configuration file is provided in the SDK that allows configuring each feature to “true” or “false”.
For example:- To disable the Zigbee feature, edit the env.config file:
Change: ‘CFG_FEATURE_ZIGBEE=true’
To: ‘CFG_FEATURE_ZIGBEE=false’- On Windows, run ‘setenv.bat’.
- On Linux, run ‘. setenv.sh’.
Project properties > Configure buildFlash the Application on the QCA4020 development board using JTAG and Eclipse.
Alright, time to start playing with the Developer Kit. Since this project/demo involves two QCA402x development boards, flash both the boards by following the below steps.
- Setup the QCA4020 development board as described in Appendix A, "CDB2x board setup" in QCA402x-CDB2x development kit user’s guide.
- Put the jumper on J31 1&2 on the QCA4020 development board.
Tip: There is a "Dot" next to each header that indicates the position of Pin Number 1.
After the flashing through JTAG is done, remove the jumper.
Jumpers on the developer board should be as seen below.
- Jumper on J31 (Pins 1 and 2),
Cross connect pins 2 and 3 of J38 and J39
- Jumper on J31 (Pins 1 and 2),
Run > External Tools > External Tools ConfigurationRun > External Tools > OpenOCD JTAG FlashingYou will see the following lines at the end of the log:
[2018-07-17 16:51:24,434] INFO: Script finished processing generated_fwd_table.xml File:flash_through_gdb.py:699 Function:main
Flash Operation Completed Successfully...
SUCCESS: The process "openocd.exe" with PID 17776 has been terminated.The application was flashed successfully on the development board.
Usage Instructions
Run the application in Autoboot mode
The Autoboot mode refers to the mode where the system boots up on a power cycle and no JTAG connectivity is required. Follow the below steps to run the application in Autoboot mode.
- Remove the jumper on J31. This was connected to flash the image on the board.
- Power cycle the system.
Once the board powers up, open a serial console on your host PC.
Connect it to the com port number assigned to the USB-serial connection with the following settings.
- Baud Rate: 115200
- Data Bits: 8
- Parity: None
- Stop bit: 1
- Flow Control: None
You should see the following CLI menu on the serial console. You can now type the commands to test the system features.
The CLI menu is divided in groups and sub-groups. Each level/menu provides a list of sub-commands that correspond to a feature or technology.
Two example command lists are shown below - the first being at the top-level and the second after navigating into the WLAN group.
- Top-level command list
Command List:
Commands:- Help
- Exit
- HMI
- WLAN
- Net
- WLAN group command list
Command List:
Commands:- Help
- Up
- Root
- Enable
- Connect
- Disconnect
Subgroups:
- SupPart1
- SupPart2
Congratulations! You have set up with QCA4020 development environment and flashed the board with the QCLI_Demo. You can now start testing various features by sending commands over serial port.
What can you do with the QCLI_Demo?
There are subgroups and sub-commands for:
- BLE
- Zigbee
- Thread
- HMI
- WLAN
- Net
- Certificate management demo
- Coex
- Firmware Update
- ADSS
- Peripherals
- Low Power
- File System
- Secure FS
- Crypto
- AWS demo
- JSON
- Azure
For more information on all the sub-commands, please check out section 6, page 69 of the QCA4020 development kit user’s guide.
Sign up for the Developer Newsletter.
Get software and hardware tool resources to help optimize your development delivered to your inbox weekly.
