### Run Zephyr SDK Setup for Windows Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/setup Navigate to the extracted SDK directory and run the setup script. This script only needs to be run once unless the SDK is relocated. ```bash cd zephyr-sdk-0.16.1 ``` ```bash setup.cmd ``` -------------------------------- ### nRF Sniffer Extcap Interface Output Example Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/nrf802154-sniffer/installation Example output when running the nRF Sniffer tool to list interfaces, indicating a successful setup. This output is expected after running the verification commands. ```text extcap {version=0.7.2}{help=https://github.com/NordicSemiconductor/nRF-Sniffer-for-802.15.4}{display=nRF Sniffer for 802.15.4} control {number=6}{type=button}{role=logger}{display=Log}{tooltip=Show capture log} ``` -------------------------------- ### ot-daemon Verbose Output Example Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/thread/coprocessor This is an example of the log output you can expect when ot-daemon starts successfully in verbose mode. It shows the OpenThread and RCP versions, and the Thread interface. ```log 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 ``` -------------------------------- ### Run Zephyr SDK Setup for macOS Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/setup Navigate to the extracted SDK directory and execute the setup script. This script only needs to be run once unless the SDK is moved. ```bash cd zephyr-sdk-0.16.1 ``` ```bash ./setup.sh ``` -------------------------------- ### Run OpenSK Setup Script Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/blog/building-your-own-opensk-firmware?q= Executes the setup script for the OpenSK project. This script typically configures the environment and prepares for the build process. ```bash ./setup.sh ``` -------------------------------- ### Install OpenThread Dependencies Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/thread/coprocessor Execute the bootstrap script to install all necessary dependencies for building OpenThread. ```bash ./script/bootstrap ``` -------------------------------- ### Install Dependencies with apt Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/setup Installs essential development tools on Ubuntu using the apt package manager. This command includes git, cmake, ninja, python3, and build 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 ``` -------------------------------- ### Start Simple Gateway Application Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/zigbee/ncp?q= Start the simple gateway application, replacing serial_port_name with the actual serial port used for NCP communication. ```bash NCP_SLAVE_PTY=*serial_port_name* ./application/simple_gw/simple_gw ``` -------------------------------- ### Enable Thread Network Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/thread/cli Bring the Thread interface up and start the Thread network using the 'ot ifconfig up' and 'ot thread start' commands. ```shell uart:~$ ot ifconfig up Done uart:~$ ot thread start Done ``` -------------------------------- ### Install Python Dependencies Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/blog/building-your-own-opensk-firmware?q= Installs necessary Python packages, including pip, setuptools, wheel, and the uf2utils library from GitHub. This ensures all build tools are up-to-date. ```bash python -m pip install --upgrade pip setuptools wheel ``` ```bash python -m pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main ``` -------------------------------- ### Build Hello World Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/hello_world Build the 'hello_world' sample for the 'dongle_nrf52840' board using the 'west' command. The '-p always' option ensures a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/hello_world ``` -------------------------------- ### Build the Button Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/button Use the 'west build' command to compile the button sample. Specify the board as 'dongle_nrf52840'. The '-p always' option ensures a pristine build. ```bash cd my-workspace/ncs-playground ``` ```bash west build -p always -b dongle_nrf52840 samples/button ``` -------------------------------- ### Upgrade Packages on Ubuntu Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/setup Execute this command to upgrade all installed packages to their latest versions. Ensure your system is up-to-date before proceeding with SDK setup. ```bash sudo apt upgrade ``` -------------------------------- ### Build Thread CLI Sample (Low Power) Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/thread/cli Build the Thread CLI sample with low power configuration enabled using overlay files. ```bash west build -p always -b dongle_nrf52840 samples/openthread/cli -- -DOVERLAY_CONFIG=overlay-low_power.conf -DDTC_OVERLAY_FILE=low_power.overlay ``` -------------------------------- ### nRF Sniffer Configuration Output Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ble-sniffer/installation This is an example of the output you should see when running the nRF Sniffer tool to list available interfaces, indicating successful installation and configuration. ```text extcap {version=4.1.1}{display=nRF Sniffer for Bluetooth LE}{help=https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE} control {number=0}{type=selector}{display=Device}{tooltip=Device list} control {number=1}{type=selector}{display=Key}{tooltip=} control {number=2}{type=string}{display=Value}{tooltip=6 digit passkey or 16 or 32 bytes encryption key in hexadecimal starting with '0x', big endian format.If the entered key is shorter than 16 or 32 bytes, it will be zero-padded in front'}{validation=\b^(([0-9]{6})|(0x[0-9a-fA-F]{1,64})|([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2}) (public|random))$\b} control {number=3}{type=string}{display=Adv Hop}{default=37,38,39}{tooltip=Advertising channel hop sequence. Change the order in which the sniffer switches advertising channels. Valid channels are 37, 38 and 39 separated by comma.}{validation=^\s*((37|38|39)\s*.){0,2}(37|38|39)\s*$}{required=true} control {number=7}{type=button}{display=Clear}{tooltop=Clear or remove device from Device list} control {number=4}{type=button}{role=help}{display=Help}{tooltip=Access user guide (launches browser)} control {number=5}{type=button}{role=restore}{display=Defaults}{tooltip=Resets the user interface and clears the log file} control {number=6}{type=button}{role=logger}{display=Log}{tooltip=Log per interface} value {control=0}{value= }{display=All advertising devices}{default=true} value {control=0}{value=[00,00,00,00,00,00,0]}{display=Follow IRK} value {control=1}{value=0}{display=Legacy Passkey}{default=true} value {control=1}{value=1}{display=Legacy OOB data} value {control=1}{value=2}{display=Legacy LTK} value {control=1}{value=3}{display=SC LTK} value {control=1}{value=4}{display=SC Private Key} value {control=1}{value=5}{display=IRK} value {control=1}{value=6}{display=Add LE address} value {control=1}{value=7}{display=Follow LE address} ``` -------------------------------- ### Add GN Tool to System PATH Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/setup Append the GN tool's location to your system's PATH environment variable. This example uses bash and assumes GN is installed in `${HOME}/gn`. ```bash echo 'export PATH=${HOME}/gn:"$PATH"' >> ${HOME}/.bashrc ``` -------------------------------- ### Build Thread CLI Sample (Default) Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/thread/cli Build the Thread CLI sample for the dongle_nrf52840 board. The -p always option forces a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/openthread/cli ``` -------------------------------- ### Build Zigbee Network Coordinator Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/zigbee/lighting 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 ``` -------------------------------- ### List Installed Chocolatey Packages Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/setup Lists all locally installed Chocolatey packages and their versions. This is useful for verifying installations. ```bash choco list -lo ``` -------------------------------- ### Install CMake with Chocolatey Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/setup Installs CMake and adds it to the system PATH. Ensure Chocolatey is installed and running as Administrator. ```bash choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' ``` -------------------------------- ### Build the Peripheral HIDS Keyboard Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/ble/peripheral_hids_keyboard Use the `west build` command to compile the sample. The `-b` option specifies the board, and `-p always` ensures a pristine build. ```bash cd my-workspace/ncs-playground west build -p always -b dongle_nrf52840 samples/ble/peripheral_hids_keyboard ``` -------------------------------- ### List Installed Homebrew Packages Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/setup Displays the versions of packages currently installed via Homebrew. Useful for verifying installations. ```bash brew list --versions ``` -------------------------------- ### Build Thread CLI Sample (Multiprotocol) Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/thread/cli Build the Thread CLI sample with multiprotocol support enabled using overlay files. ```bash west build -p always -b dongle_nrf52840 samples/openthread/cli -- -DOVERLAY_CONFIG=overlay-multiprotocol.conf ``` -------------------------------- ### Install Rust Toolchain Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/blog/building-your-own-opensk-firmware?q= Installs the Rust programming language toolchain required for building OpenSK. Ensure you have `curl` installed. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Install UF2 Converter (Windows) Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/programming/uf2boot Installs the UF2 converter tool on Windows using pip. Ensure Python 3.6.0 or later is installed. ```bash py -3 -m pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main ``` -------------------------------- ### Build Zigbee Light Bulb Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/zigbee/lighting 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 the BLE Peripheral HIDS Mouse Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/ble/peripheral_hids_mouse Build the sample using the west 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_hids_mouse ``` -------------------------------- ### Install pyOCD on Windows Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/programming/pitaya-link Installs the latest stable version of pyOCD on Windows using pip. Ensure Python 3.6.0 or later is installed. ```bash py -3 -m pip install -U pyocd ``` -------------------------------- ### Build the BLE Peripheral HIDS Keyboard Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/ble/peripheral_hids_keyboard?q= Compile the sample using the 'west build' command, specifying the dongle board. The '-p always' option ensures a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/ble/peripheral_hids_keyboard ``` -------------------------------- ### Install UF2 Converter (Linux/macOS) Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/programming/uf2boot Installs the UF2 converter tool on Linux or macOS using pip. Ensure Python 3.6.0 or later is installed. ```bash python3 -m pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main ``` -------------------------------- ### Build the Blinky Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/building Compile the Blinky sample for the dongle_nrf52840 board. The -p always option ensures a pristine build, recommended for new users. ```bash west build -p always -b dongle_nrf52840 samples/blinky ``` -------------------------------- ### Install pyOCD on Linux/macOS Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/programming/pitaya-link Installs the latest stable version of pyOCD on Linux or macOS using pip. Ensure Python 3.6.0 or later is installed. ```bash python3 -m pip install -U pyocd ``` -------------------------------- ### Build BLE Observer Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/ble/observer?q= Builds the BLE Observer sample using the west command. Use the `-b` option to specify the board. The `-p always` option forces a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/ble/observer ``` ```bash west build -p always -b dongle_nrf52840 samples/ble/observer -- -DOVERLAY_CONFIG=overlay-extended.conf ``` -------------------------------- ### Install Homebrew Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/setup Installs the Homebrew package manager on macOS. This script should be run using a bash shell. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Build BLE Observer Sample with Extended Scanning Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/ble/observer 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 ``` -------------------------------- ### Install Dependencies with Homebrew Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/setup Installs necessary development tools using Homebrew on macOS. This includes CMake, Ninja, Python 3, and others. ```bash brew install cmake ninja gperf python3 ccache qemu dtc wget libmagic ``` -------------------------------- ### Build Zigbee NCP Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/zigbee/ncp?q= Build the Zigbee NCP sample using the west command. The -p always option forces a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/zigbee/ncp ``` -------------------------------- ### Install Python Requirements for nRF Sniffer Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ble-sniffer/installation?q= Installs the necessary Python dependencies for the nRF Sniffer tool. Run this command in the `tools/ble_sniffer/extcap/` directory. ```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 BLE Observer Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/ble/observer Build the BLE Observer sample using the west command. Specify the board as dongle_nrf52840. ```bash west build -p always -b dongle_nrf52840 samples/ble/observer ``` -------------------------------- ### Install uuid-runtime Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/blog/building-your-own-opensk-firmware?q= Installs the `uuid-runtime` package to provide the `uuidgen` command, which may be required by the build process. This is typically needed on Debian-based systems. ```bash sudo apt-get update ``` ```bash sudo apt-get install uuid-runtime ``` -------------------------------- ### Build the ADC Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/adc Build the ADC sample using the 'west build' command. Specify the board as 'dongle_nrf52840' and use '-p always' for a pristine build. The build files will be located in 'build/zephyr'. ```bash west build -p always -b dongle_nrf52840 samples/adc ``` -------------------------------- ### Hello World Output Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/hello_world Observe the 'Hello World!' message printed to the serial console, along with the board name, indicating the sample is running correctly. ```text Hello World! dongle_nrf52840 Hello World! dongle_nrf52840 Hello World! dongle_nrf52840 ... ``` -------------------------------- ### Build the BLE Peripheral LBS Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/ble/peripheral_lbs Compile the sample using the 'west build' command, specifying the dongle board. The '-p always' option ensures a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/ble/peripheral_lbs ``` -------------------------------- ### Install Python dependencies Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/setup Install the Python requirements for the nRF Connect SDK. This command should be run from the 'my-workspace' directory and ensures all necessary Python packages are available. ```bash pip3 install -r zephyr/scripts/requirements.txt ``` ```bash pip3 install -r nrf/scripts/requirements.txt ``` ```bash pip3 install -r bootloader/mcuboot/scripts/requirements.txt ``` ```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 Shell Sample Source: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/samples/zigbee/shell?q= Builds the Zigbee Shell sample using the west command. The -p always option forces a pristine build. ```bash west build -p always -b dongle_nrf52840 samples/zigbee/shell ```