How to set up Hardware & Software, Build & Compile Firmware, Validate DFU, and Wifi SCAN using Raytac’s Nordic nRF7002+nRF5340 WiFi+BLE Devkit-AN7002Q-DB-5340-M

Raytac has advanced the dev kit version of bundle offer – WIFI+BLE: AN7002Q-DB-
5340-M with an on-board flash memory(MX25R64) to create easy evaluation
for Wi-Fi project developments.

Table of Content———————————————————————————————————

  1. Hardware Set Up
    A. Project WITHOUT External Flash MX25R64 needed
    B. Project WITH External Flash MX25R64 needed
  2. Software Resources & Preparations
  3. Firmware Build & Compile
    A. Project WITHOUT External Flash MX25R64 needed
    B. Project WITH External Flash MX25R64 needed
  4. Validate DFU Process & WIFI SCAN

—————————————————————————————————————————-


1. Hardware Set Up

Hardware Kit on hand:

Note: Pease make sure to have both “Nordic nRF5340-DK” and “AN7002Q-DB-5340-M” connected and running during the WIFI+BLE (nRF7002+nRF5340) project development.

Hardware Network:
IDC Ribbon Wire(J-Link Cable): Connect nRF5340-DK to AN7002Q-DB-5340-M
USB Wire –Type C USB: Power supply to AN7002Q-DB-5340-M through USB TYPE-C
USB Wire-Micro USB: Power supply to nRF5340-DK through Micro USB

A. Project WITHOUT External Flash MX25R64 needed
– Allocate QSPI for communication between MDBT53 (BLE) and AN7002Q (WIFI)
– External flash MX25R64 flash memory is not activated
NO additional resistor swapping needed, keep it as it is on board now. The Resistors on board align with the Nordic board definition (same as nRF7002-DK).
– Please closely follow the definition chart printed on back side of board AN7002Q-DB-5340-M.
“Component Options Table” > “AN7002Q active with QSPI (Typ)”


– Photo showing the resistor allocation:


– Schematic of the AN7002Q-DB-5340-M(Click on the image to zoom in):


B. Project WITH External Flash MX25R64 needed
– Allocate SPI for communication between MDBT53 (BLE) and AN7002Q (WIFI)
– Allocate QSPI for XIP: External flash MX25R64 is activated
– It is REQUIRED to reallocate resistors to swap the QSPI and SPI on the AN7002Q-DB-5340-M in order to activate the circuit for MX25R64.
Do necessary resistors swapping manually (closely follow the definition chart printed on back side of board AN7002Q-DB-5340-M.)
Component Options Table” >  “External flash and AN7002Q active with SPI enable


– Photo showing the resistor allocation:
Detach the resistor -R27
Component Options Table” >  “External flash and AN7002Q active with SPI enable
<<< Necessary resistors swapping manually needed ↓ >>>


– Schematic of the AN7002Q-DB-5340-M(Click on the image to zoom in):
Modify the above resistors swapped and necessary component based on the chart:
“Component Options Table” >  “External flash and AN7002Q active with SPI enable”


!! Important Note:!!
The circuit of SW1(p1.08)/SW2(p1.09)/LED1(p1.06) on AN7002Q-DB-5340-M is NOT COMPATIBLE to Nordic WI-FI Control Pin of swctrl1(p1.08)/host_irq(p1.09)/grant(p1.06).
In this case, if you’re working with external flash MX25R64 for the WIFI project, Please avoid pin SW1/SW2/LED1 usage while LED2(p1.07) remains available as normal usage.
For the design perspective of mother board/carrier board /target board (mounted with AN7002Q & MDBT53 modules), it is required to design the circuit align to SW1(p0.23)/SW2(p0.24)/LED1(p0.28).



2. Software Resources & Preparations
Download nRF Connect For Desktop (Please Click Me)
Download nRF Command Line Tools (Please Click Me)

