Skip to content

The BLE Sniffer Demo runs on the FRDM-MCXN947 development board and showcases the implementation of a Bluetooth Low Energy (BLE) sniffer using the MCXW236B Click Board, which operates as an HCI Black Box. The graphical user interface, built with LVGL, was designed using GUI Guider.

License

Notifications You must be signed in to change notification settings

nxp-appcodehub/dm-mcxn-ble-sniffer-hci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NXP Application Code Hub

BLE Sniffer for Sensors Connectivity using MCXW236B Click and FRDM-MCXN947

System Architecture Overview

The BLE Sniffer application consists of two tightly integrated software components:

  1. Firmware on the FRDM-MCXN947 Development Board
    This firmware serves as the host controller and manages bidirectional communication with the BLE radio module (MCXW236B) via a dedicated serial manager. It transmits a precise sequence of Host Controller Interface (HCI) commands over UART to configure the MCXW236B Click Board as a Bluetooth Low Energy (BLE) sniffer operating in GAP Central node. Once configured, the firmware continuously receives raw HCI event blocks from the Click Board, enabling the host to capture and process BLE traffic for further decoding and analysis.

  2. HCI Firmware on the MCXW236B Click Board
    The Click Board runs a dedicated HCI image that enables it to function as a BLE packet capture device. It behaves as an HCI black box, meaning it does not interpret or process BLE traffic internally but instead forwards raw HCI event data to the host for decoding.

Data Flow and Processing

  • The FRDM-MCXN947 board receives raw HCI event packets from the MCXW236B Click Board.
  • These packets are aggregated and parsed to extract relevant sensor data using a custom decoding layer.
  • Non-sensor or malformed data is filtered out to optimize processing and visualization.
  • The decoded data is structured according to the SBDT (Sensor Beacon Data Types) specification, which maximizes the utility of the 31-byte BLE advertising payload by encoding multiple sensor readings efficiently.

Software Deployment

  • The source code provided targets the FRDM-MCXN947 board, including the serial manager, HCI command sequences, and data parsing logic.
  • The HCI firmware image for the MCXW236B Click Board must be generated separately using the MCXW236B SDK on Visual Studio Code (latest version). Refer to the TBD section for detailed instructions on building and flashing the HCI image.

Graphical User Interface

  • The main GUI of the BLE Sniffer application was developed using GUI Guider, a visual design tool for embedded UIs.
  • The GUI displays real-time sensor data captured via BLE, including voltage and temperature readings, and provides controls for initiating single or continuous conversions.

Boards: FRDM-MCXN947, FRDM-MCXW23 or MCXW236B-CLICK

Accessories: NXP_LCD_PAR_S035

Categories: Sensor, Graphics, Wireless Connectivity, RTOS, Tools

Peripherals: Bluetooth, CLOCKS, DISPLAY, GPIO, UART, SENSOR

Toolchains: MCUXpresso IDE, VS Code

Table of Contents

  1. Software
  2. Hardware
  3. Setup
  4. Results
  5. FAQs
  6. Support
  7. Release Notes

1. Software

The following steps will guide you through setting up the software environment.

  • Download MCUXPresso and install it following the installer instructions.
  • Download the FRDM-MCXN947 SDK and install it in MCUXPresso by draging and droping SDK zip into "Installed SDK" view into MCUXpresso IDE.
  • Download Visual Studio Code (target your Operating System) and install it following the installer instruction.
  • Download and install Git v2.39.0 or later (for cloning and running west commands).

1.1 MCXW23 Software Environment Overview

The Software environment for the MCXW23 MCU is VS Code. Please consider also the Getting started with MCUXpresso for Visual Studio Code as a starting point for VS Code.

The build system uses cmake and gcc for ARM. For more details, please refer to the mcuxsdk repository.

For debugging, software download and development purpose, VS Code with MCUXpresso plugin and Segger Jlink version 8.44a or newer needs to be installed.

In addition to the presented software, the following SDK example applications are required:

- ble_controller/hci_bb/hci_bb_mcxw23 (SDK example for MCXW236B Click board)

  • Additional resources: GitHub SDK for Bluetooth Wireless platforms - details . Below a screenshot for SDK project selection:

sdk_example

2. Hardware

For the Bluetooth LE Sniffer based on the MCXW23 HCI Black Box, the following hardware is required:

Below is an overview of the setup using FRDM_MCXN947 and MCXW236 Click Board.
FRDM_MCXN947_MCXW236_Click

3. Setup

Provisioning the FRDM-MCXN947 Board

The following steps describe how to setup the system and how to flash both boards: the FRDM-MCXN947 board using MCUXpresso and the MCXW236B Click board with Visual Studio Code.

