Getting Started with the Trimension SR250 Development Board

このドキュメントの内容

  • 1

    Out of the Box
  • 2

    Plug It In
  • 3

    Get Software
  • 4

    Set Up Build Environment
  • 5

    Build and Load Using West Command Line
  • 6

    Build and Load Using VS Code
  • 7

    Troubleshooting VS Code
  • 8

    Troubleshooting VS Code Continuation

1. Out of the Box

The Trimension SR250 development board offers a flexible platform for integrating ultra-wideband (UWB) ranging and radar into consumer and industrial IoT solutions. It enables an easy integration of Trimension SR250 for presence, location and motion detection, helping improve efficiency and safety.

This page will guide you through the setup and operation of the Trimension SR250 development board.

1.1 Kit Contents and Packing List

The kit contents include:

  • Assembled and tested the evaluation board in an antistatic bag

1.2 Additional Hardware

In addition to the kit contents, you will also need the following hardware.

FRDM-RW612 Development Board Some minor rework is necessary to route the API interface pins to the Arduino headers for proper communication with SR250-ARD board.

In order to allow the SR250-ARD shield to communicate with the FRDM-RW612 board via SPI, a small rework is required to expose the SPI signals on the Arduino headers.

FRDM-RW612 Development Board

Alternatively you could simply interconnect FRMD-RW612 Arduino compatible header pins D0 to D11 and D1 to D12 via jumper wires.

FRDM-RW612 Development Board

2. Plug It In

2.1 Plug It In

In the first step, you will assemble the boards together through the Arduino headers:

Plug it in the board

Make sure both USB-C ports of the FRDM-RW612 board are connected to the laptop.

For additional guidance, please refer to the SR250 UWB Plug-and-Play Application .

3. Get Software

When setting up the development environment, you will need the following software:

3.1 Git

The latest version of Git .

3.2 CMake

CMake  version 3.21.1 or later.

3.3 Python

Python  3.8 or later.

And the following dependencies:

  • Ninja: Latest version
  • West: Zephyr’s metatool
# Install Python dependencies
pip3 install west ninja
# Verify installations
python3 --version
cmake --version
ninja --version
west --version

3.4 Zephyr SDK

Zephyr SDK  0.16.0 or later

3.5 Serial Monitoring Application

A serial terminal is required to see the logs and ongoing transactions (for example, Teraterm , Putty , Minicom , etc.).

4. Set Up Build Environment

The following steps below will guide you through setting up the build environment for Zephyr-based projects.

4.1 Step 1: Retrieve UWBIoT middleware for SR250

# Download SR250 Software to working directory
git clone https://github.com/nxp-uwb/sr250-uwbiot-zephyr.git

4.2 Step 2: Initialize West Workspace

# Initialize west workspace
cd ~/sr250-uwbiot-zephyr
west init -l --mf west.yml uwbiot-top

4.3 Step 3: Update Dependencies

# Download Zephyr OS and all dependencies
west update

4.4 Step 4: Install Python Dependencies

# Install Zephyr Python dependencies
pip install -r zephyr/scripts/requirements.txt

4.5 Step 5: Set Up Environment

# Set the environment (required for each new terminal session)
# Windows:
zephyr\zephyr-env.cmd
# Linux:
source zephyr/zephyr-env.sh

5. Build and Load Using West Command Line

5.1 Building Demo Application

# Example: Build ranging controller demo
west build -b frdm_rw612 -p auto uwbiot-top/demos/common/demo_ranging_controller/zephyr
# Example: Build radar demo
west build -b frdm_rw612 -p auto uwbiot-top/demos/radar/demo_radar/zephyr

Replace the demo path with the specific demo that you want to build.

  • uwbiot-top/demos/SR2xx/demo_sr2xx_fw_update
  • uwbiot-top/demos/SR2xx/demo_device_calibration

5.2 Flashing the Application

# Flash built application using west flash

5.3 Running the Application

Open your serial terminal application and connect to the FRDM-RW612 HS-USB interface through Virtual COM port set to the following configurations:

  • Baud rate: 3000000
  • Data bits: 8Parity: None
  • Stop bits: 1 bit
  • Flow control: None
  • New line receives: AUTO

After resetting the FRDM-RW612 board, the demo application will display initialization messages, status updates and operational logs in the terminal window.

Running the application

6. Build and Load Using VS Code

In this step, you will ensure that MS Visual Studio (VS) Code  is properly installed.

6.1 Installing VS Code Extensions

Follow these steps to install the needed VS Code extensions for Zephyr development:

Step 1: Open Extensions View

  1. Launch VS Code
  2. Navigate to the extensions view (or use shortcuts Ctrl+Shift+X or Cmd+Shift+X on macOS)

Step 2: Install the Required Extensions

To set up VS Code, you will install the following extensions:

  • C/C++ Extension Pack: Provides IntelliSense, debugging and code browsing
  • CMake Tools: CMake language support and build integration
  • Zephyr IDE (optional): Additional Zephyr-specific features
Installing VS Code extensions - step 2