Step 1: Prepared with the latest version of nRF Connect for Desktop, using Windows 64-bit – 5.2.0
Step 2: Prepared with the latest version of Command Line Tools, using Windows X86 64 – 10.24.2

**Note: SEGGER J-LINK Upgrade message might pop up while you’re doing above downloads.

 If you’re initiating Segger Embedded Studio (SES) application, please check the guideline here(Click me) 

Step 3: Locate all the necessary kits for programming in PC



3. Firmware Build & Compile
After you download and set up nRFConnect SDK (NCS), you will be able to apply free VS (Visual Studio) Code IDE as firmware programming tool.
Here’re the guidelines to developing programs without/with External Flash MX25R64.

A. Project WITHOUT External Flash MX25R64 needed
You can directly build/compile on Nordic NCS without any additional configurations/modifications needed.

B. Project WITH External Flash MX25R64 needed
– Allocate SPI for communication between MDBT53 (BLE) and AN7002Q (WIFI)
– Allocate QSPI for XIP: External flash MX25R64 is activated

The below example uses NCS v3.1.1 and runs the under: C:\ncs

Step 1: Start with a Wi-Fi Scan project and run the program under: C:\ncs\v3.1.1\raytac
<<Create a new application and Copy a sample>>


Step 2: Select SDK v3.1.1 to copy the sample


Step 3: Select example by entering keyword: wifi scan(Wi-Fi Scan)


Step 4: Enter application location and name the project as: wifi_scan_uart_dfu


Step 5: Open an existing application and find the registered project: wifi_scan_uart_dfu

★★How to activate the Devicetree setting of Wi-Fi nRF7002 and Create file: nrf5340dk_nrf5340_cpuapp.overlay
Code example is as follows:
/ {
  chosen {
              aliases {
                       /delete-node/ leds;
                       /delete-node/ buttons;               
              }; 
          }; 

          leds {
                   compatible = “gpio-leds";

                   led1: led_1 {
                             gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
                             label = “Green LED 1″;
                   };

          };

          /* These aliases are provided for compatibility with samples */
          aliases {
                   led1 = &led1;
          };
};

&mx25r64 {
  status = “okay";
};

/ {
          chosen {
                   nordic,pm-ext-flash = &mx25r64;
                   zephyr,wifi = &wlan0;
          };
};

&gpio_fwd {
    /delete-node/ uart;
};

&gpio_fwd
{
  status = “disabled";
};

&qspi {
          status = “okay";
          pinctrl-0 = <&qspi_default>;
          pinctrl-1 = <&qspi_sleep>;
          pinctrl-names = “default", “sleep";
          mx25r64: mx25r6435f@0 {
                   compatible = “nordic,qspi-nor";
                   reg = <0>;
                   /* MX25R64 supports only pp and pp4io */
                   writeoc = “pp4io";
                   /* MX25R64 supports all readoc options */
                   readoc = “read4io";
                   sck-frequency = <8000000>;
                   jedec-id = [c2 28 17];
                   sfdp-bfp = [
                             e5 20 f1 ff  ff ff ff 03  44 eb 08 6b  08 3b 04 bb
                             ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
                             10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 68 44
                             30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
                   ];
                   size = <67108864>;
                   has-dpd;
                   t-enter-dpd = <10000>;
                   t-exit-dpd = <35000>;
          };
};

