To help you quickly get started with Raytac’s AN7002 Wi-Fi module and nRF5340 module, here’s a simple guide on how to set up the development and programming environment using AN7002Q-nRF5340 Demo Board(AN7002Q-DB-5340)and nRF5340 DK.
This article will cover the 4 sections below:
1. Hardware setup
2. Software Development Kit and Environment setup
3. Programming/Development
4. Flashing/Uploading firmware
![](https://raytac.blog/wp-content/uploads/2024/06/image-13.png?w=856)
1. Hardware Setup
1 x Nordic nRF5340-DK: PCA10095(2.0.0)
1 x Raytac AN7002Q-DB-5340
1 x IDC Cable
1 x USB-Micro USB Cable
1 x USB-Type C USB Cable
*Note: You need to use both the “Nordic nRF5340-DK” and “Raytac AN7002Q-DB-5340 demo board” together for programming and development. *
Steps to connect the hardware:
- Connect J-Link on Nordic DK to AN7002Q-DB-5340 using IDC Cable
- Power Nordic nRF5340-DK up using Micro USB Cable
- Power Raytac AN7002Q-DB-5340 up using Type C USB Cable
![](https://raytac.blog/wp-content/uploads/2024/06/5340dk-an7002-db-1.jpg?w=1024)
AN7002Q-DB-5340 Schematic Diagram:
![](https://raytac.blog/wp-content/uploads/2024/06/image-14.png?w=1024)
2. Software Development Kit and Environment Setup
Download nRF Connect For Desktop: Download nRF Connect For Desktop (Please Click Me)
Download nRF Command Line Tools: Download nRF Command Line Tools (Please Click Me)
(1) Download and install the latest version of nRF Connect for Desktop (Windows 64-bit – 5.0.0 version)
nrfconnect-setup-5.0.0-x64.exe
![](https://raytac.blog/wp-content/uploads/2024/06/image-15.png?w=98)
(2) Download and install the latest version of nRF Command Line Tools (Windows X86 64 – 10.24.2 version)
nrf-command-line-tools-10.24.2-x64.exe
*Note: During set-up, the SEGGER J-LINK installation/update request might pop up on your screen. *
*(As shown in below screenshot). *
If you’re initiating Segger J-Link Driver, please check the guideline here(Click me)
![](https://raytac.blog/wp-content/uploads/2024/06/image-43.png?w=680)
After the installations are completed, you can see the following applications under the:
“Programs and Features” section in the Control Panel.
![](https://raytac.blog/wp-content/uploads/2024/06/image-17.png?w=924)
nRF Connect SDK (NCS) supports development using the free VS (Visual Studio) Code IDE.
Here’s how to select and install the NCS SDK version (nRF Connect SDK vx.x.x):
Step1.
Open “nRF Connect for Desktop” → Choose “Toolchain Manager” → then click” Open”
![](https://raytac.blog/wp-content/uploads/2024/06/image-18.png?w=1024)
Step2.
You’ll see a list of nRF Connect SDK versions. It’s recommended to install NCS v2.6.0 or later.
Here, we use NCS v2.6.0 as an example.
![](https://raytac.blog/wp-content/uploads/2024/06/image-19.png?w=1024)
Step3.
Before installing NCS v2.6.0, confirm the installation path (Default path → C:\ncs).
![](https://raytac.blog/wp-content/uploads/2024/06/image-21.png?w=1024)
If you want to change the path, click “Select directory”, and press OK.
![](https://raytac.blog/wp-content/uploads/2024/06/image-22.png?w=1024)
![](https://raytac.blog/wp-content/uploads/2024/06/image-23.png?w=1024)
Step4.
After installing the nRFConnect SDK v2.6.0, click “Open VS Code”.
![](https://raytac.blog/wp-content/uploads/2024/06/image-24.png?w=1024)
Step5.
Open the Wi-Fi scan example
![](https://raytac.blog/wp-content/uploads/2024/06/image-25.png?w=1024)
![](https://raytac.blog/wp-content/uploads/2024/06/image-26.png?w=1024)
Step6.
Add build configuration → select the board and compile.
![](https://raytac.blog/wp-content/uploads/2024/06/image-27.png?w=1024)
Select board: nrf7002dk_nrf5340_cpuapp.
![](https://raytac.blog/wp-content/uploads/2024/06/image-28.png?w=1024)
![](https://raytac.blog/wp-content/uploads/2024/06/image-29.png?w=1022)
Step7.
After compilation, a hex file will be generated.
![](https://raytac.blog/wp-content/uploads/2024/06/image-30.png?w=1024)
Step8.
Under ACTIONS, you can choose to Build, Debug, or Flash.
Build:
![](https://raytac.blog/wp-content/uploads/2024/06/image-31.png?w=1024)
Debug:
![](https://raytac.blog/wp-content/uploads/2024/06/image-32.png?w=1024)
Flash:
![](https://raytac.blog/wp-content/uploads/2024/06/image-33.png?w=1024)
4. Programming
nRF Connect SDK(NCS) supports programming. You can use the “Programmer” tool to flash .hex file.
Here’s how:
Step1.
Open “nRF Connect for Desktop” → Select “Programmer” → then click” Open”.
![](https://raytac.blog/wp-content/uploads/2024/06/image-34.png?w=1024)
Click “Select Device”;
![](https://raytac.blog/wp-content/uploads/2024/06/image-35.png?w=1024)
Since AN7002 Wi-Fi IC does not act as an MCU,
we can only flash the .hex file into the MDBT53(nRF5340) BLE IC.
![](https://raytac.blog/wp-content/uploads/2024/06/image-36.png?w=1024)
Click “Add file” to add the .hex file.
![](https://raytac.blog/wp-content/uploads/2024/06/image-37.png?w=1024)
Step2.
Select the .hex file you want to flash.
![](https://raytac.blog/wp-content/uploads/2024/06/image-38.png?w=1024)
The hex file will be written into the part of the memory layout (where orange part is highlighted).
![](https://raytac.blog/wp-content/uploads/2024/06/image-39.png?w=1024)
Slashes will be displayed in the circled part during the flash process.
![](https://raytac.blog/wp-content/uploads/2024/06/image-40.png?w=1024)
Step3.
Once the flash process is completed, connect Raytac’s AN7002Q-DB-5340 development board to PuTTY.
![](https://raytac.blog/wp-content/uploads/2024/06/20_22_gnd.jpg?w=1024)
Tx to p0.20
Rx to p0.22
GND to GND
![](https://raytac.blog/wp-content/uploads/2024/06/20_22_gnd_close1.jpg?w=758)
This is a closer look into the pins that will be connected.
The flash process is completed when the LOG is displayed as circled below.
![](https://raytac.blog/wp-content/uploads/2024/06/image-41.png?w=1024)
Check if hardware connection is successful using PuTTY.
![](https://raytac.blog/wp-content/uploads/2024/06/image-42.png?w=1024)
Useful references:
Edited by Sales Manager: Ms. Vicky Huang
Technical guidance provided by R&D Manager: Mr. MW Lee
Hardware environment provided by Hardware Engineer: Mr. Kyle Wang
Raytac Corporation 勁達國際電子股份有限公司
Bluetooth & WiFi module maker based on Nordic nRF54, nRF53, nRF52, nRF7002 solution
BT5.4 &BT5.3 & BT5.2 & BT5.1 Qualified, FCC/IC/CE/Telec/KC/RCM/SRRC/NCC Pre-Certified.
Bluetooth Solution: nRF54, nRF5340, nRF52840, nRF52833, nRF52832, nRF52820, nRF52811, nRF52810, nRF52805, nRF51822
WiFi Solution: nRF7002
http://www.raytac.com
email: service@raytac.com
Tel: +886-2-3234-0208