Step 3: Install MCUXpresso Zephyr Dependencies

During the setup, the Zephyr integrated development environment (IDE) extension will prompt you to install the required dependencies for MCUXpresso Zephyr development.

Open MCUXpresso Installer Installing VS Code extensions - step 3

Part 1: Zephyr Dependencies Installation

During the first part of installing Zephyr dependencies, the image below is what will appear on your screen.

Installing VS Code extensions - step 4

Part 2: Zephyr Dependencies Installation

During the second part of installing Zephyr dependencies, the image below is what will appear on your screen.

Installing VS Code extensions - step 5

Import the FRDM-RW612 Zephyr Repository

  1. In VS Code, open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS)
  2. Locate the local repository where the west update has been completed
  3. Select the repository folder
Installing VS Code extensions - step 6

Understanding the Project Structure

The FRDM-RW612 Zephyr project is CMake-based, which provides:

  • Complete development environment integration
  • Automated build configuration
  • Integrated debugging support
  • IntelliSense and code navigation

Import the CMake Project

In the following steps, you will complete the import of CMake.

  1. Click the MCUXpresso IDE icon in the VS Code activity bar (found at the left sidebar)
  2. In the MCUXpresso IDE panel, click the “Import Example” from the “Repository” tab
  3. Locate and select the demo project folder you want to import (for example, uwbiot-op/demos/ranging)
  4. Choose your board (frdmrw612) from the dropdown list
  5. Click “Import” to complete the project import process
Installing VS Code extensions - step 7

6.2 Building and Flashing the Application

In the following steps, you will build and flash the application.

Select Build Configuration

  1. Click on the build variant selector in the VS Code status bar
  2. Choose your desired configuration:
    • Debug: Includes debugging symbols, optimized for debugging
    • Release: Optimized for performance and size
Installing VS Code extensions - step 8

Build the Application

  1. Click the Build button in the status bar or open Command Palette and select CMake: Build
  2. Wait for the build process to complete

Build Output Location

The compiled binaries will be generated in the build directory that corresponds to your selected configuration:

  • build/Debug/ (for Debug builds)
  • build/Release/ (for Release builds)

6.3 Debug Environment Setup

In the following steps, you will debug your development environment.

Configure Debug Settings

  1. Ensure your debug probe (for example, J-Link, CMSIS-DAP) is properly connected to the FRDM-RW612 board
  2. Connect the debug probe to your PC via USB
  3. In VS Code, navigate to the Run and Debug view (or use a shortcut: Ctrl+Shift+D)
  4. Select the appropriate debug configuration from the dropdown
Debug environment setup - step 1

Hardware Connection Checklist

Before you begin debugging, verify that the:

  • The debug probe is connected to the FRDM-RW612 SWD/JTAG header
  • FRDM-RW612 board is receiving power (via USB or external power)
  • The debug probe is connected to your PC
  • Appropriate drivers are installed for your debug probe

Start Debugging

  1. Press F5 or click the green play button in the Run and Debug view
  2. The application will be flashed to the board, starting the debugging session
  3. During debugging, use breakpoints, step through code and inspect variables as needed

7. Troubleshooting VS Code

This section covers common issues for both VS Code and command line builds.

7.1 West Command Not Found (Linux)

# Install west via pip
pip install --user west
export PATH=$PATH:~/.local/bin

7.2 Build Fails (“No Such File or Directory”)

# Ensure west update completed successfully
west update
# Try a pristine build
west build -b frdm_rw612 -p always 

7.3 Windows: File Not Found Errors for Existing Files

Symptom:

You may encounter errors (as shown below) even though the files do exist in your workspace:

  • fatal error: : No such file or directory
  • CMake Error: Cannot find source file:
  • Error: The system cannot find the path specified

Cause:

Windows has a default MAX_PATH limit of 260 characters. When file paths exceed the character limit, Windows cannot access them, resulting in “file not found” errors.

Solution:

To locate the files, either use shorter workspace paths (such as C:\uwb) or enable long path support by using one of the following methods:

# first method: in registry editor 
1. Press Win + R, type "regedit" and press Enter
2. Go to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
3. Find or create a DWORD value: LongPathsEnabled
4. Set value to: 1
5. Restart your computer
# Second method: in Group policy editor
1. Press Win + R, type "gpedit.msc" and press Enter
2. Navigate to: Computer Configuration > Administrative Templates > System > Filesystem
3. Enable "Enable Win32 long paths"
4. Restart your computer
# Third method: via PowerShell command (to be run as Administrator) 
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

7.4 Windows: Use WSL2 (Recommended Alternative)

When encountering compatibility issues, try the Windows Subsystem for Linux (see below).

# Install WSL2 from PowerShell (Administrator)
wsl --install
# Then work within WSL2 Ubuntu environment
# Follow Linux instructions from there

7.5 CMake Error (“fatal error: opening dependency file” or “No such file or directory”)