&spi1 {
    status = “okay";
    compatible = “nordic,nrf-spim";
    pinctrl-0 = <&spi1_default>;
    pinctrl-1 = <&spi1_sleep>;
    pinctrl-names = “default", “sleep";
cs-gpios = <&gpio1 12 GPIO_ACTIVE_LOW >;
nrf70: nrf7002@0 {
    status = “okay";
compatible = “nordic,nrf7002-spi";
reg = <0>;
spi-max-frequency = <24000000>;
/* Wi-Fi Pins used */
iovdd-ctrl-gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
bucken-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
host-irq-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
wlan0: wlan {
compatible = “nordic,wlan";
};
wifi-max-tx-pwr-2g-dsss = <21>;
wifi-max-tx-pwr-2g-mcs0 = <16>;
wifi-max-tx-pwr-2g-mcs7 = <16>;
wifi-max-tx-pwr-5g-low-mcs0 = <9>;
wifi-max-tx-pwr-5g-low-mcs7 = <9>;
wifi-max-tx-pwr-5g-mid-mcs0 = <11>;
wifi-max-tx-pwr-5g-mid-mcs7 = <11>;
wifi-max-tx-pwr-5g-high-mcs0 = <13>;
wifi-max-tx-pwr-5g-high-mcs7 = <13>;       
};

nrf_radio_coex: nrf7002-coex {
status = “okay";
compatible = “nordic,nrf700x-coex";
req-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
status0-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
grant-gpios = <&gpio1 6 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>;
swctrl1-gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; 
};         
};

&pinctrl {
  spi1_default: spi1_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
<NRF_PSEL(SPIM_MOSI, 1, 13)>,
<NRF_PSEL(SPIM_MISO, 1, 14)>;
};
  };
  spi1_sleep: spi1_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
<NRF_PSEL(SPIM_MOSI, 1, 13)>,
<NRF_PSEL(SPIM_MISO, 1, 14)>;
low-power-enable;
};
  };
};

/ {
chosen {
zephyr,console = &uart2;
zephyr,shell-uart = &uart2;                                 
};
};

&uart2 {
status = “okay";
current-speed = <115200>;
pinctrl-0 = <&uart2_default>;
pinctrl-1 = <&uart2_sleep>;
pinctrl-names = “default", “sleep";
};

&pinctrl {
uart2_default: uart2_default {
                  group1 {
                          psels = <NRF_PSEL(UART_TX, 1, 2)>,
                                     <NRF_PSEL(UART_RX, 1, 3)>;
                          bias-pull-up;
                  };
};
uart2_sleep: uart2_sleep {
                  group1 {
                          psels = <NRF_PSEL(UART_TX, 1, 2)>,
                                     <NRF_PSEL(UART_RX, 1, 3)>;
                          low-power-enable;
                  };
};
};


Step 7: It is required to do MCUBoot before working with DFU using External Flash
Please do the code configuration in sysbuild.conf as following reference code.

SB_CONFIG_BOOTLOADER_MCUBOOT=y
# DFU with UART
SB_CONFIG_MCUBOOT_MODE_SINGLE_APP=n

# DFU with external flash
SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y

Step 8: It is required to do MCUMGR before working with DFU over UART
Please do the code configuration in prj.conf as following reference code.

# Enable QSPI driver for Application
CONFIG_NORDIC_QSPI_NOR=y

# Enable mcumgr DFU in application
CONFIG_MCUMGR=y    
CONFIG_NET_BUF=y
CONFIG_ZCBOR=y  
CONFIG_CRC=y    

# Enable mcumgr management for both OS and Images
CONFIG_MCUMGR_GRP_OS=y 
CONFIG_MCUMGR_GRP_IMG=y
CONFIG_FLASH=y
CONFIG_IMG_MANAGER=y
CONFIG_STREAM_FLASH=y
CONFIG_FLASH_MAP=y

# Configure MCUMGR transport to UART
CONFIG_MCUMGR_TRANSPORT_UART=y
CONFIG_BASE64=y

Step 9: Add with MCUBoot setting , and create a root for sysbuild ; Build with file mucboot.overlay & file mcuboot.conf

9A. With mucboot.overlay
&mx25r64 {
status = “okay";
};

/ {
          chosen {
                   nordic,pm-ext-flash = &mx25r64;
          };
};

&gpio_fwd {
/delete-node/ uart;
};

&gpio_fwd
{
status = “disabled";
};

9B. With file: mcuboot.conf

CONFIG_NORDIC_QSPI_NOR=y
CONFIG_BOOT_MAX_IMG_SECTORS=512

