### Setup Zephyr SDK on macOS Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/setup.md Navigate to the extracted Zephyr SDK directory and run the setup script. This is a one-time setup unless the SDK is moved. ```bash cd zephyr-sdk-0.16.1 ``` ```bash ./setup.sh ``` -------------------------------- ### Install GN Tool on Windows Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/setup.md Instructions for installing the GN build system on Windows by downloading and extracting the binary, and adding it to the PATH. ```bash Ensure that the GN tool is added to your __`PATH`__ environment variable. ``` -------------------------------- ### Setup Zephyr SDK on Windows Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/setup.md Navigate to the extracted Zephyr SDK directory and run the setup script. This only needs to be done once unless the SDK is relocated. ```bash cd zephyr-sdk-0.16.1 ``` ```bash setup.cmd ``` -------------------------------- ### ot-daemon Verbose Output Example Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/thread/coprocessor.md This is an example of the log output you can expect when ot-daemon starts successfully in verbose mode. ```bash Feb 10 16:51:15 ./build/posix/src/posix/ot-daemon[56466] : Running OPENTHREAD/632b63089; POSIX; Feb 10 2023 16:31:19 Feb 10 16:51:15 ./build/posix/src/posix/ot-daemon[56466] : Thread version: 3 Feb 10 16:51:15 ./build/posix/src/posix/ot-daemon[56466] : Thread interface: utun4 Feb 10 16:51:15 ./build/posix/src/posix/ot-daemon[56466] : RCP version: OPENTHREAD/632b63089; Zephyr; Feb 10 2023 16:50:38 ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/blog/posts/building-your-own-opensk-firmware/index.md Upgrades pip, setuptools, and wheel, then installs the uf2utils package from GitHub. Ensure you have Python installed. ```bash python -m pip install --upgrade pip setuptools wheel ``` ```bash python -m pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main ``` -------------------------------- ### Install Zephyr SDK on Linux Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Downloads, verifies, and installs the Zephyr SDK version 0.16.1 for Linux x86_64. Includes setup script execution. ```bash cd ~ wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/zephyr-sdk-0.16.1_linux-x86_64.tar.xz wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/sha256.sum | shasum --check --ignore-missing tar xvf zephyr-sdk-0.16.1_linux-x86_64.tar.xz cd zephyr-sdk-0.16.1 && ./setup.sh ``` -------------------------------- ### Install UF2 Converter (Windows) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/programming/uf2boot.md Installs the latest prerelease version of the uf2utils package from GitHub on Windows. ```bash py -3 -m pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main ``` -------------------------------- ### Run OpenSK Setup Script Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/blog/posts/building-your-own-opensk-firmware/index.md Executes the setup script for the OpenSK project. This script typically handles project-specific configurations and initializations. ```bash ./setup.sh ``` -------------------------------- ### Install Core Dependencies on Ubuntu with APT Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/setup.md Installs essential development tools and libraries on Ubuntu using the APT package manager. ```bash sudo apt install --no-install-recommends git cmake ninja-build gperf \ ccache dfu-util device-tree-compiler wget \ python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \ make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 ``` -------------------------------- ### Install and Use uf2conv for UF2 Conversion Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Install the `uf2conv` tool and use it to convert firmware images to UF2 format, list connected devices, inspect UF2 headers, convert binaries to C arrays, or flash directly. ```bash # Install uf2conv (Python 3.6+ required) # Linux/macOS: python3 -m pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main # Windows: py -3 -m pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main # Convert application firmware from .hex uf2conv -f 0xADA52840 -c -o application.uf2 application.hex # Convert application firmware from .bin (base address 0x1000) uf2conv -f 0xADA52840 -c -b 0x1000 -o application.uf2 application.bin # Convert bootloader from .hex uf2conv -f 0xD663823C -c -o bootloader.uf2 bootloader.hex # List connected UF2 devices uf2conv -l # Display UF2 header info without converting uf2conv -i application.uf2 # Convert binary to C array uf2conv -C -f 0xADA52840 application.bin -o firmware_array.h # Flash directly to connected device (combines convert + deploy) uf2conv -f 0xADA52840 -d /path/to/UF2BOOT application.hex ``` -------------------------------- ### Install OpenThread Dependencies Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/thread/coprocessor.md Execute the bootstrap script to install necessary dependencies for OpenThread. ```bash ./script/bootstrap ``` -------------------------------- ### Install west on Ubuntu Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/setup.md Use these commands to install the west tool on Ubuntu and update the PATH environment variable. ```bash pip3 install --user west ``` ```bash echo 'export PATH=~/.local/bin:"$PATH"' >> ~/.bashrc ``` ```bash source ~/.bashrc ``` -------------------------------- ### Install UF2 Converter (Linux/macOS) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/programming/uf2boot.md Installs the latest prerelease version of the uf2utils package from GitHub on Linux or macOS. ```bash python3 -m pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main ``` -------------------------------- ### Install Ubuntu Dependencies Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Installs required packages for nRF Connect SDK development on Ubuntu. Includes git, cmake, ninja-build, and various Python tools. ```bash sudo apt install --no-install-recommends git cmake ninja-build gperf \ ccache dfu-util device-tree-compiler wget \ python3-dev python3-pip python3-setuptools python3-tk python3-wheel \ xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 ``` -------------------------------- ### Install uuid-runtime Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/blog/posts/building-your-own-opensk-firmware/index.md Installs the uuid-runtime package, which provides the `uuidgen` command. This is necessary if the command is missing on your system. ```bash sudo apt-get update ``` ```bash sudo apt-get install uuid-runtime ``` -------------------------------- ### Install nRF Sniffer for 802.15.4 Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Steps to install the sniffer firmware and Wireshark extcap plugin for capturing IEEE 802.15.4, Thread, and Zigbee packets. Requires flashing firmware, installing Python dependencies, and copying the plugin to the Wireshark extcap path. ```bash # 1. Flash 802.15.4 sniffer firmware via UF2BOOT: # Drag nrf802154_sniffer_.uf2 onto UF2BOOT volume # 2. Install Python dependencies: cd tools/nrf802154_sniffer/ python3 -m pip install -r requirements.txt # Linux/macOS py -3 -m pip install -r requirements.txt # Windows # 3. Copy sniffer plugin to Wireshark Personal Extcap path: # Linux/macOS: copy nrf802154_sniffer.py + nrf802154_sniffer.sh # Windows: copy nrf802154_sniffer.py + nrf802154_sniffer.bat # 4. Verify plugin: ./nrf802154_sniffer.sh --extcap-interfaces # Linux/macOS nrf802154_sniffer.bat --extcap-interfaces # Windows # Expected output: # extcap {version=0.7.2}{help=...}{display=nRF Sniffer for 802.15.4} # control {number=6}{type=button}{role=logger}{display=Log}... # 5. Refresh in Wireshark (F5) → nRF Sniffer for 802.15.4 appears as capture interface # Python module usage (scripted capture): python3 -c " from nrf802154_sniffer import nrf802154_sniffer # Use as a module for scripted PCAP capture on selected channel " ``` -------------------------------- ### Start Zigbee Network (Coordinator) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/zigbee/shell.md Initiate a new Zigbee network on the device configured as the coordinator. This command should be run after setting the device role. ```bash bdb start ``` -------------------------------- ### Example Output of 'zdo short' Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/zigbee/shell.md This is an example of the output you can expect after running the `zdo short` command, showing the assigned short address. ```bash uart:~\$ zdo short 50b4 Done ``` -------------------------------- ### Install west on Windows Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/setup.md Use this command to install the west tool on Windows. Ensure the west location is added to the system's PATH. ```bash pip3 install west ``` -------------------------------- ### Example Ping Request and Response Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/zigbee/shell.md Demonstrates an example of issuing a ping command with a short address and payload size, and shows the expected successful response including ping time and endpoint logger information. ```bash zcl ping 0x50b4 10 ``` ```bash uart:~\$ zcl ping 0x50b4 10 Ping time: 17 ms Done [00:08:20.789,245] zigbee.eprxzcl: Received ZCL command (0): src_addr=0x50b4(short) src_ep=64 dst_ep=64 cluster_id=0xbeef profile_id=0x0104 cmd_dir=0 common_cmd=0 cmd_id=0x01 cmd_seq=0 disable_def_resp=1 manuf_code=void payload=[cdcdcdcdcdcdcdcdcdcd] (0) ``` -------------------------------- ### Verify nRF Sniffer Tool Installation Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/nrf802154-sniffer/installation.md Runs the nRF Sniffer tool to list available interfaces, confirming that the capture plugin is correctly installed and recognized by Wireshark. This command should be executed from the Wireshark personal extcap directory. ```bash nrf802154_sniffer.bat --extcap-interfaces ``` ```bash ./nrf802154_sniffer.sh --extcap-interfaces ``` -------------------------------- ### Enable Thread Network Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/thread/cli.md Bring the network interface up and start the Thread network using these commands. Ensure the network parameters are already configured. ```bash uart:~$ ot ifconfig up Done uart:~$ ot thread start Done ``` -------------------------------- ### Start ot-daemon with Verbose Logging Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/thread/coprocessor.md Launch the ot-daemon in verbose mode to monitor its activity and confirm it's running. Replace '/dev/cu.usbmodem14201' with your dongle's serial port. ```bash sudo ./build/posix/src/posix/ot-daemon 'spinel+hdlc+uart:///dev/cu.usbmodem14201?uart-baudrate=115200' --verbose ``` -------------------------------- ### Button Sample Output Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/button.md Observe this output in the serial terminal after flashing and connecting. It indicates successful setup and logs messages each time the button is pressed. ```bash Set up button at GPIO_0 pin 18 Set up LED at GPIO_0 pin 23 Press the button Button pressed at 512377 Button pressed at 517505 Button pressed at 538121 Button pressed at 571795 Button pressed at 592077 ... ``` -------------------------------- ### Build Custom OpenSK Firmware with GitHub Codespaces Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Steps to set up a GitHub Codespace, install necessary tools, build custom OpenSK firmware for the nRF52840 MDK USB Dongle, and convert it to UF2 format. ```bash # --- Building custom OpenSK firmware (GitHub Codespaces) --- # Create Codespace from google/OpenSK repository (develop branch) # In Codespace terminal: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh python -m pip install --upgrade pip setuptools wheel python -m pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main sudo apt-get update && sudo apt-get install uuid-runtime ./setup.sh # Build for nRF52840 MDK USB Dongle ./deploy.py --board=nrf52840_mdk_dfu --opensk --programmer=none # Output: target/nrf52840_mdk_dfu_merged.hex # Convert to UF2 uf2conv -c -f 0xada52840 -o target/opensk.uf2 target/nrf52840_mdk_dfu_merged.hex # Flash target/opensk.uf2 via UF2BOOT ``` -------------------------------- ### Build the Hello World Sample Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/hello_world.md Compile the Hello World sample for the dongle_nrf52840 board using the west build command. The -p always option ensures a clean build. ```bash west build -p always -b dongle_nrf52840 samples/hello_world ``` -------------------------------- ### Install Homebrew on macOS Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/setup.md Installs the Homebrew package manager on macOS using the official installation script. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Build Hello World Sample Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Builds the Hello World sample for the dongle_nrf52840 board. This sample outputs text to the UART console. ```bash cd my-workspace/ncs-playground west build -p always -b dongle_nrf52840 samples/hello_world ``` -------------------------------- ### Build Zigbee Lighting Network Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Guide to building a three-node Zigbee Home Automation network. Includes building a Network Coordinator, a Light Bulb (Router), and a Light Switch (End Device with BLE NUS). Each application needs to be built and flashed to a separate dongle. ```bash cd my-workspace/ncs-playground # Build Network Coordinator west build -p always -b dongle_nrf52840 samples/zigbee/network_coordinator # Build Light Bulb (Dimmable Light / Router) west build -p always -b dongle_nrf52840 samples/zigbee/light_bulb # Build Light Switch (Dimmer Switch / End Device, BLE multiprotocol) west build -p always -b dongle_nrf52840 samples/zigbee/light_switch \ -- -DOVERLAY_CONFIG=overlay-multiprotocol_ble.conf # Flash each to a separate dongle via UF2BOOT # Operation sequence: # 1. Power Coordinator → RGB turns Green (network open) # 2. Power Light Bulb → RGB turns Green (joined as Router) # 3. Power Light Switch→ RGB turns Green (joined as End Device) # Wait for Red LED on switch to turn ON (found light bulb to control) # 4. Connect nRF Toolbox → UART → device "Zigbee_Switch" # 5. Configure buttons (EOL = LF): # n → Turn Zigbee Light Bulb LED ON # f → Turn Zigbee Light Bulb LED OFF # t → Toggle Zigbee Light Bulb LED # i → Increase brightness level # d → Decrease brightness level ``` -------------------------------- ### Build USB Mass Storage sample (RAM-disk) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/usb/mass.md Build the sample with the default RAM-disk configuration. ```bash west build -p always -b dongle_nrf52840 samples/usb/mass ``` -------------------------------- ### Install pyOCD on Windows Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/programming/daplink.md Installs or updates the pyOCD package on Windows systems. Ensure Python 3 is installed and accessible in your PATH. ```bash py -3 -m pip install -U pyocd ``` -------------------------------- ### Install pyOCD on Linux/macOS Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/programming/daplink.md Installs or updates the pyOCD package on Linux or macOS systems. Ensure Python 3 is installed and accessible in your PATH. ```bash python3 -m pip install -U pyocd ``` -------------------------------- ### Build Zigbee Light Switch Sample with Multiprotocol Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/zigbee/lighting.md Build the light switch sample with Multiprotocol Bluetooth LE extension enabled. The -p always option forces a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/zigbee/light_switch -- -DOVERLAY_CONFIG=overlay-multiprotocol_ble.conf ``` -------------------------------- ### Build USB Mass Storage sample (RAM-disk with FATFS) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/usb/mass.md Build the sample with RAM-disk storage and FATFS enabled. ```bash west build -p always -b dongle_nrf52840 samples/usb/mass -- -DCONFIG_APP_MSC_STORAGE_RAM=y ``` -------------------------------- ### Install Python dependencies on Ubuntu Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/setup.md Install the required Python packages for Zephyr, nRF, and mcuboot on Ubuntu within the my-workspace folder. Use the --user flag for local installation. ```bash pip3 install --user -r zephyr/scripts/requirements.txt ``` ```bash pip3 install --user -r nrf/scripts/requirements.txt ``` ```bash pip3 install --user -r bootloader/mcuboot/scripts/requirements.txt ``` -------------------------------- ### Build Zigbee Network Coordinator Sample Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/zigbee/lighting.md Build the network coordinator sample for the dongle_nrf52840 board. The -p always option forces a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/zigbee/network_coordinator ``` -------------------------------- ### Build the Button Sample Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/button.md Compile the Button sample using the 'west build' command, specifying the dongle_nrf52840 board. The -p always option ensures a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/button ``` -------------------------------- ### Install Python Requirements for nRF Sniffer Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ble-sniffer/installation.md Installs the necessary Python dependencies for the nRF Sniffer tool from the requirements.txt file. Use the appropriate command based on your operating system and Python installation. ```bash py -3 -m pip install -r requirements.txt ``` ```bash python -m pip install -r requirements.txt ``` ```bash python3 -m pip install -r requirements.txt ``` -------------------------------- ### Build USB Mass Storage sample (FLASH-disk with FATFS) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/usb/mass.md Build the sample with FLASH-disk storage and FATFS enabled. ```bash west build -p always -b dongle_nrf52840 samples/usb/mass -- -DCONFIG_APP_MSC_STORAGE_FLASH_FATFS=y ``` -------------------------------- ### Check Installed Versions on macOS with Homebrew Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/setup.md Lists the installed versions of packages managed by Homebrew. ```bash brew list --versions ``` -------------------------------- ### Build USB Mass Storage sample (FLASH-disk with LittleFS) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/usb/mass.md Build the sample with FLASH-disk storage and LittleFS enabled. ```bash west build -p always -b dongle_nrf52840 samples/usb/mass -- -DCONFIG_APP_MSC_STORAGE_FLASH_LITTLEFS=y ``` -------------------------------- ### Check Installed Packages on Windows with Chocolatey Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/setup.md Lists all locally installed packages and their versions managed by Chocolatey. ```bash choco list -lo ``` -------------------------------- ### Build BLE Observer Sample (Default) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/ble/observer.md Build the BLE Observer sample using the west command with the dongle_nrf52840 board. The -p always option forces a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/ble/observer ``` -------------------------------- ### Upgrade Packages on Ubuntu Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/setup.md Execute this command to install the latest versions of all installed packages on your Ubuntu system. ```bash sudo apt upgrade ``` -------------------------------- ### Install Python Requirements Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Installs Python dependencies required by the nRF Connect SDK samples and tools. ```bash pip3 install -r zephyr/scripts/requirements.txt pip3 install -r nrf/scripts/requirements.txt pip3 install -r bootloader/mcuboot/scripts/requirements.txt ``` -------------------------------- ### Build BLE Observer Sample (Extended Scanning) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/ble/observer.md Build the BLE Observer sample with extended scanning enabled by specifying an overlay configuration file. ```bash west build -p always -b dongle_nrf52840 samples/ble/observer -- -DOVERLAY_CONFIG=overlay-extended.conf ``` -------------------------------- ### Build Zigbee Light Bulb Sample Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/zigbee/lighting.md Build the light bulb sample for the dongle_nrf52840 board. The -p always option forces a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/zigbee/light_bulb ``` -------------------------------- ### Build Blinky Sample Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Builds the Blinky sample for the dongle_nrf52840 board. This sample demonstrates basic GPIO LED control. ```bash cd my-workspace/ncs-playground west build -p always -b dongle_nrf52840 samples/blinky ``` -------------------------------- ### Build the Blinky Sample Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/building.md Compile the Blinky sample for the dongle_nrf52840 board. The -p always option ensures a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/blinky ``` -------------------------------- ### Install macOS Dependencies with Homebrew Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Installs essential development tools on macOS using the Homebrew package manager. ```bash brew install cmake ninja gperf python3 ccache qemu dtc wget libmagic ``` -------------------------------- ### Build Zigbee Network Coordinator Sample Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Builds the Zigbee Network Coordinator sample for the dongle_nrf52840 board. ```bash cd my-workspace/ncs-playground west build -p always -b dongle_nrf52840 samples/zigbee/network_coordinator ``` -------------------------------- ### Build the USB HID Mouse Sample Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/usb/hid_mouse.md Compile the sample using the west build command, specifying the dongle_nrf52840 board. The -p always option ensures a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/usb/hid-mouse ``` -------------------------------- ### Install Rust Toolchain Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/blog/posts/building-your-own-opensk-firmware/index.md Installs the Rust programming language toolchain. This is a prerequisite for building Rust-based projects like OpenSK. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Build the Writable NDEF Message Sample Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/nfc/writable_ndef_msg.md Build the sample using the 'west build' command. The '-p always' option forces a pristine build, recommended for new users. The '-b' option specifies the board. ```bash cd my-workspace/ncs-playground ``` ```bash west build -p always -b dongle_nrf52840 samples/nfc/writable_ndef_msg ``` -------------------------------- ### Build Button Sample Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Builds the Button sample for the dongle_nrf52840 board. This sample demonstrates reading GPIO input with interrupts. ```bash cd my-workspace/ncs-playground west build -p always -b dongle_nrf52840 samples/button ``` -------------------------------- ### Install CMake on Windows with Chocolatey Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/setup.md Installs CMake on Windows using Chocolatey, ensuring it's added to the system's PATH. ```bash choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' ``` -------------------------------- ### Build Thread Co-processor Sample (Default) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/thread/coprocessor.md Build the Thread Co-processor sample using the 'west build' command with the 'dongle_nrf52840' board. ```bash west build -p always -b dongle_nrf52840 samples/openthread/coprocessor ``` -------------------------------- ### Build Thread CLI Sample (Low Power Mode) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/thread/cli.md Builds the Thread CLI sample with low power mode enabled using overlay configurations. This is useful for reducing power consumption. ```bash west build -p always -b dongle_nrf52840 samples/openthread/cli -- -DOVERLAY_CONFIG=overlay-low_power.conf -DDTC_OVERLAY_FILE=low_power.overlay ``` -------------------------------- ### Build the BLE Peripheral LBS Sample Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/ble/peripheral_lbs.md Build the sample using the 'west build' command, specifying the board as 'dongle_nrf52840'. The '-p always' option forces a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/ble/peripheral_lbs ``` -------------------------------- ### Build Thread CLI Sample (Default) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/thread/cli.md Builds the Thread CLI sample with default configurations. The -p always option ensures a clean build. ```bash west build -p always -b dongle_nrf52840 samples/openthread/cli ``` -------------------------------- ### Install Core Dependencies on Windows with Chocolatey Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/setup.md Installs essential development tools like Ninja, Git, Python, and others on Windows using Chocolatey. ```bash choco install ninja gperf python git dtc-msys2 wget unzip ``` -------------------------------- ### Build Thread Co-processor Sample (Vendor Hooks) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/thread/coprocessor.md Build the Thread Co-processor sample with vendor hooks support by specifying the 'overlay-vendor_hook.conf' overlay configuration. ```bash west build -p always -b dongle_nrf52840 samples/openthread/coprocessor -- -DOVERLAY_CONFIG=overlay-vendor_hook.conf ``` -------------------------------- ### Build the NFC Launch App Sample Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/nfc/launch_app.md Build the sample using the 'west build' command. The '-p always' option ensures a pristine build, which is recommended for new users. This command compiles the sample for the 'dongle_nrf52840' board. ```bash cd my-workspace/ncs-playground west build -p always -b dongle_nrf52840 samples/nfc/record_launch_app ``` -------------------------------- ### Install nRF Sniffer Python Module on Windows Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/nrf802154-sniffer/capturing.md Use this command to install the nRF Sniffer Python module on Windows. Ensure you are in the tools/nrf802154_sniffer/ directory. ```bash py -3 -m pip install . ``` -------------------------------- ### Install west Package Manager Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Installs the 'west' tool, which is used for managing Zephyr RTOS development. Use pip3 for macOS/Windows or --user for Ubuntu. ```bash pip3 install west # macOS/Windows pip3 install --user west # Ubuntu echo 'export PATH=~/.local/bin:"$PATH"' >> ~/.bashrc && source ~/.bashrc ``` -------------------------------- ### Build Thread CLI Sample (Multiprotocol) Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/thread/cli.md Builds the Thread CLI sample with multiprotocol support enabled. This configuration allows the device to handle multiple network protocols simultaneously. ```bash west build -p always -b dongle_nrf52840 samples/openthread/cli -- -DOVERLAY_CONFIG=overlay-multiprotocol.conf ``` -------------------------------- ### Install nRF Sniffer Python Module on Linux/macOS Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/nrf802154-sniffer/capturing.md Use this command to install the nRF Sniffer Python module on Linux or macOS. Ensure you are in the tools/nrf802154_sniffer/ directory. ```bash python3 -m pip install . ``` -------------------------------- ### Install and Use pyOCD for DAPLink Programming Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Installs pyOCD and provides commands for programming an nRF52840 target using a DAPLink debug probe. Ensure correct SWD wiring between the DAPLink and the target. ```bash # Install pyOCD python3 -m pip install -U pyocd # Linux/macOS py -3 -m pip install -U pyocd # Windows # DAPLink ↔ Target wiring: # DAPLink 3V3 → Target VIN # DAPLink GND → Target GND # DAPLink P4 → Target RESET # DAPLink P5 → Target SWDCLK # DAPLink P6 ↔ Target SWDIO # Load .hex firmware onto target pyocd load -t nrf52840 firmware.hex # Load .bin firmware at application base address 0x1000 pyocd load -t nrf52840 --base-address 0x1000 firmware.bin # Full chip erase pyocd erase -t nrf52840 --chip # Start GDB remote server for debugging (port 3333 default) pyocd gdbserver -t nrf52840 # Interactive REPL commander pyocd commander -t nrf52840 # List connected debug probes pyocd list # Drag-and-drop alternative: copy .hex directly onto DAPLINK drive ``` -------------------------------- ### Verify nRF Sniffer Installation Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ble-sniffer/installation.md Runs the nRF Sniffer tool to list available interfaces, confirming a successful installation. This command should be executed from Wireshark's personal external capture plugin folder. ```bash nrf_sniffer_ble.bat --extcap-interfaces ``` ```bash ./nrf_sniffer_ble.sh --extcap-interfaces ``` -------------------------------- ### Build the BLE Peripheral HIDS Mouse Sample Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/ble/peripheral_hids_mouse.md Compile the sample using the 'west build' command, specifying the dongle_nrf52840 board. The -p always option ensures a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/ble/peripheral_hids_mouse ``` -------------------------------- ### Build the BLE Peripheral HIDS Keyboard Sample Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/ble/peripheral_hids_keyboard.md Compile the sample using the 'west build' command, specifying the target board as 'dongle_nrf52840'. The '-p always' option ensures a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/ble/peripheral_hids_keyboard ``` -------------------------------- ### Navigate to Project Directory Source: https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/main/docs/guides/ncs/samples/adc.md Navigates to the ncs-playground directory. Ensure you have set up the environment and obtained the code first. ```bash cd my-workspace/ncs-playground ``` -------------------------------- ### Build ADC Sample Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Builds the ADC sample for the dongle_nrf52840 board. This sample demonstrates reading analog-to-digital converter channels. ```bash cd my-workspace/ncs-playground west build -p always -b dongle_nrf52840 samples/adc ``` -------------------------------- ### Flash nRF Sniffer Firmware and Install Extcap Plugin Source: https://context7.com/makerdiary/nrf52840-mdk-usb-dongle/llms.txt Flashes the BLE sniffer firmware via UF2BOOT and installs the necessary Python dependencies for the Wireshark extcap plugin. Copy the plugin to Wireshark's Personal Extcap path. ```bash # 1. Flash sniffer firmware via UF2BOOT: # Drag nrf_sniffer_for_bluetooth_le_.uf2 onto UF2BOOT volume # (Button becomes RESET after flash; double-click to re-enter DFU next time) # 2. Install Python dependencies for the capture plugin: cd tools/ble_sniffer/extcap/ python3 -m pip install -r requirements.txt # Linux/macOS py -3 -m pip install -r requirements.txt # Windows # 3. Copy extcap/ contents to Wireshark Personal Extcap path # (find path: Wireshark → Help → About Wireshark → Folders → Personal Extcap path) # 4. Verify plugin installation (run from Personal Extcap path): ./nrf_sniffer_ble.sh --extcap-interfaces # Linux/macOS nrf_sniffer_ble.bat --extcap-interfaces # Windows # Expected output: extcap {version=4.1.1}{display=nRF Sniffer for Bluetooth LE}{help=...} control {number=0}{type=selector}{display=Device}{tooltip=Device list} control {number=3}{type=string}{display=Adv Hop}{default=37,38,39}... # 5. In Wireshark: # Capture → Refresh Interfaces (F5) # View → Interface Toolbars → nRF Sniffer for Bluetooth LE # # RSSI filter example (capture screen): # rssi >= -70 (only packets with RSSI >= -70 dBm) # # 6. Install nRF Sniffer Wireshark profile: # Copy tools/ble_sniffer/Profile_nRF_Sniffer_Bluetooth_LE/ # into Wireshark Personal configuration → profiles/ ```