The above errors occur when CMake cannot find generated dependency files, often due to:

  • Incomplete west update
  • Missing modules or corrupted build cache
  • Path length issues on Windows
  • Incomplete dependency resolution

Error Example

With CMake, you may encounter the following:

fatal error: opening dependency file modules\psa_crypto_driver\...
\mcuxClPsaDriver_generate_ecp_key.c.obj.d: No such file or directory
fatal error: opening dependency file build/CMakeFiles/myproject.dir/src/
main.c.obj.d: No such file or directory

This happens due to any of the following issues:

  1. The modules/directory are incomplete
  2. West update is incomplete
  3. Build cache is corrupted or incomplete
  4. The CMake dependency tracking files are missing
  5. Not enough available disk space
  6. Like with Windows, long paths must be enabled (see above)

Solutions

Below are suggestions for resolving CMake errors.

# 1. Clean build directory completely
rm -rf build/
# 2. Re-run west update to ensure all dependencies are fetched
west update
# 3. Try pristine build
west build -b frdm_rw612 -p always 
# 4. If still failing, check if all modules are present
west list
# 5. Verify CMake can find the toolchain
cmake --version

7.6 Python Version Mismatch

If you encounter a Python mismatch, refer to the following:

# Ensure Python 3.8 or later
python --version
# Upgrade if needed
sudo apt install python3.10 # Linux

7.7 CMake Version Is Too Old

To rule out the CMake version being out of date, refer to the following:

# Check version
cmake --version
# Upgrade via pip
pip install --upgrade cmake
# Or install from official source
# Linux: https://cmake.org/download/
# macOS: brew install cmake

7.8 Ninja Not Found

If Ninja is not found, refer to the following:

# Install Ninja
pip install ninja
# Or via package manager
sudo apt install ninja-build # Linux
brew install ninja # macOS

7.9 Zephyr SDK Not Found (Linux)

When the SDK is not found, refer to the following:

# Set environment variable
export ZEPHYR_SDK_INSTALL_DIR=~/zephyr-sdk-0.16.5
# Add to ~/.bashrc for persistence
echo 'export ZEPHYR_SDK_INSTALL_DIR=~/zephyr-sdk-0.16.5' >> ~/.bashrc

7.10 Out of Memory During Build

If the system indicates that it is out of memory, refer to the following:

# Limit parallel jobs
west build -b frdm_rw612 -p auto  -- -j2
# Or set in environment (Linux)
export CMAKE_BUILD_PARALLEL_LEVEL=2

7.11 Disk Space Issues

If you encounter a disk space error, refer to the following:

# Check available space
df -h .
# Clean old builds
rm -rf build/
# Clean west cache (if needed)
rm -rf ~/.west/

7.12 Module Import Errors in Python

If you encounter module import errors, refer to the following:

# Reinstall requirements
pip install -r zephyr/scripts/requirements.txt --force-reinstall
# Clear pip cache
pip cache purge

7.13 Permission Denied When Flashing (Linux)

If you are denied permission when flashing, refer to the following:

sudo usermod -a -G dialout $USER
# Log out and log back in

7.14 Flash Fails/Device Not Found

If flashing fails due to the device not being found, refer to the following:

# Check if device is connected
# Check J-Link connection
JLinkExe # Should detect device (Linux)

7.15 Board Not Found Error

If you encounter an error that the board is not found, refer to the following:

# List available boards
west boards
# Ensure you're using the correct board name
# For FRDM-RW612: frdm_rw612

8. Troubleshooting VS Code Continuation

This section continues covering common issues for both VS Code and command line builds.

8.1 SR250 Firmware (FW) Version Error

While running the demo application, if you encounter the following error (shown below) in the logs, this indicates a mismatch between SR250 FW version and UWBIOT MW version.

SR250 FW version error

Running the demo application uwbiot-top/demos/SR2xx/demo_sr2xx_fw_update will allow SR250 FW to update.

8.2 Multiple Python Versions Conflict

If you encounter a conflict related to multiple versions of Python, refer to the following:

# Use virtual environment
python -m venv ~/Myvenv
source ~/Myvenv/bin/activate
# Then proceed with setup

8.3 Useful Debug Commands

The following are additional commands to assist with the debugging process:

# Verbose build
west build -b frdm_rw612 -p auto  -v
# Show west configuration
west config
# List all projects and their status
west list
# Show build system info
west build -b frdm_rw612 -p auto  -- --trace
# Check environment variables
env | grep ZEPHYR

8.4 Getting Help

If issues persist, consult these additional resources:

  1. Check the Zephyr Troubleshooting Guide
  2. Review build logs in the build/zephyr/directory
  3. Enable verbose build output (west build -v)
  4. Check Zephyr issues
  5. Verify all Prerequisites are correctly installed

8.5 Extra Useful Debug Commands

The following are additional commands to assist with the debugging process:

# Verbose build
west build -b frdm_rw612 -p auto  -v
# Show west configuration
west config
# List all projects and their status
west list
# Show build system info
west build -b frdm_rw612 -p auto  -- --trace
# Check environment variables
env | grep ZEPHYR