Step 10: Create a VERSION file by referencing the following code when testing DFU over UART.
VERSION_MAJOR = 99
VERSION_MINOR = 0
PATCHLEVEL = 0
VERSION_TWEAK = 0
EXTRAVERSION =

Step 11: Add build configuration.


Step 12: Add build configuration >> Choose Board target: nrf5340dk/nrf5340/cpuapp


Step 13: Generate and Build


Step 14: Generate a Merged.hex file after compiling the program


Step15: You can choose Build/Debug/Flash under ACTIONS during development
<< Build >>


<< Debug >>


<< Flash >>


Step 16: Go to ACTIONS >> Memory report


Now you can see partitions available in the system. mcu_secondary has already been located in MX25R64 flash memory.



4. Test/Validate DFU Process & WIFI SCAN
After the firmware programmed to MDBT53 module on board, we use the USB to UART adaptor board for connection AN7002Q-DB-5340-M through: A. MCUMGR UART to PC and through: B. WiFi Scan UART to PC respectively.
Note: We suggest you finish connecting A. and B. before running tests.



Now we can run the tests.

A. DFU over UART – Using AuTerm Program
1. We can locate Image version=V99.0.0 under the current VERSION file


It also indicates Image version: 99.0.0 in MCUmgr-Slot 0.


2. Try to modify the file version from V99 to V100 under VERSION file:
VERSION_MAJOR = 100

VERSION_MINOR = 0

PATCHLEVEL = 0

VERSION_TWEAK = 0

EXTRAVERSION =

And go with “Pristine Build”


3. We’re about to run DFU over UART , Please DO NOT do “Flash” or “Erase”.


Proceed with “Force reboot”


4. It’s now Version 100.0.0 in Slot 0 under MCUgr ⭢ DFU over UART successfully done!


Before it was Version 99.0.0 in Slot 1 under MCUgr.


B. WIFI SCAN – PuTTY Console
WIFI SCAN credentials can be located under PC Console – PuTTY.



Useful references:
Nordic Developer Academy
nRF Connect SDK Documentation
Wi-Fi Samples
Nordic DevZone – Technical Forum



Edited by Business Development Manager: Jocelyn Tsai
Technical Guidance by R&D Manager: MW Lee

Raytac Corporation 勁達國際電子股份有限公司 / Raytac Corporation (USA) / abietec Inc.
A Bluetooth, Wi-Fi, and LoRa Module Maker/ODM & OEM Manufacturer based on
Nordic nRF54; nRF53: nRF52; nRF51; nRF7002
Semtech Specification: SX1262

Bluetooth Specification: BT6 ; BT5.4 ; BT5.3 ; BT5.2.
Wi-Fi Specification: Wi-Fi 6
LoRa Specification: LoRaWAN

All products are FCC/IC/CE/Telec/KC/RCM/SRRC/NCC/WPC/RoHS/Reach Pre-Certified.
http://www.raytac.com
https://www.raytac.com/contact/
email: sales@raytac.com
Tel: +886-2-3234-0208(TW)/+1-626-217-3139(USA)



MCUboot DFU Guide For Raytac MDBT50Q-DB-40 (Using NCS V2.9.1)

This guide teaches you how to use MCUboot for DFU (Device Firmware Update),
Combined with nRF Connect SDK (NCS) V2.9.1 to upgrade firmware on Raytac’s MDBT50Q series modules.


Table of contents:

  1. Hardware Set Up
  2. Software Kits resource download & install
  3. Compile and load the program
    a. Open VS Code
    b. Project setup
    c. Setup the situation for DFU over UART or DFU over USB
    d. Start compiling your project
    e. Load your compiled program into the MDBT50Q-DB-40 demo board
  4. DFU to MDBT50Q-DB-40 over UART / USB
  5. Execute USB DFU using AuTerm
  6. DFU using your custom keys

1. Hardware setup
– Equip Raytac’s MDBT50Q-DB-40 development board
– Ensure the board is connected via USB to your PC


