Silex technology SX-ULPGN-BTZ User manual

APPLICATION NOTE:
SX-ULPGN-BTZ
Development
Quick Start Guide
Silex Technology America
201 East Sandpointe, Suite 245
Santa Ana, CA 92707
Revision 1.5, February 2020

1
140-00217-100
Revision History
Rev. No.
Date
Revision by
Description
1.0
Mar 22, 2019
T.Nakase
Initial draft
1.1
Apr 1, 2019
T.Nakase
Section 3 and Appendix B, EVB_V01 update
1.2
Apr 23, 2019
T.Nakase
Section 6, Jumper setting update/correction
1.3
Aug 23, 2019
T.Nakase
Section 4.2 OpenOCD availability note, Section 5 BDF
update, Section 6.2 minor wording change
1.4
Aug 29, 2019
T.Nakase
Section 4.6 Winbond SPI flash note
1.5
Feb 10, 2020
T.Nakase
EVB_V02 update, 3.3V Power Supply jumpers. QCA4020
SDK update.

2
140-00217-100
Table of Contents
1. Scope......................................................................................................................................................4
2. References .............................................................................................................................................4
2.1 QDN Document..............................................................................................................................4
2.2 Software Download Links ..............................................................................................................4
3. Equipment..............................................................................................................................................5
3.1 Hardware .......................................................................................................................................5
3.2 Host PC Configuration....................................................................................................................5
4. Software Install ......................................................................................................................................5
4.1 Toolchain........................................................................................................................................5
4.2 Debugger........................................................................................................................................5
4.3 Python............................................................................................................................................6
4.4 Oracle JDK ......................................................................................................................................6
4.5 Eclipse IDE Package for C/C++ Developer......................................................................................6
4.6 QCA4020 SDK.................................................................................................................................6
5. Software Configuration..........................................................................................................................7
5.1 WiFi Board Data File ......................................................................................................................7
5.2 Bluetooth LE and IEEE 802.15.4 NVM Configuration File..............................................................7
5.3 GNU MCU Eclipse Plug-in...............................................................................................................8
5.4 Create External Tools Configuration for Firmware Flashing .......................................................10
6. Hardware Setup ...................................................................................................................................11
6.1 Jumper .........................................................................................................................................11
6.2 Host PC FTDI Driver for JTAG .......................................................................................................13
7. Build Sample Demo Project: QCLI_demo ............................................................................................13
7.1 Import QCLI_demo Project to Eclipse IDE ...................................................................................13
7.2 Disable Deep Sleep Mode............................................................................................................15
7.3 Update Project Property..............................................................................................................15

3
140-00217-100
7.4 Create Debug Configuration........................................................................................................17
7.5 Build Demo Project......................................................................................................................19
8. Flash Firmware.....................................................................................................................................20
9. Run Firmware.......................................................................................................................................20
10. Debug Firmware ..............................................................................................................................21
Appendix A: Emergency Loader (EDL) .........................................................................................................25
Appendix B: What’s different from Qualcomm CDB20/M20? ....................................................................26
Jumper Header.........................................................................................................................................26
Debug Header ..........................................................................................................................................27
Arduino Header........................................................................................................................................27
External PA...............................................................................................................................................27
Onboard Sensor .......................................................................................................................................27

4
140-00217-100
1. Scope
The purpose of this document is to provide instructions for setting up firmware development
environment of SX-ULPGN-BTZ EVK on Windows 10 with Intel Architecture 64bit CPU.
2. References
2.1 QDN Document
2.1.1 QCA402x (CDB2x) Development Kit User Guide, 80-YA121-140 Rev.D, Section 3
https://developer.qualcomm.com/hardware/qca4020-qca4024/tools-qca4020
2.2 Software Download Links
2.2.1 GNU Arm Embedded Toolchain 6-2016-q4-major
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
2.2.2 OpenOCD 20170609
http://gnutoolchains.com/arm-eabi/openocd/
2.2.3 Python 2.7.15
https://www.python.org/downloads/
2.2.4 Oracle JDK 8u202
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2.2.5 Eclipse IDE Oxygen 2 Package for C/C++ Developers
https://www.eclipse.org/downloads/packages/release/oxygen/2
2.2.6 QCA4020 SDK: QCA4020.OR.3.0 QCA OEM SDK+CDB
https://developer.qualcomm.com/hardware/qca4020-qca4024/tools-qca4020
2.2.7 Zadig 2.4
https://zadig.akeo.ie

