coex_wifi_edgefast#
Overview#
The example to demonstrate the usage of Bluetooth BT/BLE and WiFi profiles coexistence.
This document provides step-by-step procedures to build and test the example, and also instructions for running the included sample applications.
Supported Boards#
FRDM-RW612
Overview
This document provides step-by-step procedures to build and test coex examples, and also instructions for running the included sample applications.
Hardware requirements
Type-C cable
FRDMRW612 board
Personal Computer
Board settings
No specail setting to do for wifi&ble coex.
Build and flash
Building
Modify examples/coex_examples/coex_wifi_edgefast/app_config.cmake to generate different coexistence images.
coexistence images |
CONFIG_WIFI |
CONFIG_BLE |
|---|---|---|
WiFi + BLE |
1 |
1 |
Macors releated to Wi-Fi supplicant
Wi-Fi supplicant |
CONFIG_WPA_SUPPLICANT |
|---|---|
embedded supplicant |
0 |
wpa supplicant |
1(default) |
Enable Monolithic feature
Modify
examples/${board}/coex_examples/coex_wifi_edgefast/app_config.h.
Component |
CONFIG_MONOLITHIC_WIFI |
CONFIG_MONOLITHIC_BLE |
CONFIG_MONOLITHIC_BLE_15_4 |
|---|---|---|---|
Wi-Fi |
1(default) |
NA |
NA |
BLE |
NA |
1(default) |
NA |
If want to disable Wi-Fi monolithic feature, define CONFIG_MONOLITHIC_WIFI to 0.
If want to disable BLE monolithic feature, define CONFIG_MONOLITHIC_BLE to 0.
Building coex examples
flash_debug:
$ cd <sdk root>
$ west build -b frdmrw612 examples/coex_examples/coex_wifi_edgefast --toolchain armgcc --config=flash_debug -d coex_wifi_edgefast
flash_release
$ cd <sdk root>
$ west build -b frdmrw612 examples/coex_examples/coex_wifi_edgefast --toolchain armgcc --config=flash_release -d coex_wifi_edgefast
NOTE:
-d coex_wifi_edgefast-> Specify the generated project path. Can name it as needed.Find coex_wifi_edgefast.elf/coex_wifi_edgefast.bin in coex_wifi_edgefast folder.
Only support armgcc to build coex application.
Flash Binaries
Flash the image with the following command,
##### CMD to write CPU3 coex app image to flash in J-link window:
J-Link> loadbin C:\xxx\coex_wifi_edgefast.bin, 0x08000000
NOTE:
Monolithic feature is default enabled, this means it’s no need to flash binaries manually.
If disable Wi-Fi or BLE monolithic feature, download firmware manually.
SB firmware path: mcu-sdk-3.0/components/conn_fwloader/fw_bin
##### CMD to write CPU1 wifi image to flash in J-link window:
J-Link> loadbin C:\xxx\rw61x_sb_wifi_a2.bin,0x08400000
##### CMD to write CPU2 ble to flash in J-link window:
J-Link> loadbin C:\xxx\rw61x_sb_ble_a2.bin,0x08540000
Run
Prepare the Demo
Connect a micro USB cable between the PC host and the MCU-Link USB port (J7) on the board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Launch the debugger in your IDE to begin running the example.
Running the example
The log below shows the output of the coex examples (based on edgefast-shell) in the terminal window:
Coex APP
##### SHELL build: ========================================
##### Initialize RW612 Module
May 14 2024
##### Copyright 2020 NXP
##### WiFi shell initialization
BLE shell initialization
@bt> ========================================
@Coex>
WiFi Test
NOTE: All wifi commands require adding
wifi.prefix.
Get the Wi-Fi driver and firmware version:
@Coex> wifi.wlan-version
WLAN Driver Version : v1.3.r48.p10
@Coex> WLAN Firmware Version : rw610w-V2, IMU, FP99, 18.99.6.p6, PVE_FIX 1
Command wlan-version
Get MAC Address:
@Coex> wifi.wlan-mac
MAC address
@Coex> STA MAC Address: 00:50:43:02:98:23
uAP MAC Address: 00:50:43:02:99:23
Command wlan-mac
Scan the network:
@Coex> wifi.wlan-scan
Scan scheduled...
@Coex> Command wlan-scan
2 networks found:
1C:6A:7A:87:FF:BF "NXP" Infra
mode: 802.11AC
channel: 161
rssi: -74 dBm
security: WPA2 Enterprise
WMM: YES
802.11K: YES
802.11V: YES
802.11W: NA
WPS: NO
1C:6A:7A:87:FF:BE "NXPOPEN" Infra
mode: 802.11AC
channel: 161
rssi: -75 dBm
security: WPA2
WMM: YES
802.11K: YES
802.11V: YES
802.11W: NA
WPS: NO
BLE Test
NOTE: Please use the command “help” to view the specific commands supported by the example.
BLE scan devices (the BLE host must initialized before):
@Coex> bt.init
@Coex> Bluetooth initialized
Settings Loaded
@Coex> bt.scan on
Bluetooth active scan enabled
@Coex> [DEVICE]: 44:6D:F5:85:DC:5F (random), AD evt type 0, RSSI -64 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 44:6D:F5:85:DC:5F (random), AD evt type 4, RSSI -63 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 6D:B3:D3:8E:ED:A2 (random), AD evt type 0, RSSI -77 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 6D:B3:D3:8E:ED:A2 (random), AD evt type 4, RSSI -76 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 3F:FB:95:F7:F9:14 (random), AD evt type 3, RSSI -75 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 49:A3:4E:86:63:0C (random), AD evt type 0, RSSI -76 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 49:A3:4E:86:63:0C (random), AD evt type 4, RSSI -75 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 5C:28:50:F9:DD:57 (random), AD evt type 0, RSSI -82 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 4A:7D:B4:12:7B:7A (random), AD evt type 0, RSSI -82 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 4A:7D:B4:12:7B:7A (random), AD evt type 4, RSSI -82 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 5A:54:C8:99:13:4A (random), AD evt type 0, RSSI -76 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 3B:95:00:4D:F3:EB (random), AD evt type 3, RSSI -82 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 47:9D:D0:CB:5F:0D (random), AD evt type 0, RSSI -86 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
@Coex> bt.scan off
Scan successfully stopped
@Coex>
BLE advertise (the BLE host must initialized before):
@Coex> bt.init
@Coex> Bluetooth initialized
@Coex> bt.advertise on
Advertising started
@Coex> bt.advertise off
Advertising stopped
BLE connect (the BLE host must initialized before):
@Coex> bt.init
@Coex> Bluetooth initialized
@Coex> bt.connect C0:95:63:23:55:87 random
Connection pending
Connected: 7D:FD:FD:4D:FD:90 (random)
BLE pairing and bonding:
GATT peripheral role side,
1. Initialize the Host, press "bt.init",
2. Advertising, press "bt.advertise on",
3. After the connection is established, perform the pairing sequence,
it could be started from peripheral side by pressing "bt.security <level>", such as "bt.security 2".
4. If the bondable is unsupported by peripheral role, press "bt.bondable off". Then start step 3.
GATT central role side,
1. Initialize the Host, press "bt.init",
2. Scaning advertising packets, press "bt.scan on",
3. A few seconds later, stop the scanning, press "bt.scan off"
4. Select the target board and create a new connection. If the taregt is not listed, repeat steps 2 and 3.
Then press "bt.connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>"
5. After the connection is established, perform the pairing sequence,
it could be started from central side by pressing "bt.security <level>", such as "bt.security 2".
6. If the bondable is unsupported by central role, press "bt.bondable off". Then start step 5.
BLE 1M/2M/Coded PHY update:
GATT peripheral role side,
1. Initialize the Host, press "bt.init",
2. Advertising, press "bt.advertise on",
3. After the connection is established.
4. Send phy update command, press "bt.phy-update <tx_phy> [rx_phy] [s2] [s8]", tx_phy/rx_phy could be 1(1M) or 2(2M) or 4(Coded).
such as "bt.phy-update 2 2".
5. The message "LE PHY updated: TX PHY LE 2M, RX PHY LE 2M" would be printed if the phy is updated. note, if peer do not support phy update, then this message will not be printed.
GATT central role side,
1. Initialize the Host, press "bt.init",
2. start scan, press "bt.scan on", Bluetooth device around your current bluetooth will be list, for example,
[DEVICE]: 72:78:C1:B5:0F:DA (random), AD evt type 4, RSSI -32 BLE Peripheral C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: C4:0D:02:55:5E:AD (random), AD evt type 0, RSSI -83 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 66:8F:26:27:1F:52 (random), AD evt type 0, RSSI -82 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
3. stop scan, press "bt.scan off",
4. connect target device, press "bt.connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>", such as bt.connect 72:78:C1:B5:0F:DA random
5. Send phy update command, press "bt.phy-update <tx_phy> [rx_phy] [s2] [s8]", tx_phy/rx_phy could be 1(1M) or 2(2M) or 4(Coded).
such as "bt.phy-update 2 2".
6. The message "LE PHY updated: TX PHY LE 2M, RX PHY LE 2M" would be printed if the phy is updated. note, if peer do not support phy update, then this message will not be printed.
BLE Data Packet Length Extension update:
GATT peripheral role side,
1. Initialize the Host, press "bt.init".
2. Advertising, press "bt.advertise on".
3. After the connection is established.
4. Check current LE RX/TX maximum data length and time, press "bt.info", as blow, default RX/TX maximum data length is 27 and default RX/TX maxumum time is 328.
Type: LE, Role: slave, Id: 0
59:8F:3C:20:93:86 (random)
Remote address: 59:8F:3C:20:93:86 (random) (resolvable)
Local address: 80:D2:1D:E8:30:EC (public) (identity)
Remote on-air address: 59:8F:3C:20:93:86 (random) (resolvable)
Local on-air address: 7C:59:48:2E:A4:51 (random) (resolvable)
Interval: 0x0024 (45 ms)
Latency: 0x0000 (0 ms)
Supervision timeout: 0x0190 (4000 ms)
LE PHY: TX PHY LE 1M, RX PHY LE 1M
LE data len: TX (len: 27 time: 328) RX (len: 27 time: 328)
5. When LE data len is updated by the peer device, below information will be printed.
LE data len updated: TX (len: 27 time: 328) RX (len: 50 time: 512)
6. Update maximum tx data length, press "bt.data-len-update <tx_max_len> [tx_max_time]", such as bt.data-len-update 65, below information will be printed.
Calculated tx time: 632
59:8F:3C:20:93:86 (random)
data len update initiated.
LE data len updated: TX (len: 65 time: 632) RX (len: 50 time: 512)
GATT central role side,
1. Initialize the Host, press "bt.init".
2. Start scan, press "bt.scan on", Bluetooth device around your current bluetooth will be list, for example,
[DEVICE]: 7C:59:48:2E:A4:51 (random), AD evt type 4, RSSI -44 BLE Peripheral C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
3. Stop scan, press "bt.scan off",
4. Connect target device, press "bt.connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>", such as bt.connect 7C:59:48:2E:A4:51 random
5. Check current LE RX/TX maximum data length and time, press "bt.info", as blow, default RX/TX maximum data length is 27 and default RX/TX maxumum time is 328.
Type: LE, Role: master, Id: 0
7C:59:48:2E:A4:51 (random)
Remote address: 7C:59:48:2E:A4:51 (random) (resolvable)
Local address: C0:95:DA:00:BC:82 (public) (identity)
Remote on-air address: 7C:59:48:2E:A4:51 (random) (resolvable)
Local on-air address: 59:8F:3C:20:93:86 (random) (resolvable)
Interval: 0x0024 (45 ms)
Latency: 0x0000 (0 ms)
Supervision timeout: 0x0190 (4000 ms)
LE PHY: TX PHY LE 1M, RX PHY LE 1M
LE data len: TX (len: 27 time: 328) RX (len: 27 time: 328)
6. Update maximum tx data length, press "bt.data-len-update <tx_max_len> [tx_max_time]", such as bt.data-len-update 50, below information will be printed.
Calculated tx time: 512
7C:59:48:2E:A4:51 (random)
data len update initiated.
LE data len updated: TX (len: 50 time: 512) RX (len: 27 time: 328)
7. When LE data len is updated by the peer device, below information will be printed.
LE data len updated: TX (len: 50 time: 512) RX (len: 65 time: 632)
BLE GATT data signing:
GATT peripheral role side,
1. Initialize the Host, press "bt.init",
2. Advertising, press "bt.advertise on",
3. After the connection is established, perform the pairing sequence,
it could be started from peripheral side by pressing "bt.security <level>", such as "bt.security 2",
4. After the authentication is successfully, disconnect the connection,
it could be started from peripheral side by pressing "bt.disconnect",
5. Waiting for new connection. After the connection is established (LL enceyption should be disabled),
add new serivce "gatt.register".
GATT central role side,
1. Initialize the Host, press "bt.init",
2. Scaning advertising packets, press "bt.scan on",
3. A few seconds later, stop the scanning, press "bt.scan off"
4. Select the target board and create a new connection. If the taregt is not listed, repeat steps 2 and 3.
Then press "bt.connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>"
5. After the connection is established, perform the pairing sequence,
it could be started from central side by pressing "bt.security <level>", such as "bt.security 2",
6. After the authentication is successfully, disconnect the connection,
it could be started from central side by pressing "bt.disconnect",
7. Repeat the steps 2 and 3. After the connection is established (LL enceyption should be disabled),
perform the GATT data signing sequence, press "gatt.signed-write <handle> <data> [length] [repeat]",
such as "gatt.signed-write 22 AA 1"
BLE GATT Service Changed Indication:
GATT peripheral role side,
1. Initialize the Host, press "bt.init",
2. Advertising, press "bt.advertise on",
3. After the connection is established. and waiting for the service changed indication is subsribed,
4. Add new serivce, press "gatt.register",
5. Remove the added serivce, press "gatt.unregister".
GATT central role side,
1. Initialize the Host, press "bt.init",
2. Scaning advertising packets, press "bt.scan on",
3. A few seconds later, stop the scanning, press "bt.scan off"
4. Select the target board and create a new connection. If the taregt is not listed, repeat steps 2 and 3.
Then press "bt.connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>"
5. After the connection is established, subscribe the GATT service changed indicator. press "bt.subscribe <CCC handle> <value handle> [ind]",
such as "gatt.subscribe f e ind".
RD-RW612-BGA
Overview
This document provides step-by-step procedures to build and test coex examples, and also instructions for running the included sample applications.
Hardware requirements
Micro USB cable
RD-RW612-BGA board
Personal Computer
Board settings
No specail setting to do for wifi&ble coex.
Build and flash
Building
Modify examples/coex_examples/coex_wifi_edgefast/app_config.cmake to generate different coexistence images.
coexistence images |
CONFIG_WIFI |
CONFIG_BLE |
|---|---|---|
WiFi + BLE |
1 |
1 |
Macors releated to Wi-Fi supplicant
Wi-Fi supplicant |
CONFIG_WPA_SUPPLICANT |
|---|---|
embedded supplicant |
0 |
wpa supplicant |
1(default) |
Enable Monolithic feature
Modify
examples/${board}/coex_examples/coex_wifi_edgefast/app_config.h.
Component |
CONFIG_MONOLITHIC_WIFI |
CONFIG_MONOLITHIC_BLE |
CONFIG_MONOLITHIC_BLE_15_4 |
|---|---|---|---|
Wi-Fi |
1(default) |
NA |
NA |
BLE |
NA |
1(default) |
NA |
If want to disable Wi-Fi monolithic feature, define CONFIG_MONOLITHIC_WIFI to 0.
If want to disable BLE monolithic feature, define CONFIG_MONOLITHIC_BLE to 0.
Building coex examples
flash_debug:
$ cd <sdk root>
$ west build -b rdrw612bga examples/coex_examples/coex_wifi_edgefast --toolchain armgcc --config=flash_debug -d coex_wifi_edgefast
flash_release
$ cd <sdk root>
$ west build -b rdrw612bga examples/coex_examples/coex_wifi_edgefast --toolchain armgcc --config=flash_release -d coex_wifi_edgefast
NOTE:
-d coex_wifi_edgefast-> Specify the generated project path. Can name it as needed.Find coex_wifi_edgefast.elf/coex_wifi_edgefast.bin in coex_wifi_edgefast folder.
Only support armgcc to build coex application.
Flash Binaries
Flash the image with the following command,
##### CMD to write CPU3 coex app image to flash in J-link window:
J-Link> loadbin C:\xxx\coex_wifi_edgefast.bin, 0x08000000
NOTE:
Monolithic feature is default enabled, this means it’s no need to flash binaries manually.
If disable Wi-Fi or BLE monolithic feature, download firmware manually.
SB firmware path: mcu-sdk-3.0/components/conn_fwloader/fw_bin
##### CMD to write CPU1 wifi image to flash in J-link window:
J-Link> loadbin C:\xxx\rw61x_sb_wifi_a2.bin,0x08400000
##### CMD to write CPU2 ble to flash in J-link window:
J-Link> loadbin C:\xxx\rw61x_sb_ble_a2.bin,0x08540000
Run
Prepare the Demo
Connect a micro USB cable between the PC host and the MCU-Link USB port (J7) on the board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Launch the debugger in your IDE to begin running the example.
Running the example
The log below shows the output of the coex examples (based on edgefast-shell) in the terminal window:
Coex APP
##### SHELL build: ========================================
##### Initialize RW612 Module
May 14 2024
##### Copyright 2020 NXP
##### WiFi shell initialization
BLE shell initialization
@bt> ========================================
@Coex>
WiFi Test
NOTE: All wifi commands require adding
wifi.prefix.
Get the Wi-Fi driver and firmware version:
@Coex> wifi.wlan-version
WLAN Driver Version : v1.3.r48.p10
@Coex> WLAN Firmware Version : rw610w-V2, IMU, FP99, 18.99.6.p6, PVE_FIX 1
Command wlan-version
Get MAC Address:
@Coex> wifi.wlan-mac
MAC address
@Coex> STA MAC Address: 00:50:43:02:98:23
uAP MAC Address: 00:50:43:02:99:23
Command wlan-mac
Scan the network:
@Coex> wifi.wlan-scan
Scan scheduled...
@Coex> Command wlan-scan
2 networks found:
1C:6A:7A:87:FF:BF "NXP" Infra
mode: 802.11AC
channel: 161
rssi: -74 dBm
security: WPA2 Enterprise
WMM: YES
802.11K: YES
802.11V: YES
802.11W: NA
WPS: NO
1C:6A:7A:87:FF:BE "NXPOPEN" Infra
mode: 802.11AC
channel: 161
rssi: -75 dBm
security: WPA2
WMM: YES
802.11K: YES
802.11V: YES
802.11W: NA
WPS: NO
BLE Test
NOTE: Please use the command “help” to view the specific commands supported by the example.
BLE scan devices (the BLE host must initialized before):
@Coex> bt.init
@Coex> Bluetooth initialized
Settings Loaded
@Coex> bt.scan on
Bluetooth active scan enabled
@Coex> [DEVICE]: 44:6D:F5:85:DC:5F (random), AD evt type 0, RSSI -64 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 44:6D:F5:85:DC:5F (random), AD evt type 4, RSSI -63 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 6D:B3:D3:8E:ED:A2 (random), AD evt type 0, RSSI -77 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 6D:B3:D3:8E:ED:A2 (random), AD evt type 4, RSSI -76 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 3F:FB:95:F7:F9:14 (random), AD evt type 3, RSSI -75 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 49:A3:4E:86:63:0C (random), AD evt type 0, RSSI -76 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 49:A3:4E:86:63:0C (random), AD evt type 4, RSSI -75 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 5C:28:50:F9:DD:57 (random), AD evt type 0, RSSI -82 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 4A:7D:B4:12:7B:7A (random), AD evt type 0, RSSI -82 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 4A:7D:B4:12:7B:7A (random), AD evt type 4, RSSI -82 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 5A:54:C8:99:13:4A (random), AD evt type 0, RSSI -76 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 3B:95:00:4D:F3:EB (random), AD evt type 3, RSSI -82 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 47:9D:D0:CB:5F:0D (random), AD evt type 0, RSSI -86 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
@Coex> bt.scan off
Scan successfully stopped
@Coex>
BLE advertise (the BLE host must initialized before):
@Coex> bt.init
@Coex> Bluetooth initialized
@Coex> bt.advertise on
Advertising started
@Coex> bt.advertise off
Advertising stopped
BLE connect (the BLE host must initialized before):
@Coex> bt.init
@Coex> Bluetooth initialized
@Coex> bt.connect C0:95:63:23:55:87 random
Connection pending
Connected: 7D:FD:FD:4D:FD:90 (random)
BLE pairing and bonding:
GATT peripheral role side,
1. Initialize the Host, press "bt.init",
2. Advertising, press "bt.advertise on",
3. After the connection is established, perform the pairing sequence,
it could be started from peripheral side by pressing "bt.security <level>", such as "bt.security 2".
4. If the bondable is unsupported by peripheral role, press "bt.bondable off". Then start step 3.
GATT central role side,
1. Initialize the Host, press "bt.init",
2. Scaning advertising packets, press "bt.scan on",
3. A few seconds later, stop the scanning, press "bt.scan off"
4. Select the target board and create a new connection. If the taregt is not listed, repeat steps 2 and 3.
Then press "bt.connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>"
5. After the connection is established, perform the pairing sequence,
it could be started from central side by pressing "bt.security <level>", such as "bt.security 2".
6. If the bondable is unsupported by central role, press "bt.bondable off". Then start step 5.
BLE 1M/2M/Coded PHY update:
GATT peripheral role side,
1. Initialize the Host, press "bt.init",
2. Advertising, press "bt.advertise on",
3. After the connection is established.
4. Send phy update command, press "bt.phy-update <tx_phy> [rx_phy] [s2] [s8]", tx_phy/rx_phy could be 1(1M) or 2(2M) or 4(Coded).
such as "bt.phy-update 2 2".
5. The message "LE PHY updated: TX PHY LE 2M, RX PHY LE 2M" would be printed if the phy is updated. note, if peer do not support phy update, then this message will not be printed.
GATT central role side,
1. Initialize the Host, press "bt.init",
2. start scan, press "bt.scan on", Bluetooth device around your current bluetooth will be list, for example,
[DEVICE]: 72:78:C1:B5:0F:DA (random), AD evt type 4, RSSI -32 BLE Peripheral C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: C4:0D:02:55:5E:AD (random), AD evt type 0, RSSI -83 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 66:8F:26:27:1F:52 (random), AD evt type 0, RSSI -82 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
3. stop scan, press "bt.scan off",
4. connect target device, press "bt.connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>", such as bt.connect 72:78:C1:B5:0F:DA random
5. Send phy update command, press "bt.phy-update <tx_phy> [rx_phy] [s2] [s8]", tx_phy/rx_phy could be 1(1M) or 2(2M) or 4(Coded).
such as "bt.phy-update 2 2".
6. The message "LE PHY updated: TX PHY LE 2M, RX PHY LE 2M" would be printed if the phy is updated. note, if peer do not support phy update, then this message will not be printed.
BLE Data Packet Length Extension update:
GATT peripheral role side,
1. Initialize the Host, press "bt.init".
2. Advertising, press "bt.advertise on".
3. After the connection is established.
4. Check current LE RX/TX maximum data length and time, press "bt.info", as blow, default RX/TX maximum data length is 27 and default RX/TX maxumum time is 328.
Type: LE, Role: slave, Id: 0
59:8F:3C:20:93:86 (random)
Remote address: 59:8F:3C:20:93:86 (random) (resolvable)
Local address: 80:D2:1D:E8:30:EC (public) (identity)
Remote on-air address: 59:8F:3C:20:93:86 (random) (resolvable)
Local on-air address: 7C:59:48:2E:A4:51 (random) (resolvable)
Interval: 0x0024 (45 ms)
Latency: 0x0000 (0 ms)
Supervision timeout: 0x0190 (4000 ms)
LE PHY: TX PHY LE 1M, RX PHY LE 1M
LE data len: TX (len: 27 time: 328) RX (len: 27 time: 328)
5. When LE data len is updated by the peer device, below information will be printed.
LE data len updated: TX (len: 27 time: 328) RX (len: 50 time: 512)
6. Update maximum tx data length, press "bt.data-len-update <tx_max_len> [tx_max_time]", such as bt.data-len-update 65, below information will be printed.
Calculated tx time: 632
59:8F:3C:20:93:86 (random)
data len update initiated.
LE data len updated: TX (len: 65 time: 632) RX (len: 50 time: 512)
GATT central role side,
1. Initialize the Host, press "bt.init".
2. Start scan, press "bt.scan on", Bluetooth device around your current bluetooth will be list, for example,
[DEVICE]: 7C:59:48:2E:A4:51 (random), AD evt type 4, RSSI -44 BLE Peripheral C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
3. Stop scan, press "bt.scan off",
4. Connect target device, press "bt.connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>", such as bt.connect 7C:59:48:2E:A4:51 random
5. Check current LE RX/TX maximum data length and time, press "bt.info", as blow, default RX/TX maximum data length is 27 and default RX/TX maxumum time is 328.
Type: LE, Role: master, Id: 0
7C:59:48:2E:A4:51 (random)
Remote address: 7C:59:48:2E:A4:51 (random) (resolvable)
Local address: C0:95:DA:00:BC:82 (public) (identity)
Remote on-air address: 7C:59:48:2E:A4:51 (random) (resolvable)
Local on-air address: 59:8F:3C:20:93:86 (random) (resolvable)
Interval: 0x0024 (45 ms)
Latency: 0x0000 (0 ms)
Supervision timeout: 0x0190 (4000 ms)
LE PHY: TX PHY LE 1M, RX PHY LE 1M
LE data len: TX (len: 27 time: 328) RX (len: 27 time: 328)
6. Update maximum tx data length, press "bt.data-len-update <tx_max_len> [tx_max_time]", such as bt.data-len-update 50, below information will be printed.
Calculated tx time: 512
7C:59:48:2E:A4:51 (random)
data len update initiated.
LE data len updated: TX (len: 50 time: 512) RX (len: 27 time: 328)
7. When LE data len is updated by the peer device, below information will be printed.
LE data len updated: TX (len: 50 time: 512) RX (len: 65 time: 632)
BLE GATT data signing:
GATT peripheral role side,
1. Initialize the Host, press "bt.init",
2. Advertising, press "bt.advertise on",
3. After the connection is established, perform the pairing sequence,
it could be started from peripheral side by pressing "bt.security <level>", such as "bt.security 2",
4. After the authentication is successfully, disconnect the connection,
it could be started from peripheral side by pressing "bt.disconnect",
5. Waiting for new connection. After the connection is established (LL enceyption should be disabled),
add new serivce "gatt.register".
GATT central role side,
1. Initialize the Host, press "bt.init",
2. Scaning advertising packets, press "bt.scan on",
3. A few seconds later, stop the scanning, press "bt.scan off"
4. Select the target board and create a new connection. If the taregt is not listed, repeat steps 2 and 3.
Then press "bt.connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>"
5. After the connection is established, perform the pairing sequence,
it could be started from central side by pressing "bt.security <level>", such as "bt.security 2",
6. After the authentication is successfully, disconnect the connection,
it could be started from central side by pressing "bt.disconnect",
7. Repeat the steps 2 and 3. After the connection is established (LL enceyption should be disabled),
perform the GATT data signing sequence, press "gatt.signed-write <handle> <data> [length] [repeat]",
such as "gatt.signed-write 22 AA 1"
BLE GATT Service Changed Indication:
GATT peripheral role side,
1. Initialize the Host, press "bt.init",
2. Advertising, press "bt.advertise on",
3. After the connection is established. and waiting for the service changed indication is subsribed,
4. Add new serivce, press "gatt.register",
5. Remove the added serivce, press "gatt.unregister".
GATT central role side,
1. Initialize the Host, press "bt.init",
2. Scaning advertising packets, press "bt.scan on",
3. A few seconds later, stop the scanning, press "bt.scan off"
4. Select the target board and create a new connection. If the taregt is not listed, repeat steps 2 and 3.
Then press "bt.connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>"
5. After the connection is established, subscribe the GATT service changed indicator. press "bt.subscribe <CCC handle> <value handle> [ind]",
such as "gatt.subscribe f e ind".
MIMXRT1060-EVKC + IW610
Overview
This document provides step-by-step procedures to build and test coex examples, and also instructions for running the included sample applications.
Hardware requirements
Micro USB cable
evkcmimxrt1060 board
Personal Computer
One of the following modules:
Embedded Artists 2LL M.2 Module (EAR00500) - direct M2 connection
Embedded Artists 2EL M.2 Module(Rev-A1) - direct M2 connection
Board settings
Before building the example application define Wi-Fi module in the _boards/evkcmimxrt1060/coex_examples/coex_wifi_edgefast/prj.conf.
If you want to use Embedded Artists 2LL M.2 Module(EAR00500), please set CONFIG_MCUX_COMPONENT_component.wifi_bt_module.board_murata_2ll_m2 to y.
CONFIG_MCUX_COMPONENT_component.wifi_bt_module.IW61X=yCONFIG_MCUX_COMPONENT_component.wifi_bt_module.board_murata_2ll_m2=y
If you want to use Embedded Artists 2EL M.2 Module(Rev-A1), please set CONFIG_MCUX_COMPONENT_component.wifi_bt_module.board_murata_2el_m2 to y.
CONFIG_MCUX_COMPONENT_component.wifi_bt_module.IW61X=yCONFIG_MCUX_COMPONENT_component.wifi_bt_module.board_murata_2el_m2=y
Jumper settings for RT1060-EVKC (enables external 5V supply):
remove J40 5-6 connect J40 1-2 connect J45 with external power(controlled by SW6)
Murata Solution Board settings
Embedded Artists 2LL module datasheet: https://www.embeddedartists.com/wp-content/uploads/2024/12/2LL_M2_Datasheet.pdf Embedded Artists 2EL module datasheet: https://www.embeddedartists.com/doc/ds/2EL_M2_Datasheet.pdf
The hardware should be reworked according to the hardware rework guide for evkcmimxrt1060 and Murata 1XK/1ZM/2EL/2LL M.2 Adapter in document Hardware Rework Guide for EdgeFast BT PAL.
NOTE:
To ensure that the LITTLEFS flash region has been cleaned, all flash sectors need to be erased before downloading example code.
After downloaded binary into qspiflash and boot from qspiflash directly, please reset the board by pressing SW7 or power off and on the board to run the application.
Nighthwak and Firecrest BT UART Rework (LPUART3)
Mount R93, R96
Remove R193
Connect J109, J76 2-3
WiFi and BLE use LPUART.
Build and flash
Prerequisites:
CMake (version >=3.24)
Ninja (version >=1.12)
ARM GCC Toolchain (only support ARM GCC)
Python3 (version >=3.6)
NOTE: Make sure that the paths of all these tools are set into the path system variable.
2. Building
Modify examples/coex_examples/coex_wifi_edgefast/app_config.cmake to generate different coexistence images.
coexistence images |
CONFIG_WIFI |
CONFIG_BLE |
Simulation Case |
|---|---|---|---|
WiFi + BLE |
1 |
1 |
Matter over WiFi |
Macors releated to Wi-Fi supplicant,
Wi-Fi supplicant |
CONFIG_WPA_SUPPLICANT |
|---|---|
embedded supplicant |
0 |
wpa supplicant |
1(default) |
NOTE: 2EL_M2 only supports embedded supplicant and WPA supplicant.
Building coex examples with CMake
flexspi_nor_debug:
$ cd <sdk root>
$ west build -b evkcmimxrt1060 examples/coex_examples/coex_wifi_edgefast --toolchain armgcc --config flexspi_nor_debug -d coex_wifi_edgefast
flexspi_nor_release:
$ cd <sdk root>
$ west build -b evkcmimxrt1060 examples/coex_examples/coex_wifi_edgefast --toolchain armgcc --config flexspi_nor_release -d coex_wifi_edgefast
NOTE:
-d coex_wifi_edgefast-> Specify the generated project path. Can name it as needed.Find coex_wifi_edgefast.elf/coex_wifi_edgefast.bin in coex_wifi_edgefast folder.
Only support armgcc to build coex application.
CSI and NET_MONITOR are disabled by default due to RAM limitation. If to test CSI and NET_MONITOR, enable them and disable enterprise in wifi_config.h. Modify middleware/wireless/coex/src/configs/
/wifi/wifi_config.h: Enable CSI and NET_MONITOR: #define CONFIG_CSI 1 #define CONFIG_NET_MONITOR 1 Disable enterprise: #define CONFIG_WPA_SUPP_CRYPTO_ENTERPRISE 0 #define CONFIG_WPA_SUPP_CRYPTO_AP_ENTERPRISE 0
4. Flash Binaries
Flash the image with the following command,
##### CMD to write CPU3 coex app image to flash in J-link window:
J-Link> loadbin C:\xxx\coex_wifi_edgefast.bin, 0x60000000
Run
Prepare the Demo
Connect a micro USB cable between the PC host and the MCU-Link USB port (J7) on the board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Launch the debugger in your IDE to begin running the example.
Running the example
The log below shows the output of the coex examples (based on edgefast-shell) in the terminal window:
##### SHELL build: Coex APP
========================================
##### Initialize Nighthwak-2LL (IW610) M2 Module
Feb 24 2025
##### Copyright 2020 NXP
##### WiFi shell initialization
BLE shell initialization
@bt> ========================================
@Coex>
WiFi Test
NOTE: All wifi commands require adding
wifi.prefix.
Get the Wi-Fi driver and firmware version:
@Coex> wifi wlan-version
WLAN Driver Version : v1.3.r48.p32
@Coex> WLAN Firmware Version : iw610w-V0, SDIO, FP99, 18.99.5.p51, PVE_FIX 1
Command wlan-version
Get MAC Address:
@Coex> wifi wlan-mac
MAC address
@Coex> STA MAC Address: 00:50:43:02:98:23
uAP MAC Address: 00:50:43:02:99:23
Command wlan-mac
Scan the network:
@Coex> wifi wlan-scan
Scan scheduled...
@Coex> Command wlan-scan
2 networks found:
1C:6A:7A:87:FF:BF "NXP" Infra
mode: 802.11AC
channel: 161
rssi: -74 dBm
security: WPA2 Enterprise
WMM: YES
802.11K: YES
802.11V: YES
802.11W: NA
WPS: NO
1C:6A:7A:87:FF:BE "NXPOPEN" Infra
mode: 802.11AC
channel: 161
rssi: -75 dBm
security: WPA2
WMM: YES
802.11K: YES
802.11V: YES
802.11W: NA
WPS: NO
BLE Test
NOTE: Please use the command “help” to view the specific commands supported by the example.
BLE scan devices (the BLE host must initialized before):
@Coex> bt init
@Coex> Bluetooth initialized
Settings Loaded
@Coex> bt scan on
Bluetooth active scan enabled
@Coex> [DEVICE]: 44:6D:F5:85:DC:5F (random), AD evt type 0, RSSI -64 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 44:6D:F5:85:DC:5F (random), AD evt type 4, RSSI -63 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 6D:B3:D3:8E:ED:A2 (random), AD evt type 0, RSSI -77 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 6D:B3:D3:8E:ED:A2 (random), AD evt type 4, RSSI -76 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 3F:FB:95:F7:F9:14 (random), AD evt type 3, RSSI -75 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 49:A3:4E:86:63:0C (random), AD evt type 0, RSSI -76 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 49:A3:4E:86:63:0C (random), AD evt type 4, RSSI -75 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 5C:28:50:F9:DD:57 (random), AD evt type 0, RSSI -82 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 4A:7D:B4:12:7B:7A (random), AD evt type 0, RSSI -82 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 4A:7D:B4:12:7B:7A (random), AD evt type 4, RSSI -82 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 5A:54:C8:99:13:4A (random), AD evt type 0, RSSI -76 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 3B:95:00:4D:F3:EB (random), AD evt type 3, RSSI -82 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 47:9D:D0:CB:5F:0D (random), AD evt type 0, RSSI -86 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
@Coex> bt scan off
Scan successfully stopped
@Coex>
BLE advertise (the BLE host must initialized before):
@Coex> bt init
@Coex> Bluetooth initialized
@Coex> bt advertise on
Advertising started
@Coex> bt advertise off
Advertising stopped
BLE connect (the BLE host must initialized before):
@Coex> bt init
@Coex> Bluetooth initialized
@Coex> bt connect C0:95:63:23:55:87 random
Connection pending
Connected: 7D:FD:FD:4D:FD:90 (random)
BLE pairing and bonding:
GATT peripheral role side,
1. Initialize the Host, press "bt init",
2. Advertising, press "bt advertise on",
3. After the connection is established, perform the pairing sequence,
it could be started from peripheral side by pressing "bt security <level>", such as "bt security 2".
4. If the bondable is unsupported by peripheral role, press "bt bondable off". Then start step 3.
GATT central role side,
1. Initialize the Host, press "bt init",
2. Scaning advertising packets, press "bt scan on",
3. A few seconds later, stop the scanning, press "bt scan off"
4. Select the target board and create a new connection. If the taregt is not listed, repeat steps 2 and 3.
Then press "bt connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>"
5. After the connection is established, perform the pairing sequence,
it could be started from central side by pressing "bt security <level>", such as "bt security 2".
6. If the bondable is unsupported by central role, press "bt bondable off". Then start step 5.
BLE 1M/2M/Coded PHY update:
GATT peripheral role side,
1. Initialize the Host, press "bt init",
2. Advertising, press "bt advertise on",
3. After the connection is established.
4. Send phy update command, press "bt phy-update <tx_phy> [rx_phy] [s2] [s8]", tx_phy/rx_phy could be 1(1M) or 2(2M) or 4(Coded).
such as "bt phy-update 2 2".
5. The message "LE PHY updated: TX PHY LE 2M, RX PHY LE 2M" would be printed if the phy is updated. note, if peer do not support phy update, then this message will not be printed.
GATT central role side,
1. Initialize the Host, press "bt init",
2. start scan, press "bt scan on", Bluetooth device around your current bluetooth will be list, for example,
[DEVICE]: 72:78:C1:B5:0F:DA (random), AD evt type 4, RSSI -32 BLE Peripheral C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: C4:0D:02:55:5E:AD (random), AD evt type 0, RSSI -83 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
[DEVICE]: 66:8F:26:27:1F:52 (random), AD evt type 0, RSSI -82 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
3. stop scan, press "bt scan off",
4. connect target device, press "bt connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>", such as bt connect 72:78:C1:B5:0F:DA random
5. Send phy update command, press "bt phy-update <tx_phy> [rx_phy] [s2] [s8]", tx_phy/rx_phy could be 1(1M) or 2(2M) or 4(Coded).
such as "bt phy-update 2 2".
6. The message "LE PHY updated: TX PHY LE 2M, RX PHY LE 2M" would be printed if the phy is updated. note, if peer do not support phy update, then this message will not be printed.
BLE Data Packet Length Extension update:
GATT peripheral role side,
1. Initialize the Host, press "bt init".
2. Advertising, press "bt advertise on".
3. After the connection is established.
4. Check current LE RX/TX maximum data length and time, press "bt info", as blow, default RX/TX maximum data length is 27 and default RX/TX maxumum time is 328.
Type: LE, Role: slave, Id: 0
59:8F:3C:20:93:86 (random)
Remote address: 59:8F:3C:20:93:86 (random) (resolvable)
Local address: 80:D2:1D:E8:30:EC (public) (identity)
Remote on-air address: 59:8F:3C:20:93:86 (random) (resolvable)
Local on-air address: 7C:59:48:2E:A4:51 (random) (resolvable)
Interval: 0x0024 (45 ms)
Latency: 0x0000 (0 ms)
Supervision timeout: 0x0190 (4000 ms)
LE PHY: TX PHY LE 1M, RX PHY LE 1M
LE data len: TX (len: 27 time: 328) RX (len: 27 time: 328)
5. When LE data len is updated by the peer device, below information will be printed.
LE data len updated: TX (len: 27 time: 328) RX (len: 50 time: 512)
6. Update maximum tx data length, press "bt data-len-update <tx_max_len> [tx_max_time]", such as bt data-len-update 65, below information will be printed.
Calculated tx time: 632
59:8F:3C:20:93:86 (random)
data len update initiated.
LE data len updated: TX (len: 65 time: 632) RX (len: 50 time: 512)
GATT central role side,
1. Initialize the Host, press "bt init".
2. Start scan, press "bt scan on", Bluetooth device around your current bluetooth will be list, for example,
[DEVICE]: 7C:59:48:2E:A4:51 (random), AD evt type 4, RSSI -44 BLE Peripheral C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
3. Stop scan, press "bt scan off",
4. Connect target device, press "bt connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>", such as bt connect 7C:59:48:2E:A4:51 random
5. Check current LE RX/TX maximum data length and time, press "bt info", as blow, default RX/TX maximum data length is 27 and default RX/TX maxumum time is 328.
Type: LE, Role: master, Id: 0
7C:59:48:2E:A4:51 (random)
Remote address: 7C:59:48:2E:A4:51 (random) (resolvable)
Local address: C0:95:DA:00:BC:82 (public) (identity)
Remote on-air address: 7C:59:48:2E:A4:51 (random) (resolvable)
Local on-air address: 59:8F:3C:20:93:86 (random) (resolvable)
Interval: 0x0024 (45 ms)
Latency: 0x0000 (0 ms)
Supervision timeout: 0x0190 (4000 ms)
LE PHY: TX PHY LE 1M, RX PHY LE 1M
LE data len: TX (len: 27 time: 328) RX (len: 27 time: 328)
6. Update maximum tx data length, press "bt data-len-update <tx_max_len> [tx_max_time]", such as bt data-len-update 50, below information will be printed.
Calculated tx time: 512
7C:59:48:2E:A4:51 (random)
data len update initiated.
LE data len updated: TX (len: 50 time: 512) RX (len: 27 time: 328)
7. When LE data len is updated by the peer device, below information will be printed.
LE data len updated: TX (len: 50 time: 512) RX (len: 65 time: 632)
BLE GATT data signing:
GATT peripheral role side,
1. Initialize the Host, press "bt init",
2. Advertising, press "bt advertise on",
3. After the connection is established, perform the pairing sequence,
it could be started from peripheral side by pressing "bt security <level>", such as "bt security 2",
4. After the authentication is successfully, disconnect the connection,
it could be started from peripheral side by pressing "bt disconnect",
5. Waiting for new connection. After the connection is established (LL enceyption should be disabled),
add new serivce "gatt register".
GATT central role side,
1. Initialize the Host, press "bt init",
2. Scaning advertising packets, press "bt scan on",
3. A few seconds later, stop the scanning, press "bt scan off"
4. Select the target board and create a new connection. If the taregt is not listed, repeat steps 2 and 3.
Then press "bt connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>"
5. After the connection is established, perform the pairing sequence,
it could be started from central side by pressing "bt security <level>", such as "bt security 2",
6. After the authentication is successfully, disconnect the connection,
it could be started from central side by pressing "bt disconnect",
7. Repeat the steps 2 and 3. After the connection is established (LL enceyption should be disabled),
perform the GATT data signing sequence, press "gatt signed-write <handle> <data> [length] [repeat]",
such as "gatt signed-write 22 AA 1"
BLE GATT Service Changed Indication:
GATT peripheral role side,
1. Initialize the Host, press "bt init",
2. Advertising, press "bt advertise on",
3. After the connection is established. and waiting for the service changed indication is subsribed,
4. Add new serivce, press "gatt register",
5. Remove the added serivce, press "gatt unregister".
GATT central role side,
1. Initialize the Host, press "bt init",
2. Scaning advertising packets, press "bt scan on",
3. A few seconds later, stop the scanning, press "bt scan off"
4. Select the target board and create a new connection. If the taregt is not listed, repeat steps 2 and 3.
Then press "bt connect <address: XX:XX:XX:XX:XX:XX> <type: (public|random)>"
5. After the connection is established, subscribe the GATT service changed indicator. press "bt subscribe <CCC handle> <value handle> [ind]",
such as "gatt subscribe f e ind".
MIMXRT1170-EVKB
Overview
This document provides step-by-step procedures to build and test coex examples, and also instructions for running the included sample applications.
Hardware requirements
Micro USB cable evkbmimxrt1170 board Personal Computer Embedded Artists 2EL M.2 Module(Rev-A1) - direct M2 connection
Board settings
Before building the example application define Wi-Fi module in the _boards/evkbmimxrt1170/coex_examples/coex_wifi_edgefast/cm7/prj.conf.
If you want to use Embedded Artists 2EL M.2 Module(Rev-A1), please set CONFIG_MCUX_COMPONENT_component.wifi_bt_module.board_murata_2el_m2 to y.
CONFIG_MCUX_COMPONENT_component.wifi_bt_module.IW61X=yCONFIG_MCUX_COMPONENT_component.wifi_bt_module.board_murata_2el_m2=y
Jumper settings for RT1170-EVKB (enables external 5V supply):
remove J38 5-6 connect J38 1-2 connect J43 with external power(controlled by SW5)
Murata Solution Board settings
Embedded Artists 2EL module datasheet: https://www.embeddedartists.com/doc/ds/2EL_M2_Datasheet.pdf
The hardware should be reworked according to the Hardware Rework Guide for MIMXRT1170-EVKB and Murata 1XK M.2 Adapter in document Hardware Rework Guide for EdgeFast BT PAL.
NOTE:
To ensure that the LITTLEFS flash region has been cleaned, all flash sectors need to be erased before downloading example code.
After downloaded binary into qspiflash and boot from qspiflash directly, please reset the board by pressing SW7 or power off and on the board to run the application.
Build and flash
Prerequisites:
CMake (version >=3.24)
Ninja (version >=1.12)
ARM GCC Toolchain (only support ARM GCC)
Python3 (version >=3.6)
NOTE: Make sure that the paths of all these tools are set into the path system variable.
2. Building
Modify examples/coex_examples/coex_wifi_edgefast/app_config.cmake to generate different coexistence images.
Macors releated to Wi-Fi supplicant,
Wi-Fi supplicant |
CONFIG_WPA_SUPPLICANT |
|---|---|
embedded supplicant |
0 |
wpa supplicant |
1(default) |
Building coex examples with CMake
flexspi_nor_debug:
$ cd <sdk root>
$ west build -b evkbmimxrt1170 examples/coex_examples/coex_wifi_edgefast --toolchain armgcc --config flexspi_nor_debug -d build/coex_wifi_edgefast -Dcore_id=cm7
flexspi_nor_release:
$ cd <sdk root>
$ west build -b evkbmimxrt1170 examples/coex_examples/coex_wifi_edgefast --toolchain armgcc --config flexspi_nor_release -d build/coex_wifi_edgefast -Dcore_id=cm7
NOTE:
-d build/coex_wifi_edgefast-> Specify the generated project path. Can name it as needed.Find coex_wifi_edgefast.elf/coex_wifi_edgefast.bin in build/coex_wifi_edgefast folder.
Only support armgcc to build coex application.
4. Flash Binaries
Flash the image with the following command,
##### CMD to write CPU3 coex app image to flash in J-link window:
J-Link> loadbin C:\xxx\coex_wifi_edgefast.bin, 0x30000400
Run
Prepare the Demo
Connect a micro USB cable between the PC host and the MCU-Link USB port (J7) on the board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Launch the debugger in your IDE to begin running the example.
Running the example
The log below shows the output of the coex examples (based on edgefast-shell) in the terminal window:
##### SHELL build: Coex APP
========================================
##### Initialize Firecrest-2EL (IW612) M2 Module
April 1 2025
##### Copyright 2020 NXP
##### WiFi shell initialization
BLE shell initialization
@bt> ========================================
@Coex>
WiFi Test
NOTE: All wifi commands require adding
wifiprefix.
Get the Wi-Fi driver and firmware version:
@Coex> wifi wlan-version
WLAN Driver Version : v1.3.r48.p36
@Coex> WLAN Firmware Version : w9177o-V1, SDIO, FP99, 18.99.3.p23.11, PVE_FIX 1
Command wlan-version
Get MAC Address:
@Coex> wifi wlan-mac
MAC address
@Coex> STA MAC Address: 50:26:EF:A2:E5:A6
uAP MAC Address: 52:26:EF:A2:E6:A6
Command wlan-mac
Scan the network:
@Coex> wifi wlan-scan
Scan scheduled...
@Coex> Command wlan-scan
2 networks found:
7C:21:0E:17:B3:8F "NXP" Infra
mode: 802.11AC
channel: 52
rssi: -66 dBm
security: WPA2 Enterprise
WMM: YES
802.11W: NA
WPS: NO
7C:21:0E:17:B3:89 "NXPOPEN" Infra
mode: 802.11AC
channel: 52
rssi: -66 dBm
security: WPA2
WMM: YES
802.11K: YES
802.11V: YES
802.11W: NA
WPS: NO
Edgefast bluetooth shell Test
The host must initialized before any bt commands:
NOTE: Please use the command “help” to view the specific commands supported by the example.
@Coex> bt init
@Coex> Bluetooth initialized
Settings Loaded
@Coex> bt scan on
Bluetooth active scan enabled
@Coex> [DEVICE]: 57:00:66:0A:D8:AC (random), AD evt type 3, RSSI -92 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 7B:54:6F:C2:E3:F9 (random), AD evt type 0, RSSI -78 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 7B:54:6F:C2:E3:F9 (random), AD evt type 4, RSSI -78 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 5C:81:60:9C:36:45 (random), AD evt type 3, RSSI -32 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 59:EE:1D:3A:2D:9C (random), AD evt type 3, RSSI -89 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 7B:54:6F:C2:E3:F9 (random), AD evt type 0, RSSI -85 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 7B:54:6F:C2:E3:F9 (random), AD evt type 4, RSSI -86 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 5C:81:60:9C:36:45 (random), AD evt type 3, RSSI -27 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 0A:8B:EF:5C:AC:BC (random), AD evt type 3, RSSI -81 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: C0:95:DA:00:D1:3D (public), AD evt type 0, RSSI -68 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: C0:95:DA:00:D1:3D (public), AD evt type 4, RSSI -68 edgefast_hfp C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 25:E7:96:B7:7F:0E (random), AD evt type 3, RSSI -85 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 48:23:35:4B:F5:84 (public), AD evt type 0, RSSI -92 TVSBT20001915 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 48:23:35:4B:F5:84 (public), AD evt type 4, RSSI -92 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 7B:54:6F:C2:E3:F9 (random), AD evt type 0, RSSI -79 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 7B:54:6F:C2:E3:F9 (random), AD evt type 4, RSSI -79 C:0 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 74:4D:42:DA:B1:FB (random), AD evt type 3, RSSI -81 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
[DEVICE]: 59:EE:1D:3A:2D:9C (random), AD evt type 3, RSSI -90 C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 us), SID: 0xff
@Coex> bt scan off
Scan successfully stopped
@Coex>
FRDM-IMXRT1152 + u-blox MAYA-W276 (IW612)
Overview
This document provides step-by-step procedures to build and test the coex example (Wi-Fi + BLE, edgefast_open based) on the FRDM-IMXRT1152 board, and instructions for running the included sample application.
Hardware requirements
Micro USB cable
FRDM-IMXRT1152 board (on-board u-blox MAYA-W276 / IW612 Wi-Fi + BT module)
Personal Computer
Board settings
The Wi-Fi/BT module is on-board (u-blox MAYA-W276, IW612). It is selected by default in
_boards/frdmimxrt1152/coex_examples/coex_wifi_edgefast/prj.conf:
CONFIG_MCUX_COMPONENT_component.wifi_bt_module.IW61X=yCONFIG_MCUX_COMPONENT_component.wifi_bt_module.board_ubx_maya_w276=y
BT HCI runs on LPUART8 (with HW flow control). Wi-Fi runs over USDHC1 (SDIO). The BT and Wi-Fi reset lines are driven through the on-board PCAL6524 I2C expander.
Hardware Rework Guide for FRDM-IMXRT1152
The on-board Bluetooth/Wi-Fi module requires the following board rework before running the
coex application (same rework as the edgefast_open shell example on this board):
Bluetooth UART:
Short: SJ3, SJ6, SJ7, SJ10
Remove: R470, R471, SJ38, SJ43, SJ46
Bluetooth Reset:
Short: SJ12, SJ23, SJ24
The BT reset line (BT_RST#, PCAL6524 P0_5) and Wi-Fi reset line (WL_RST#, P0_4) are asserted/de-asserted in software via the on-board PCAL6524 I2C expander (
BOARD_WIFI_BT_Enable()in_boards/frdmimxrt1152/wifi_bt_config.c). The jumper rework above physically routes those reset/UART nets to the module.
NOTE:
To ensure the LITTLEFS flash region is clean, erase all flash sectors before downloading.
After flashing to QSPI flash and booting from it, reset the board by pressing SW1 (or power cycle) to run the application.
Independent NB (BT) firmware download over UART is used, followed by Wi-Fi firmware download over SDIO (coex middleware
coex_controller_init()).
Build and flash
Prerequisites:
CMake (version >=3.24)
Ninja (version >=1.12)
ARM GCC Toolchain (only ARM GCC is supported)
Python3 (version >=3.6)
Building
Modify examples/coex_examples/coex_wifi_edgefast/app_config.cmake to generate different
coexistence images.
coexistence images |
CONFIG_WIFI |
CONFIG_BLE |
Simulation Case |
|---|---|---|---|
WiFi + BLE |
1 |
1 |
Matter over WiFi |
Macros related to Wi-Fi supplicant:
Wi-Fi supplicant |
CONFIG_WPA_SUPPLICANT |
|---|---|
embedded supplicant |
0 |
wpa supplicant |
1 (default) |
flexspi_nor_debug:
$ cd <sdk root>
$ west build -b frdmimxrt1152 examples/coex_examples/coex_wifi_edgefast --toolchain armgcc --config flexspi_nor_debug -d coex_wifi_edgefast
flexspi_nor_release:
$ cd <sdk root>
$ west build -b frdmimxrt1152 examples/coex_examples/coex_wifi_edgefast --toolchain armgcc --config flexspi_nor_release -d coex_wifi_edgefast
NOTE:
-d coex_wifi_edgefast-> Specify the generated project path. Can name it as needed.Find coex_wifi_edgefast.elf / coex_wifi_edgefast.bin in the coex_wifi_edgefast folder.
Only ARM GCC is supported to build the coex application.
CSI and NET_MONITOR are disabled by default due to RAM limitation. To test CSI and NET_MONITOR, enable them and disable enterprise in
middleware/wireless/coex/src/configs/mimxrt1152/wifi/wifi_config.h:#define CONFIG_CSI 1 #define CONFIG_NET_MONITOR 1 #define CONFIG_WPA_SUPP_CRYPTO_ENTERPRISE 0 #define CONFIG_WPA_SUPP_CRYPTO_AP_ENTERPRISE 0
Flash Binaries
J-Link> loadbin C:\xxx\coex_wifi_edgefast.bin, 0x30000000
Run
Prepare the Demo
Connect a micro USB cable between the PC host and the MCU-Link USB port on the board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Reset the board (press SW1) to begin running the example.
Running the example
After boot, the @Coex> shell prompt appears. Both Wi-Fi (with wifi prefix) and BLE
(bt ) commands are available, e.g.:
@Coex> wifi wlan-version
@Coex> wifi wlan-scan
@Coex> bt init
@Coex> bt scan on
Refer to the evkcmimxrt1060 / evkbmimxrt1170 coex_wifi_edgefast board readme for the full list of Wi-Fi and BLE command usage examples.