2.Software Kits resources download & install
– Resources download:
nRF Connect for Desktop – Download nRF Connect for Desktop (Please Click Me)
nRF Command Line Tools – Download nRF Command Line Tools (Please Click Me)
Visual Studio Code – Download Visual Studio Code(Please Click Me)

Install nRF Connect for Desktop ➔ install Programmer and Toolchain Manager.


Open Toolchain Manager and install SDK V2.9.1.


Install Visual Studio Code


3. Compile and load the program
a. Open VS Code(Visual Studio Code)


Note:
If it’s your first time using the software: after installing all the extensions, you should see the same on your screen.


b. Project setup
b.1 Create an example code(In this article: peripheral_uart)
Please refer to the following steps:
Create a new application ➔ Copy a sample ➔ NCS V2.9.1


b.2 Name the Project: peripheral_uart
Input peripheral_uart and the corresponding example program will appear in the options section below.


Note: We named the project peripheral_uart_mcuboot to distinguish it.
This project will create a directory named peripheral_uart_mcuboot.

c. Build an environment for DFU over UART or DFU over USB
– Create a new application ➔ Open

Right click on the project name you just created (peripheral_uart_mcuboot), a pop-up menu will appear. Select the first option “Show in Explorer" from the pop-up menu to display all project files.


Then select New File to create a sysbuild.conf file.


select sysbuild.conf, left-click on it, and a blank box will show.


Input the file name and write: SB_CONFIG_BOOTLOADER_MCUBOOT=y


Parameters and instructions
Add a new file mcuboot.conf, in the sysbuild folder, and input the following parameters into the file. (Add relevant parameters according to UART or USB)
(Note: Please be informed if you want to use DFU over UART in the end, you should use UART when you first create the environment. Similarly, if you want to use DFU over USB, you should create the USB environment at the beginning.)

For DFU over UART
# Enable logging for MCUboot
CONFIG_LOG=y
CONFIG_MCUBOOT_LOG_LEVEL_WRN=y
# Enable Serial Recovery over UART
CONFIG_MCUBOOT_SERIAL=y
# Disable UART, since Serial Recovery uses it
CONFIG_UART_CONSOLE=n
# Configure the bootloader to use two slots
CONFIG_SINGLE_APPLICATION_SLOT=n
# Turn on a LED so we can see when Serial Recovery mode is active
CONFIG_MCUBOOT_INDICATION_LED=y


For DFU over USB
# Enable logging for MCUboot
CONFIG_LOG=y
CONFIG_MCUBOOT_LOG_LEVEL_WRN=y
# Enable Serial Recovery over UART
CONFIG_MCUBOOT_SERIAL=y
# Disable UART, since Serial Recovery uses it
CONFIG_UART_CONSOLE=n
# Configure bootloader to use two slots
CONFIG_SINGLE_APPLICATION_SLOT=n
# Turn on a LED so we can see when Serial Recovery mode is active
CONFIG_MCUBOOT_INDICATION_LED=y
# Configure serial recovery to use CDC_ACM, which by default uses the USB
CONFIG_BOOT_SERIAL_CDC_ACM=y
# Increase flash space for the MCUboot image to fit USB drivers
CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x10000


Create a new file: mcuboot.overlay and add the following parameters.


For DFU over UART
/* Configure button and LED for Serial Recovery */
/ {
    aliases {
          mcuboot-button0 = &button0;
          mcuboot-led0 = &led0;
    };
  };


For DFU over USB
/* Configure button and LED for Serial Recovery */
/ {
    aliases {
          mcuboot-button0 = &button0;
          mcuboot-led0 = &led0;
    };
  };
/* Configure CDC ACM */
&zephyr_udc0 {
            cdc_acm_uart0: cdc_acm_uart0 {
                        compatible = “zephyr,cdc-acm-uart";
            };
};


Note: if you use DFU over USB, please enable the USB subsystem in prj.conf.


After all the setup is completed, you can start compiling your project.


d. Start compiling your project
Add Build Configuration ➔ Select target board ➔ In this example, choose raytac_mdbt50q_db_40/nrf52840.


