This is the documentation for the latest (main) development branch of Zephyr. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

AutoPTS on Windows 10 with nRF52 board


This tutorial shows how to setup AutoPTS client and server to run both on Windows 10. We use WSL1 with Ubuntu only to build a Zephyr project to an elf file, because Zephyr SDK is not available on Windows yet. Tutorial covers only nrf52840dk.

Update Windows and drivers

Update Windows in:

Start -> Settings -> Update & Security -> Windows Update

Update drivers, following the instructions from your hardware vendor.

Install Python 3

Download and install Python 3. Setup was tested with versions >=3.8. Let the installer add the Python installation directory to the PATH and disable the path length limitation.

../../../_images/install_python1.png ../../../_images/install_python2.png

Install Git

Download and install Git. During installation enable option: Enable experimental support for pseudo consoles. We will use Git Bash as Windows terminal.


Install PTS 8

Install latest PTS from Remember to install drivers from installation directory “C:/Program Files (x86)/Bluetooth SIG/Bluetooth PTS/PTS Driver/win64/CSRBlueCoreUSB.inf”



Starting with PTS 8.0.1 the Bluetooth Protocol Viewer is no longer included. So to capture Bluetooth events, you have to download it separately.

Setup Zephyr project for Windows

Setup from Zephyr site

Open Git Bash and go to home:

cd ~

Install west:

pip3 install west

Get the Zephyr source code:

west init zephyrproject

Go into freshly created folder:

cd zephyrproject


west update

Export a Zephyr CMake package. This allows CMake to automatically load boilerplate code required for building Zephyr applications:

west zephyr-export

Zephyr’s scripts/requirements.txt file declares additional Python dependencies. Install them with pip:

pip3 install -r ~\zephyrproject\zephyr\scripts\requirements.txt

Setup WSL1 with Ubuntu 20.4

Setup Install Ubuntu 20.4 on WSL1. Open PowerShell as Administrator and run:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Restart Windows. After restart, open Microsoft Store and install Ubuntu 20.4 LTS.


Run Ubuntu. You will be asked to create a user account and password:


When finished, run commands:

sudo apt update
sudo apt upgrade

Install python3:

sudo apt install python3

Install pip:

sudo apt install python3-pip

Install west:

pip3 install --user -U west

Export local bin to PATH:

echo 'export PATH=~/.local/bin:"$PATH"' >> ~/.bashrc

Reload PATH:

source ~/.bashrc

Install cmake:

sudo apt install cmake

Go to your zephyrproject:

cd /mnt/c/Users/Codecoup/zephyrproject

and then run:

west zephyr-export
pip3 install --user wheel
pip3 install --user -r /mnt/c/Users/codecoup/zephyrproject/zephyr/scripts/requirements.txt

Check if all modules have been installed:

pip3 list

If modules still will be missing, just install them with:

pip3 install <module_name>

Install Ninja:

pip3 install ninja

Go to home:

cd ~

Download latest toolchain installer from Move it to ~

mv /mnt/c/Users/Codecoup/Downloads/zephyr-sdk-<your_version> ~

Give permissions to the installer:

chmod +x zephyr-sdk-<your_version>

and run the installer:

./zephyr-sdk-<your_version> -- -d ~/zephyr-sdk-<your_version>

Copy rules:

sudo cp ~/zephyr-sdk-<your_version>/sysroots/x86_64-pokysdk-linux/usr/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d

Restart the Ubuntu machine. You may want to shutdown all WSL consoles from Windows’s Git Bash:

wsl --shutdown

After Ubuntu restart, go to:

cd /mnt/c/Users/codecoup/zephyrproject

and test if west can build:

west build -p auto -b nrf52840dk_nrf52840 zephyr/tests/bluetooth/tester/

From now on, you can build projects by typing in Windows’s Git Bash:

wsl -d Ubuntu-20.04 -u codecoup -- bash -c -i "cd /mnt/c/Users/Codecoup/zephyrproject/ ; west build -p auto -b nrf52840dk_nrf52840 zephyr/tests/bluetooth/tester/"

Install nrftools

On Windows download latest nrftools (version >= 10.12.1) from site and run default install.


Connect devices

../../../_images/devices_1.png ../../../_images/devices_2.png

Flash board

In Device Manager find COM port of your nrf board. In my case it is COM3.


In Git Bash, go to zephyrproject

cd ~/zephyrproject

You can display flashing options with:

west flash --help

and flash board with built earlier elf file:

west flash --skip-rebuild --board-dir /dev/ttyS2 --elf-file ~/zephyrproject/build/zephyr/zephyr.elf

Note that west does not accept COMs, so use /dev/ttyS2 as the COM3 equivalent, /dev/ttyS2 as the COM3 equivalent, etc.(/dev/ttyS + decremented COM number).

Setup auto-pts project

In Git Bash, clone project repo:

git clone

Go into the project folder:

cd auto-pts

Install required python modules:

pip3 install --user wheel
pip3 install --user -r autoptsserver_requirements.txt
pip3 install --user -r autoptsclient_requirements.txt

Install socat.exe

Download and extract socat.exe from into folder ~/socat-


Add path to directory of socat.exe to PATH:


Running AutoPTS

Server and client by default will run on localhost address. Run server:

python ./ -S 65000


If the error “ImportError: No module named pywintypes” appeared after the fresh setup, uninstall and install the pywin32 module:

pip install --upgrade --force-reinstall pywin32

Run client:

python ./ zephyr-master ~/zephyrproject/build/zephyr/zephyr.elf -t COM3 -b nrf52 -S 65000 -C 65001

At the first run, when Windows asks, enable connection through firewall:



  • “When running actual hardware test mode, I have only BTP TIMEOUTs.”

This is a problem with connection between auto-pts client and board. There are many possible causes. Try:

  • Clean your auto-pts and zephyr repos with


This command will force the irreversible removal of all uncommitted files in the repo.

git clean -fdx

then build and flash tester elf again.

  • If you have set up Windows on virtual machine, check if guest extensions are installed properly or change USB compatibility mode in VM settings to USB 2.0.

  • Check, if firewall in not blocking python.exe or socat.exe.

  • Check if board sends ready event after restart (hex 00 00 80 ff 00 00). Open serial connection to board with e.g. PuTTy with proper COM and baud rate. After board reset you should see some strings in console.

  • Check if socat.exe creates tunel to board. Run in console

socat.exe -x -v tcp-listen:65123 /dev/ttyS2,raw,b115200

where /dev/ttyS2 is the COM3 equivalent. Open PuTTY, set connection type to Raw, IP to, port to 65123. After board reset you should see some strings in console.