Skip to content

Commit

Permalink
Improve the docs for firmware build/compile
Browse files Browse the repository at this point in the history
  • Loading branch information
z3ugma committed Jan 3, 2025
1 parent cc1ff65 commit 5a79eee
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 35 deletions.
64 changes: 41 additions & 23 deletions docs/docs/developer/Compile_firmware.mdx
Original file line number Diff line number Diff line change
@@ -1,62 +1,80 @@
---
title: Compiling the Device Firmware
description: 'Step-by-step guide to compile and install firmware for your OMI device.'
description: "Step-by-step guide to compile and install firmware for your OMI device."
---

# Compile Firmware
# Compile Firmware

### Prefer a Pre-Built Firmware?

### Prefer a Pre-Built Firmware?
Navigate to [Flash Device](https://docs.omi.me/get_started/Flash_device/) to install a pre-built firmware version.

---

## Build Your Own Firmware
## Build Your Own Firmware

### Step 1: Set Up nRF Connect
### Step 1: Set Up nRF Connect

Follow the tutorial in this video:
[How to Set Up nRF Connect](https://youtu.be/EAJdOqsL9m8)

You must use **nRF Connect** SDK and toolchain version `2.7.0` to compile the firmware.
Note that this is not the `latest` version of the NRF Connect toolchain or SDK.

---

### Step 2: Open the Firmware Application
### Step 2: Open the Firmware Application

1. Open **nRF Connect Extension** inside VS Code.
2. Click "Open an existing application" and navigate to the `firmware` folder in the root of this repository.
2. Click "Open an existing application" and navigate to the `firmware/firmware_v1.0` folder in the root of this repository.

<img src="/images/install_firmware_screenshot_1.png" alt="install_firmware_screenshot_1" width="100%"/>
<img
src="/images/install_firmware_screenshot_1.png"
alt="install_firmware_screenshot_1"
width="75%"
/>

---
<img
src="/images/install_firmware_screenshot_2.png"
alt="install_firmware_screenshot_2"
width="75%"
/>

### Step 3: Add a Build Configuration
---

1. In the application panel of the extension, click the **Add Build Configuration** icon.
### Step 3: Add a Build Configuration

<img src="/images/addbuild.png" alt="Add Build Configuration" width="200"/>
1. In the application panel of the extension, click the **Add Build Configuration** icon. Choose a `CMake Preset` that matches your hardware.

2. Choose:
- **Board:** `xiao_ble_sense`
- **Configuration:** `prj.conf`
<img
src="/images/build_configuration.png"
alt="Build Configuration"
width="75%"
/>

3. Click "Build Configuration."
2. Scroll to the bottom and click "Build Configuration." This will start the nRFConnect SDK building your firmware file.
A VSCode notification popup will notify you of the progress of your build.

<img src="/images/build_settings.png" alt="Build Settings" width="400"/>
<img
src="/images/build_configuration_button.png"
alt="Build Configuration"
width="75%"
/>

---

### Step 4: Locate the Compiled Firmware
### Step 4: Locate the Compiled Firmware

Once the build succeeds, you will find the `zephyr.uf2` file in the `firmware/build/zephyr` directory.
Once the build succeeds, you will find the `zephyr.uf2` file in the directory corresponding to the CMake preset you chose, for example `firmware/firmware_v1.0/build/build_xiao_ble_sense_devkitv2-adafruit/zephyr/`.

---

### Step 5: Flash the Firmware
### Step 5: Flash the Firmware

Follow the steps as described [here](https://docs.omi.me/get_started/Flash_device#flashing-the-firmware) using the generated file
Follow the steps as described [here](docs/get_started/Flash_device.mdx) using the generated file

---

## Congratulations!
## Congratulations!

You have successfully compiled and installed the firmware on your OMI device.
You have successfully compiled and installed the firmware on your OMI device.
39 changes: 27 additions & 12 deletions docs/docs/get_started/Flash_device.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Update OMI Firmware
description: 'This document outlines the process of updating the OMI firmware.'
description: "This document outlines the process of updating the OMI firmware."
---

To update the firmware of your OMI device, navigate to the OMI App:
Expand All @@ -12,10 +12,15 @@ To update the firmware of your OMI device, navigate to the OMI App:

### Video Tutorial

<div style={{ textAlign: 'center' }}>
<div style={{ textAlign: "center" }}>
<video width="100%" height="auto" controls>
<source src="https://github.com/BasedHardware/omi/blob/main/docs/static/images/updating_your_friend.mov" type="video/mp4" />
Your browser does not support the video tag. <a href="https://github.com/BasedHardware/omi/blob/main/docs/static/images/updating_your_friend.mov">Click here to watch the video</a>.
<source
src="https://github.com/BasedHardware/omi/blob/main/docs/static/images/updating_your_friend.mov"
type="video/mp4"
/>
Your browser does not support the video tag. <a href="https://github.com/BasedHardware/omi/blob/main/docs/static/images/updating_your_friend.mov">
Click here to watch the video
</a>.
</video>
</div>

Expand All @@ -34,14 +39,24 @@ To update the firmware of your OMI device, navigate to the OMI App:

### Putting OMI into DFU Mode

1. **Locate the DFU Button:**
- For Developer Kit 2, remove the lid to access the button.
- For Developer Kit 1, see the image below for button location:
<img src="/images/dfu_dev_kit_reset_button.png" title="DFU Button Location" width="300" />
2. **Prepare a Pin:** Use a small pin or similar tool to press the tiny button.
3. **Press the DFU Button Twice:** Quickly press the button twice in succession using the pin.
4. **Check for Recognition:** After pressing the button, your computer should recognize a new drive.
5. **Verify the Drive Name:** Look for a drive named `/Volumes/XIAO-SENSE` on your computer. This confirms the device is in DFU mode.
1. Plug the OMI device into your computer using a USB cable.
2. **Locate the DFU Button:**
- For Developer Kit 2, remove the lid to access the button which is labeled "RST"
- <img
src="/images/dk2_rst_button.jpeg"
title="DFU Button Location, DevKit 2"
width="300"
/>
- For Developer Kit 1, see the image below for button location:
- <img
src="/images/dfu_dev_kit_reset_button.png"
title="DFU Button Location, DevKit 1"
width="300"
/>
3. **Prepare a Pin:** Use a small pin or similar tool to press the tiny button.
4. **Press the DFU Button Twice:** Quickly press the button twice in succession using the pin.
5. **Check for Recognition:** After pressing the button, your computer should recognize a new drive.
6. **Verify the Drive Name:** Look for a drive named `/Volumes/XIAO-SENSE` on your computer. This confirms the device is in DFU mode.

---

Expand Down
Binary file added docs/static/images/build_configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/images/dk2_rst_button.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/static/images/install_firmware_screenshot_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5a79eee

Please sign in to comment.