Start compiling by clicking “Generate and Build" at the bottom-right corner.


e. Load your compiled program into the MDBT50Q-DB-40 demo board
After compiling without error, select the flash function to load your program into the MDBT50Q-DB-40 demo board.


If the below is shown, it means that you have successfully loaded your program into the demo board.


4. DFU to MDBT50Q-DB-40 through UART / USB
DFU over UART
Hold the SW2 button then plug the power into the USB connector.
The system will enter the bootloader mode.
You can then DFU the new firmware via the UART.


DFU over USB
If you update your firmware through USB, please also hold the SW2 button and connect the USB cable.


5. Execute USB DFU using AuTerm
AuTerm is a free-for-download PC software on Windows.
It allows you to update your new firmware on the MDBT50Q-DB-40 demo board.
Download link:
https://github.com/thedjnK/AuTerm/releases/download/v0.35a-pre/AuTerm_test_Win_x64_v0.35a.7z

Steps:
Select the tab Config to set the correct COM port.


Follow the sequences in the below screenshot.


You can use the file peripheral_uart_mcuboot.signed.bin for testing.
It is located in peripheral_uart_mcuboot/build.
Then follow the sequences in the below screenshot.
DFU will be completed when the progress reaches 100%.


6. DFU using your custom keys
When you compile the code, you will see the below warning.
Reason: It’s required to have your own private key to ensure your product’s security.
Following are the steps to enable security features.


Step 1. Create the key
First, install the imgtool program using pip.


Then use the following command to generate your private key in your project folder.
After the private key is generated, you can access it in your directory.


Step 2. Configure the project to use this key in sysbuild.conf

# Add MCUboot
SB_CONFIG_BOOTLOADER_MCUBOOT=y
#Add private key for MCUboot
SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="\${APP_DIR}/private_key.pem"
# Configure key type
SB_CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y


Step 3. Build and flash the project again. Your firmware will have security features.


Edited by Account Manager: Mr. Welson Kuo


Raytac Corporation 勁達國際電子股份有限公司 / Raytac Corporation (USA)
A Bluetooth, Wi-Fi, and LoRa Module Maker/ODM & OEM Manufacturer based on
Nordic nRF54; nRF53: nRF52; nRF51; nRF7002
Semtech Specification: SX1262


Bluetooth Specification: BT6.1 ; BT6 ; BT5.4 ; BT5.3 ; BT5.2.
Wi-Fi Specification: Wi-Fi 6
LoRa Specification: LoRaWAN


All products are FCC/IC/CE/Telec/KC/RCM/SRRC/NCC/WPC Pre-Certified.
http://www.raytac.com
https://www.raytac.com/contact/
email: sales@raytac.com
Tel: +886-2-3234-0208(TW)/+1-626-217-3139(USA)


Step-by-Step Guide to Purchasing MAC Addresses from IEEE for Your Devices

Currently, the Nordic Wifi module – AN7002Q on Raytac’s AN7002Q-DB-5340 board isn’t loaded with a Wi-Fi MAC address. You can choose to use your own MAC address or request one from Raytac. Below is a complete tutorial for users who would like to purchase MAC addresses themselves.

Note: Raytac provides two free Wi-Fi MAC addresses (2.4GHz & 5GHz bands) for each AN7002Q module.
If you have a Raytac AN7002Q-DB-5340 demo board but have not received the Wi-Fi MAC addresses, please contact us at sales@raytac.com.



What is a MAC Address?

A MAC address (Media Access Control address) is a unique identifier used to identify network devices. It is typically composed of six groups of two hexadecimal digits, for example, 00:1A:2B:3C:4D:5E. The first six characters are known as the Organizationally Unique Identifier (OUI), which identifies the manufacturer or supplier of the MAC address. Manufacturers can use the OUI to identify the producer of the device.

Each network device’s MAC address should be unique. It is an important identifier used for unique identification among network devices, ensuring that devices can communicate correctly within a local area network. However, it is important to note that MAC addresses can be modified within a local network, so they should not be relied upon as the sole basis for security.


