nRF52840 MDK USB Dongle Documentation

repository·main·Indexed 19 days ago

https://github.com/makerdiary/nrf52840-mdk-usb-dongle

Development guide for the nRF52840 MDK USB Dongle, a low-cost platform based on the Nordic nRF52840 SoC. Includes instructions for drag-and-drop programming via UF2 Bootloader, using the device as a Bluetooth LE or IEEE 802.15.4 packet sniffer, and developing with the nRF Connect SDK (NCS) and Zephyr RTOS. Covers firmware compilation for OpenSK, BLE connectivity setup, and hardware specifications including Arm Cortex-M4, USB 2.0, and NFC-A.

Tokens
32.4K
Snippets
80
Records
194
Agent score
63%

What's inside nRF52840 MDK USB Dongle

  1. Overview of nRF Sniffer for 802.15.4

    main

    The nRF Sniffer for 802.15.4 is a debugging tool for IEEE 802.15.4-based protocols like Thread and Zigbee. It provides near real-time packet capture of wireless traffic between devices, including encrypted links.

    Users can capture packets using two primary methods:

    1. Wireshark: Using the provided extcap plugin to capture and visualize traffic.
    2. Python Scripting: Installing the sniffer as a Python module to automate captures or integrate with custom scripts.

    The sniffer can report metadata such as channel, Received Signal Strength Indicator (RSSI), and Link Quality Indicator (LQI). Captured data includes source/destination addresses, PAN IDs, and packet payloads.

  2. Overview of nRF52840 MDK USB Dongle capabilities

    main

    The nRF52840 MDK USB Dongle is a multiprotocol development platform based on the Nordic Semiconductor nRF52840 SoC. It can be used in several modes:

    • Multiprotocol Node: Supports Bluetooth LE, Bluetooth mesh, Thread, Zigbee, 802.15.4, ANT, and 2.4 GHz proprietary protocols.
    • Network Co-Processor (NCP): Connects to a PC or USB-enabled device via USB.
    • Packet Sniffer: Can function as a Bluetooth Low Energy or IEEE 802.15.4 sniffer when used with Wireshark.

    Hardware Features:

    • SoC: 64 MHz Arm® Cortex-M4 with FPU, 1 MB Flash, 256 KB RAM.
    • Peripherals: Up to 12 GPIOs (via edge pins), Arm Serial Wire Debug (SWD) port, programmable user button, and RGB LED.
    • Connectivity: Integrated USB 2.0 Full-speed Controller and 2.4G chip antenna.
    • Programming: Shipped with UF2 Bootloader, enabling drag-and-drop programming via USB drive.
    • Software Support: Compatible with nRF Connect SDK (Zephyr RTOS), Google's OpenSK, and more.
  3. Overview of Thread CoAP Client and Server samples

    main

    This project demonstrates a basic OpenThread network using CoAP (Constrained Application Protocol) for resource access:

    • Thread CoAP Client: Uses the Zephyr CoAP API to access resources on a server. It includes a Multiprotocol Bluetooth LE extension using the Nordic UART Service (NUS), allowing control of LED states via Bluetooth LE within a Thread network.
    • Thread CoAP Server: Exposes specific CoAP resources on the Thread network:
      • /light: Controls LED0 (Red).
      • /provisioning: Used for performing provisioning tasks.

    Communication can be performed via unicast (to a specific paired node) or multicast (to all nodes in the network).

  4. Overview of nRF Connect SDK for nRF52840 MDK USB Dongle

    main

    The nRF Connect SDK is a unified software development kit designed for building low-power wireless applications on Nordic Semiconductor devices, including the nRF52, nRF53, and nRF91 series. When used with the nRF52840 MDK USB Dongle, it provides an extensible framework for both memory-constrained and complex applications.

    Key components integrated into the SDK include:

    • RTOS: Zephyr™ real-time operating system.
    • Protocol Stacks: Bluetooth® Low Energy, Bluetooth mesh, Matter, Thread/Zigbee, and LTE-M/NB-IoT/GPS (TCP/IP).
    • Middleware: CoAP, MQTT, LwM2M, and various hardware drivers.
    • Security: Trusted Firmware-M and the MCUboot secure bootloader.
  5. Overview of nRF52840 MDK USB Dongle

    main

    The nRF52840 MDK USB Dongle is a low-cost development platform based on the Nordic Semiconductor nRF52840 multiprotocol SoC. It is designed in a USB dongle form factor and can be used as a multiprotocol node (Bluetooth LE, Thread, Zigbee, 802.15.4, ANT, 2.4 GHz proprietary) or as a Network Co-Processor (NCP) connected to a PC via USB.

    Key Hardware Capabilities:

    • SoC: Arm® Cortex-M4 with FPU (64 MHz), 1 MB Flash, 256 KB RAM.
    • Connectivity: 2.4 GHz Transceiver (+8 dBm TX Power), Integrated USB 2.0 Full-speed Controller, Integrated NFC-A Tag.
    • Peripherals: Up to 12 GPIOs via edge pins, Arm Serial Wire Debug (SWD) port, programmable user button, and RGB LED.
    • Power: 3.3V regulator (1A peak) with VBUS & VIN Power-Path Management.
    • Programming: Shipped with UF2 Bootloader for drag-and-drop programming over USB.
  6. Overview of the Thread Co-processor sample

    main

    The Thread Co-processor sample implements the Radio Co-processor (RCP) architecture within the Zephyr environment. It is a customized version of the standard Zephyr OpenThread Co-Processor sample, optimized for the nRF Connect SDK requirements.

    Key enhancements include:

    • Increased Mbed TLS heap size.
    • Lowered main stack size to provide more space for user applications.
    • Support for Thread 1.2 features.
    • Removal of obsolete configuration options.
    • Vendor hooks: Allows users to extend handled properties with customized functionalities for the co-processor architecture.
  7. Overview of the Zigbee Lighting Demo

    main

    The Zigbee Lighting demo demonstrates a basic Zigbee network using three distinct device roles:

    • Zigbee Network Coordinator: Acts as the network coordinator and supports network steering commissioning.
    • Zigbee Light bulb: Acts as a Zigbee Router and implements the Dimmable Light device specification (Zigbee Home Automation profile).
    • Zigbee Light switch: Acts as a Zigbee End Device and implements the Dimmer Switch device specification. It can control devices with Level Control and On/Off clusters. It also includes a Multiprotocol Bluetooth LE extension using the Nordic UART Service (NUS) to control the bulb via Bluetooth LE in a Thread network.

    To analyze network traffic, you can use the nRF Sniffer for 802.15.4.

  8. Overview of the NFC URI record sample

    main

    The NFC URI record sample demonstrates how to use an NFC tag to expose a URL to NFC-enabled polling devices using the NFC Data Exchange Format (NDEF).

    Behavior:

    • On startup, the sample initializes the NFC tag and generates an NDEF message containing the URL https://makerdiary.com.
    • The application listens for NFC events.
    • Visual Indicator: The Red LED turns on when an NFC field is detected and turns off when the field is removed.

    Critical Requirement: This sample requires the UF2 Bootloader version 0.7.1 or higher. Older versions of the UF2 Bootloader use the NFC1 and NFC2 pins for GPIO functionality, which will conflict with this sample.

  9. Overview of the USB HID Mouse sample

    main

    The USB HID Mouse sample demonstrates the Zephyr project's USB Human Interface Device (HID) driver.

    Behavior:

    • Enumerates the board as a mouse.
    • Maps the onboard button to a left mouse click.
    • Optionally supports a right mouse button (depending on board hardware).
    • Provides X-axis and Y-axis movement.
    • Remote Wakeup: If the USB peripheral driver supports it, clicking the button will perform a wakeup request if the USB bus is in a suspended state.