Skip to content

Building your own OpenSK firmware

Introduction

This post demonstrates how to build your own OpenSK firmware using GitHub Codespaces.

For instructions to build OpenSK on your local machine, please refer to OpenSK's installation guide.

Requirements

Before you start, check that you have the required hardware and software:

Building OpenSK

  1. Go to GitHub Codespaces and click New codespace to start.
  2. On the Create a new codespace page, select google/OpenSK repository and the develop branch, then click Create codespace.
  3. After setting up your codespace, you will see the workspace for OpenSK.
  4. In the TERMINAL tab, run the following command to install Rust toolchain:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
  5. Install Python dependencies:

    python -m pip install --upgrade pip setuptools wheel
    
    python -m pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main
    
  6. Install uuid-runtime if you are missing the uuidgen command:

    sudo apt-get update
    
    sudo apt-get install uuid-runtime
    
  7. Run the setup script:

    ./setup.sh
    
  8. Run the following command to build the firmware for nRF52840 MDK USB Dongle:

    ./deploy.py --board=nrf52840_mdk_dfu --opensk --programmer=none
    

    After running this command, the firmware can be found in target folder with the name nrf52840_mdk_dfu_merged.hex.

  9. Generate the OpenSK firmware in UF2:

    uf2conv -c -f 0xada52840 -o target/opensk.uf2 target/nrf52840_mdk_dfu_merged.hex
    

    The output file opensk.uf2 is the OpenSK firmware you expect.

  10. Download the firmware and follow the Getting Started Guide to test your own firmware.

Reference