How to Obtain a MAC Address?

The application and distribution of MAC addresses are managed by IEEE (Institute of Electrical and Electronics Engineers). Here’s how to apply for a MAC address from IEEE:
Currently, MAC addresses can only be purchased directly from the IEEE Standards Association in the United States. Depending on the quantity, they can be categorized as:

MA-L (approximately 16 million addresses)
MA-M (approximately 1 million addresses)
MA-S (4096 addresses)



Purchase process

1. Register for an IEEE Account
Visit IEEE’s official website to create an account.


2. Log in and go to the MAC Address Purchase Page
After logging in, navigate to the MAC address purchase page: IEEE MAC Address Purchase


3. Select the number of MAC Addresses to purchase.


4. Fill in your purchase information by providing the required details.


5. Confirm confidentiality
Confirm whether the MAC address purchase is confidential. If you are purchasing publicly registered MA-L, select “No" for this option.


6. Choose payment method
IEEE accepts several payment methods, including mailing a U.S. bank draft, wire transfer in U.S. dollars, and online credit card payment.


7. Receive your OUI
Within 7 working days, IEEE will send an email to the registered email address containing the purchased OUI.


After obtaining the OUI, you can retrieve all the purchased MAC addresses using code and then import them into a database or Excel for management.



Edited by Sales Manager: Ms. Vicky Huang


Raytac Corporation 勁達國際電子股份有限公司 
A Bluetooth, Wi-Fi, and LoRa Module Maker based on
Nordic nRF54; nRF53: nRF52; nRF51; nRF7002
Semtech Specification: SX1262

Bluetooth Specification: BT5.4 ; BT5.3 ; BT5.2.
Wi-Fi Specification: Wi-Fi 6
LoRa Specification: LoRaWAN

All products are FCC/IC/CE/Telec/KC/RCM/SRRC/NCC/WPC Pre-Certified.
http://www.raytac.com
email: sales@raytac.com
Tel: +886-2-3234-0208


FAQ: How to write MAC address into the OTP memory of Raytac’s nRF7002 Wi-Fi module/AN7002Q-DB-5340 DevKit

Recently we have received the FAQ: how to write MAC address into the OTP memory of Raytac’s AN7002Q-P Nordic Wi-Fi module? In this article, we’ll get this question explained to give customers a more smooth experience using the AN7002Q-nRF5340 Demo Board(AN7002Q-DB-5340).

Is there an existing Wi-Fi MAC address in the AN7002Q part on the DevKit?

Currently, the AN7002Q module on Raytac’s AN7002Q-DB-5340 board has no Wi-Fi MAC address.


When running Wi-Fi Scan code/Station code/Shell code…etc. on NCS v2.6.0 (and later versions), the AN7002Q module must have a programed Wi-Fi MAC address to function properly.

Therefore, it’s necessary to follow the below process:
1. Program the original Wi-Fi radio test code (..\nrf\samples\wifi\radio_test) into the MDBT53 section,
2. Then write the Wi-Fi MAC address in to the AN7002Q section(nRF7002 IC) via command.

After this, program the original Wi-Fi Scan code/Station code /Shell code … into the 5340, and it will function properly.

**Raytac will assign 2 Wi-Fi MAC addresses(for both 2.4GHz & 5GHz) to every AN7002Q module.
*If customers don’t have Wi-Fi MAC addresses for DevKit development yet, please reach out to
service@raytac.com



==================================================================================

Case study 1. SCAN code example


Scenario:
Following error occurred when building the SCAN example code, flash it onto the AN7002Q-DB-5340 board, and run the test.

Solution:

When running Wi-Fi scan code on NCS v.2.6.0 or later version, the OTP memory in the AN7002Q module must have a Wi-Fi MAC address programmed in for the Wi-Fi scan functionality to work properly.

(Note: OTP is a One-Time programmable memory, which means the value can only be written once.
The customer must aware of this before performing the OTP operation.)