3.1 Step 1: Connect Display to FRDM-MCXN947

  • Check that the switch SW1 In the LCD is set to 010 (16bits 8080) and plug-in the LCD in the board (use the next image like reference) you should connect the LCD in the J8 header with two pins free in the top of the header.

Alt text

3.2 Step 2: Connect the Inclinometer click board atop FRDM-MCXN947

  • Plug-in the MCXW236B Click board atop the native mikroe slot of the FRDM board.
  • Then plug-in the USB cable between the host PC and the FRDM-MCXN947.

At this point, it is assumed that all required SW was already downloaded and installed (refer to Software section).

3.3 Step 3: Build demo project

  • Open MCUXpresso IDE and select a directory to create your workspace.
  • Go to "Quickstart Panel" and click on "Import from Application Code Hub".

    Alt text

  • Enter "ble_sniffer" in search bar. Select project card.
  • Click "GitHub link" within wizard to copy GITHUB information into IDE wizard.

    Alt text

  • Continue to follow the default steps of the Wizard. Click Next, Click Next for "main" branch.
  • Select the desired destination to store the imported project. Initial branch = main. Click Next.
  • Click next to select the discovered Eclipse projects.
  • Click Finish to complete the import into workspace.

    Alt text

  • Right click on project and select build to start building the project.

Provisioning the MCXN236B Click Board

This section describes the steps required to flash the Bluetooth LE HCI Black Box application using VS Code, user interactions, and testing methods for the BLE Sniffer use case application.

3.4 Step 4

  • Open VS Code and import the MCUSDK repository to a local folder. This action will take some time, wait for its completion before continue...
    Import repository

  • Import the hci_bb_mcxw23 example from the repository;
    Import project 1

  • Select Toolchain and press Import button:
    Import project 2

  • Source code is under "Project Files" folder:
    Source code

  • Open the file hci_uart.h and update the Baudrate to 230400 bd.
    #define HCI_UART_BAUDRATE (230400u)

3.5 Step 5 - Building the example

  • Select the project, right click and press Pristine Build.
  • Result of the build is in the Terminal Window:
    build_project

3.6 Step 6 - Flashing and debugging

  • VS Code flashing - Select Debug Probes, Select project and press Run -> Run Without Debugging (CTRL+F5):
    flashing_vscode

  • Alternative option is to use Segger/j-link (if the board is flashed with Jlink firmware), replace <project_path> with your project path:

loadbin C:\<project_path>\hci_bb_mcxw23.bin, 0
  • VS Code debug - Select Debug Probes, Select project and press Run -> Start Debugging (F5):
    start_debugging

Device Behavior After Flashing:

  • After flashing, the device enters idle mode, awaiting initialization commands from the FRDM-MCXN947 development board.
  • Once the FRDM-MCXN947 boots up, it transmits a configuration sequence to the HCI Black Box (MCXW236B Click Board) to enable BLE scanning mode.
  • Upon successfully capturing BLE advertising packets, the device forwards the raw HCI event data to the FRDM-MCXN947 for decoding and filtering

4. Results

At this step, we are considering that all the boards are correctly flashed.

Below are the steps to run the demo:

  • The LCD display presents structured data from nearby sensors broadcasting their parameters via BLE advertising packets. The graphical user interface (GUI) provides a toggle feature that allows users to switch between viewing decoded sensor values and raw data formats for enhanced analysis and debugging.
  • The BLUE LED will blink approx. for 200ms each time a sensor advertising package has been detected.

5. FAQs

To verify UART communication between the FRDM‑MCXN947 host application and the MCXW236B Click Board (HCI application), connect a logic analyzer to the UART RX and TX pins on the mikroE slot and observe the HCI traffic to confirm proper data exchange.

6. Support

Project Metadata

Board badge Board badge

Category badge Category badge Category badge Category badge Category badge

Peripheral badge Peripheral badge Peripheral badge Peripheral badge Peripheral badge Peripheral badge

Toolchain badge Toolchain badge

Questions regarding the content/correctness of this example can be entered as Issues within this GitHub repository.

Warning: For more general technical questions regarding NXP Microcontrollers and the difference in expected functionality, enter your questions on the NXP Community Forum

Follow us on Youtube Follow us on LinkedIn Follow us on Facebook Follow us on Twitter

7. Release Notes

Version Description / Update Date
1.0 Initial release on Application Code Hub December 17th 2025

About

The BLE Sniffer Demo runs on the FRDM-MCXN947 development board and showcases the implementation of a Bluetooth Low Energy (BLE) sniffer using the MCXW236B Click Board, which operates as an HCI Black Box. The graphical user interface, built with LVGL, was designed using GUI Guider.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages