This repository is a clone of the nRF5340 Audio application, specifically configured for programming gateway devices using nRF5340 Audio DKs to stream Audio from a phone or PC to OpenEarables via Bluetooth LE.
The nRF5340 Audio Gateway is designed to act as a central device that can connect to multiple audio headsets and manage audio streaming. This repository provides the necessary configuration and build instructions to program nRF5340 Audio DKs as gateway devices.
- nRF Connect SDK: Ensure you have the nRF Connect SDK installed and properly configured
- Hardware: nRF5340 Audio Development Kit
- Tools:
westbuild toolnrfutilfor programming- USB connection to the development kit
The name of your OpenEarable must be specified in unicast_client/overlay-unicast_client.conf so that the gateway device can connect to it:
# Change the device name here to the name of your earable
CONFIG_BT_DEVICE_NAME="OpenEarable-XXXX"-
Install Visual Studio Code (VS Code)
- Download and install from https://code.visualstudio.com
-
Install the J‑Link Software and Documentation Package
- Download and install from https://www.segger.com/downloads/jlink/
-
Install nRF-Util
- Download from nRF Util – Nordic Semiconductor
- Add
nrfutilto your system'sPATHenvironment variable
-
Install the nRF Connect for VS Code Extension
- Open VS Code
- Go to the Extensions tab and install "nRF Connect for VS Code"
- Install all required dependencies when prompted
-
Install the Toolchain via nRF Connect
- Open the nRF Connect tab in VS Code
- Click "Install Toolchain"
- Select and install version 3.0.1
-
Install the nRF Connect SDK
- In the nRF Connect tab, select "Manage SDK"
- Install SDK version 3.0.1
-
Open the Firmware Folder in VS Code
- Use
File > Open Folderor drag-and-drop the firmware directory into VS Code - OR in the APPLICATIONS section of the nRF Connect tab:
- Select
Open Exisiting Application - Select the
open-earable-gatewaydirectory
- Select
- Use
-
Configure the Application Build
- If not already open, navigate to the nrfConnect extension tab in VSCode
- In the APPLICATIONS section of the nRF Connect extension tab:
- Select the
open-earable-gatewayapplication - Click "+ Add build configuration" to set up a new build
- Select the SDK version 3.0.1, toolchain version 3.0.1, and
nrf5340_audio_dk/nrf5340/cpuappas board target - Configure the development kit as the gateway device. This can be achieved by adding
unicast_client/overlay-unicast_client.conftoExtra Kconfig fragments - To build with FOTA (firmware over-the-air update functionality):
- Leave the
Base configuration files (Kconfig fragments)dropdown empty - as
Extra CMAKE argumentsset-DFILE_SUFFIX="fota" - as
Build directoryname setbuild_fota
- Leave the
- To build without FOTA:
- Select
prj.confas theBase configuration files (Kconfig fragments) - Do not set any of the FOTA flags described above
- Select
- Select the
-
Build and Flash
- Connect the development kit via usb to your comuter
- Click on
Generate and Buildand wait for the application to build (this will take some time) - Connect your development kit via usb to your computer and click on
Flashin theActionstab
Use the following west command to build the gateway firmware:
west build -b nrf5340_audio_dk/nrf5340/cpuapp --pristine -- \
-DEXTRA_CONF_FILE=".\unicast_client\overlay-unicast_client.conf" \
-DFILE_SUFFIX=releaseCommand breakdown:
-b nrf5340_audio_dk/nrf5340/cpuapp: Specifies the board and core (application core)--pristine: Cleans the build directory before building-DEXTRA_CONF_FILE=".\unicast_client\overlay-unicast_client.conf": Adds the gateway configuration overlay-DFILE_SUFFIX=release: Usesprj_release.confinstead of the defaultprj.conf
After building, program the firmware to your development kit:
west flashNote: If you have multiple development kits connected, you may need to specify the serial number:
west flash --serial-number <SEGGER_SERIAL_NUMBER>To find the serial number of connected devices:
nrfutil device listAfter programming, verify the gateway is working correctly:
- Plug in the nRF5340 Audio DK into your phone or PC (macOS is not supported) and select it as the audio output.
- Check LED indicators:
- The nRF5340 Audio DK should turn green
- LED3 should start blinking
- Connect OpenEarable:
- Power on your OpenEarable and enter bonding mode by pressing the button for 13 seconds
- Your OpenEarable should automatically connect to the nRF5340 Audio DK and start playing audio
- LED1 will turn blue on the nRF5340 Audio DK when it is connected to the OpenEarable
- Ensure you're using the correct board specification (
nrf5340_audio_dk/nrf5340/cpuapp) - Verify the nRF Connect SDK version is compatible
- Clean the build directory with
west build --pristineif encountering build errors
- Check USB connection and ensure the device is powered on
- Verify the correct serial number if multiple devices are connected
- Use
nrfutil device listto confirm device connectivity
- Ensure you're using
prj_release.conf(via-DFILE_SUFFIX=release) to avoid debug overhead - The release configuration disables logging and debug features that can impact audio streaming performance
- Make sure the name of your OpenEarable matches exactly
CONFIG_BT_DEVICE_NAMEinunicast_client/overlay-unicast_client.conf - Erase bonding information on the nRF5340 Audio DK by holding
BTN 5during startup. Then enter bonding mode again on the OpenEarable by pressing its button for 13 seconds
├── prj_release.conf # Release configuration (recommended base)
├── prj.conf # Debug configuration (not recommended for streaming)
├── unicast_client/
│ └── overlay-unicast_client.conf # Gateway-specific configuration overlay
├── unicast_server/ # Headset configuration (not used for gateway)
├── broadcast_source/ # Broadcast source configuration
├── broadcast_sink/ # Broadcast sink configuration
└── src/ # Source code
This project is based on the nRF5340 Audio application from Nordic Semiconductor and is licensed under the same terms as the original project.