1. Program the original Wi-Fi radio test code (..\nrf\samples\wifi\radio_test) into the MDBT53 section,
then manually input and execute the following OTP read command.

wifi_radio_ficr_prog otp_read_params

If you see both MAC0 and MAC1 display a value of 0xFF, as shown in above, it means that you haven’t written the Wi-Fi MAC address into the AN7002Q’s OTP.

2. Manually issue the OTP write command to write the Wi-Fi MAC address into the OTP.

https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/wifi/radio_test/ficr.html

wifi_radio_ficr_prog otp_write_params 0x120 0xDDCCBBAA 0xFFEE

wifi_radio_ficr_prog otp_write_params 0x128 0xDDCCBBAA 0xFFEE


After you complete the above, use the OTP read command in below to check if the Wi-Fi MAC address value was written.
The MAC0 and MAC1 should display the value you’ve input from the OTP write command.

wifi_radio_ficr_prog otp_read_params

3. Program the original Wi-Fi SCAN code back into the MDBT53, the Wi-Fi scan functionality should work properly.

==================================================================================

Case study 2. Shell code example

SDK Wi-Fi example test – Running Shell Code on AN7002Q-DB-5340:

Scenario:
An error occurs while running Shell code on AN7002Q-DB-5340.

Solution:
The AN7002Q-DB-5340 is paired with nRF5340 DK for development,
but neither of the 2 boards has an external MX25R64 (Serial NOR Flash) component.
So far, only the nRF7002DK board is equipped with the MX25R64.

Therefore, while running the original Wi-Fi shell code, the program will enable SPI NOR.

When using AN7002Q-DB-5340, you should add CONFIG_SPI_NOR=n in the prj.conf file to disable SPI NOR, to turn off any configurations related to it.


Edited by Sales Manager: Ms. Mandy Chao
Technical guidance provided by R&D Manager: Mr. MW Lee
Keyword: nRF7002 MAC address


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: sales@raytac.com
Tel: +886-2-3234-0208


How to Set Up the Development and Programming Environment for Raytac’s AN7002Q-nRF5340 Demo Board (AN7002Q-DB-5340)?

To help you quickly get started with Raytac’s AN7002 Nordic WiFi 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


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


AN7002Q-DB-5340 Schematic Diagram:

(Click on the image to redirect to product page for Higher resolution photo)


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

(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)


After the installations are completed, you can see the following applications under the:

“Programs and Features" section in the Control Panel.


3. Programming/Development

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”


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.


Step3.

Before installing NCS v2.6.0, confirm the installation path (Default path → C:\ncs).


If you want to change the path, click “Select directory”, and press OK.


Step4.

After installing the nRFConnect SDK v2.6.0, click “Open VS Code”.


Step5.

Open the Wi-Fi scan example


Step6.

Add build configuration → select the board and compile.


Select board: nrf7002dk_nrf5340_cpuapp.


Step7.

After compilation, a hex file will be generated.


Step8.

Under ACTIONS, you can choose to Build, Debug, or Flash.


Build:


Debug:


Flash:


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”.


Click “Select Device”;


Since AN7002 Wi-Fi IC does not act as an MCU,
we can only flash the .hex file into the MDBT53(nRF5340) BLE IC.


Click “Add file” to add the .hex file.


Step2.

Select the .hex file you want to flash.


The hex file will be written into the part of the memory layout (where orange part is highlighted).


Slashes will be displayed in the circled part during the flash process.


Step3.

Once the flash process is completed, connect Raytac’s AN7002Q-DB-5340 development board to PuTTY.

Tx to p0.20

Rx to p0.22

GND to GND

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.


Check if hardware connection is successful using PuTTY.


*2024-Aug-12 update:*
Before running Scan code / Station code / Shell code:
You must ensure that the MAC address has already been programmed into the module.
Click on this link to learn more about how to load the MAC address.


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: sales@raytac.com
Tel: +886-2-3234-0208