5
140-00217-100
3. Equipment
3.1 Hardware
•The EVK board, SX-ULPGN-BTZ EVK (WCBN3516A_EVB V02)
•Host PC
•USB 2.0 Cable (Type A male –Type A male) x2
•Jumper Cap x14
•Jumper Cable (female –female) x3
3.2 Host PC Configuration
•Intel Core i7-4790 Processor @ 3.60 GHz
•8 GB RAM
•160GB HDD
•USB 2.0/3.0 x2
•Gigabyte Ethernet Port x1
•Windows 10 Professional
•Username: silex, Account type: Administrator
4. Software Install
4.1 Toolchain
1. Download gcc-arm-none-eabi-6_2-2016q4-20161216-win32.exe from the download link (Section
2.2.1 above.)
2. Run installer with default settings.
3. Add following path to PATH user variables
1
:
C:\Program Files (x86)\GNU Tools ARM Embedded\6.2 2016q4\bin
4.2 Debugger
1. Download OpenOCD-20170609.zip from the download link (Section 2.2.2 above.)
Note: OpenOCD version 20170609 is the latest release known to work well with EVK board. Please
contact Silex if it is not available from the internet.
2. Extract it to:
C:\Program Files (x86)\openocd
1
If your account doesn’t have PATH variable, please click New button and create it as new variable.

6
140-00217-100
3. And add following path to PATH user variables:
C:\Program Files (x86)\openocd\bin
4.3 Python
1. Download python-2.7.15.amd64.msi from the download link (Section 2.2.3 above.)
2. Run installer with default settings.
3. Add following path to PATH user variables:
C:\Program Files\Python27
4.4 Oracle JDK
1. Download jdk-8u202-windows-x64.exe from the download link (Section 2.2.4 above.)
2. Run installer with default settings.
4.5 Eclipse IDE Package for C/C++ Developer
1. Download eclipse-cpp-oxygen-2-win32-x86_64.zip from the download link (Section 2.2.5 above.)
2. Extract it to:
C:\Program Files\eclipse
4.6 QCA4020 SDK
1. Download QCA4020.OR.3.0 QCA OEM SDK+CDB from the download link (Section 2.2.6 above.)
2. Extract it to:
C:\Users\silex\qca4020-or-3.0_qca_oem_sdk-cdb.git
This document refers this directory as <SDK_source> hereafter.
Note: Current SDK OR-3.0 supports EVK V01 board only. EVK V02 and SX-ULPGN-BTZ mass
production module needs OR-3.1 or newer because it has Winbond SPI flash onboard. If you need
help, please contact Silex.
3. Open Command Prompt and go to SDK directory <SDK_source>\target
4. Run eclipseSupport.bat to install Eclipse project files of demo projects, .cproject, .project,
and .settings folder.

7
140-00217-100
5. Software Configuration
5.1 WiFi Board Data File
1. Copy updated Board Data File (BDF) wlan_fw_img.wcbm3516a_ctl_20190402.bin to:
<SDK_source>\target\bin\wlan
2. Backup original BDF wlan_fw_img.bin as wlan_fw_img.cdb.bin.
3. Overwrite original BDF with updated BDF.
5.2 Bluetooth LE and IEEE 802.15.4 NVM Configuration File
1. Copy updated NVM file QCA4020_2p0_WCBN3516A_20190322.nvm to:
<SDK_source>\target\quartz\nvm\config\2.0\4020\CDB
2. Backup original NVM file QCA4020_2p0.nvm as QCA4020_2p0_CDB.nvm.
3. Overwrite original NVM file with updated NVM file.

8
140-00217-100
5.3 GNU MCU Eclipse Plug-in
1. From Eclipse IDE top menu, click Help > Install New Software.
2. In Install dialog, set Work with to:
http://gnu-mcu-eclipse.netlify.com/v4-neon-updates
3. Click Add.
4. In Add Repository dialog, set Name to:
GNU MCU Eclipse plug-ins
5. Click OK.
6. In Install dialog, add check mark to GNU ARM & RISC V C/C++ Cross Development Tools.

9
140-00217-100
7. Click Next and finish install by following the instruction of dialog. If you see Security Warning
dialog during the installation, click Install Anyway.
8. Restart Eclipse.
9. From top menu, click Window > Preference.
10. At left pane of Preference dialog, select MCU > Global OpenOCD Path.
11. Set Folder to:
C:\Program Files (x86)\openocd\bin

10
140-00217-100
12. Click Apply and Close.
5.4 Create External Tools Configuration for Firmware Flashing
1. From Eclipse IDE top menu, click Run > External Tools > External Tools Configuration.
2. Right click on Program of External Tools Configurations dialog and click on New.
3. At the right pane, set Name to:
OpenOCD JTAG Flashing
4. Set Location to:

11
140-00217-100
${project_loc}\build\gcc\flash_openocd.bat
5. Set Working Directory to:
${project_loc}\build\gcc
6. Click Apply.
7. Click Close.
6. Hardware Setup
6.1 Jumper
6.1.1 3.3V Power Supply
Connect following pins to enable 3.3V Power Supply.
•J111 Pin 1-2
•J116 Pin 1-2
•J120 Pin 2-3
•J118 Pin 2-3
•J119 Pin 2-3
6.1.2 Debug UART
Connect following pins to enable Debug UART.
•J91 Pin 1-2

12
140-00217-100
•J92 Pin 1-2
•J108 Pin 2-3
•J109 Pin 2-3
6.1.3 JTAG
Connect following pins to enable JTAG.
•J37 Pin 2-3
•J38 Pin 2 - J39 Pin 3 **
•J39 Pin 2 - J38 Pin 3 **
•J40 Pin 2-3
•J102 Pin 2 - J106 Pin 1 **
•J112 Pin 1-2
•J113 Pin 1-2
** Needs jumper cable

13
140-00217-100
With this configuration, EVK board bootup in JTAG mode that you can flash and debug custom
firmware. To run custom firmware, see Section 9 below.
6.2 Host PC FTDI Driver for JTAG
1. Download zadig-2.4.exe from the download link (Section 2.2.7 above.)
2. Connect USB1 and USB2 of EVK board to Host PC with USB cables and Gender Changer.
3. Start zadig-2.4.exe.
4. From top menu, enable Options > List All Devices and look for Dual RS232-HS (Interface 0).
5. Select WinUSB from the list and click Replace Driver button.
7. Build Sample Demo Project: QCLI_demo
7.1 Import QCLI_demo Project to Eclipse IDE
1. Right click on Project Explorer and select Import… to open Import dialog window.

14
140-00217-100
2. Select Projects from Folder or Archive import wizard.
3. Click Next. The system will show Import Projects from File System or Archive dialog window.
4. Set import source to:
<SDK_source>\target\quartz\demo\QCLI_demo
5. Confirm QCLI_demo is selected and click Finish
2
.
2
You will see two errors saying g++ and gcc is not found from the PATH. These will not pose adverse effect to the
building process.

15
140-00217-100
7.2 Disable Deep Sleep Mode
QCA4020 power down JTAG controller to save power consumption in Deep Sleep mode. To keep
JTAG debug session running, disable Deep Sleep mode as follows.
1. Open target\quartz\demo\QCLI_demo\src\export\DevCfg_master_devcfg_out_cdb.xml with
editor.
2. Set 0 (zero) to the field shown below:
7.3 Update Project Property
1. From Eclipse IDE top menu, click File > Properties to open Properties for QCLI_demo.
2. Select C/C++ Build from left pane of the dialog and click on Builder Settings tab.

16
140-00217-100
3. Set Build command to:
build.bat
4.Click on Behavior tab.
5. Set Build (incremental build) to:
t 4020 cdb
6. Set Clean to:
clobber
3
3
Batch file clean operation of this SDK release doesn’t work due to Windows OS bug.

17
140-00217-100
7. Click Apply and Close.
7.4 Create Debug Configuration
1. From Eclipse IDE top menu, click Run > Debug Configurations.
2. Right click on GDB OpenOCD Debugging of Debug Configurations dialog and click on New.
3. At the right pane, set Name to:
QCLI_demo_Debug
4. Select Main tab.
5. Set Project to:
QCLI_demo
6. Set C/C++ Application to:
build/gcc/output/Quartz.elf
7. Select Disable auto build radio button from Build (if required) before building.
8. Select Debugger tab.

18
140-00217-100
9. Set Executable path in OpenOCD Setup to:
C:\Program Files (x86)\openocd\bin\openocd.exe
10. Set Config options in OpenOCD Setup to:
-f ${project_loc}\build\gcc\qca402x_openocd.cfg
11. Set Executable name in GDB Client Setup to:
C:\Program Files (x86)\GNU Tools ARM Embedded\6.2 2016q4\bin\arm-none-
eabi-gdb.exe
12. Select Startup tab.

19
140-00217-100
13. Set text field in Initialization Commands to:
cd build/gcc
14. Set text filed in Run/Restart Commands to:
source v2/quartzcdb.gdbinit
15. Set Set breakpoint at to:
app_init
16. Click Apply.
17. Click Close.
7.5 Build Demo Project
1. Start build process from top menu, Project > Build Project.
2. Wait until you see Build Finished message on Console.
Table of contents
Popular Microcontroller manuals by other brands

Nuvoton
Nuvoton NuMicro series Technical reference manual

mikroElektronika
mikroElektronika dsPICPRO user manual

Nordic Semiconductor
Nordic Semiconductor nRF52 Preview Development Kit user guide

Seiko Epson
Seiko Epson S5U1C17F57T manual

Maxim Integrated
Maxim Integrated DS34S132DK manual

Renesas
Renesas mPD179327 Subseries user manual

Nuvoton
Nuvoton Numicro NuMaker-NUC1311L user manual

Renesas
Renesas RZ/T1 Series user manual

Silicon Laboratories
Silicon Laboratories C8051F310DK-T user guide

Texas Instruments
Texas Instruments LaunchPad CC1312PSIP quick start guide

NGX Technologies
NGX Technologies LPC1830-Xplorer user manual

Motorola
Motorola M68HC08 Designer Reference Manual