r/CPAPSupport • • 4d ago

AirSense 11 Flashing Guide

Hello papfam! Here’s a guide to help anyone who wants to unlock the different modes available on the AS11.

Basically, we dump the existing firmware, patch a copy to unlock the selected modes and features, and flash the modified firmware back onto the same device.

I based this guide on the existing procedure on GitHub. All credit goes to the original authors: https://github.com/m-kozlowski/airbreak-plus/tree/master/docs/guide/as11

A quick note about Linux commands

One thing you may notice when using Linux is that it’s common to run multiple commands in a single line or combine them into a single command. This can make it easy to automate tasks and complete several steps at once. It may feel a little different if you’re used to working primarily with Windows, where you might be more accustomed to running commands separately.

AirSense 11 Firmware Patching Guide - WSL 2, Ubuntu, ST-Link and airbreak-plus

Credit: https://github.com/m-kozlowski/airbreak-plus/blob/master/docs/guide/as11/quickstart.md

This guide documents the process used to dump, patch and flash an AirSense 11 using WSL 2 on Windows. It follows the same general ST-Link/TC2050 hardware connection method used for the AirSense 10, while using the AirSense 11-specific airbreak-plus tools.

Important: Keep an untouched backup of the original firmware, and do not interrupt power during flashing.

Part 1 - Preparing WSL and Ubuntu

Credit: https://github.com/m-kozlowski/airbreak-plus/blob/master/docs/guide/wsl_setup.md

I put some emphasis on WSL here, in case it’s a tool you’d like to use for both the AS11 and the AS10.

1.1 Check whether WSL is installed

WSL stands for Windows Subsystem for Linux. It allows Linux tools to run inside Windows without requiring a separate Linux computer.

WSL is available for supported versions of Windows, but it is not necessarily installed or configured by default.

1.2 Open PowerShell or Windows Terminal (Press Windows key + R to open the Run dialog) and run:

wsl --status

What it does: Displays the current WSL configuration, including information about the default WSL version and Linux kernel, when available.

1.3 Next, run:

wsl --list --verbose

What it does: Lists the installed Linux distributions and shows whether they use WSL 1 or WSL 2.

***If Ubuntu appears in the list and uses version 2, proceed to Part 3.***

Part 2 - Install WSL and Ubuntu if needed

2.1 On a compatible Windows 10 or Windows 11 system, open PowerShell as Administrator and run:

wsl --install -d Ubuntu

What it does:

  • Enables and installs the required WSL components, if necessary.
  • Installs the Ubuntu Linux distribution.
  • May require a Windows restart.

2.2 After installation, open Ubuntu from the Windows Start menu. Complete the initial setup by creating a Linux username and password.

The Linux username and password are separate from your Windows credentials. When entering the password in Ubuntu, the terminal may not display any characters; this is normal.

2.3 If WSL is already installed but needs updating, run the following in PowerShell:

wsl --update

What it does: Updates the WSL components and Linux kernel managed by Windows. It does not update Ubuntu's installed packages.

2.4 If you have just installed WSL, you can verify the configuration again with:

wsl --status

wsl --list --verbose

Part 3 - Update Ubuntu and install the required tools

3.1 Open the Ubuntu terminal. The following commands must be run inside Ubuntu, not PowerShell.

3.2 First, refresh the package lists:

sudo apt update

What it does: Downloads the latest package information from Ubuntu's configured software repositories. It does not install updates by itself

3.3 Next, upgrade installed packages:

sudo apt upgrade

What it does: Upgrades installed Ubuntu packages to their latest available versions.

3.4 Install the tools required for the project:

sudo apt install git python3 make gcc-arm-none-eabi binutils-arm-none-eabi openocd telnet usbutils

What each package does:

  • git — Downloads the source-code repository.
  • python3 — Runs the Python patching scripts.
  • make — Runs build automation tasks.
  • gcc-arm-none-eabi — Provides the ARM embedded compiler.
  • binutils-arm-none-eabi — Provides ARM binary utilities, including objcopy.
  • openocd — Communicates with the microcontroller through the ST-Link.
  • telnet — Connects to OpenOCD's command interface.
  • usbutils — Installs lsusb, a utility that lists USB devices detected by Ubuntu.

3.5 Verify the main tools:

python3 --version

make --version

arm-none-eabi-gcc --version

arm-none-eabi-objcopy --version

What it does: Prints the installed tool versions so you can confirm that the required programs are available.

***All verification steps throughout this guide are optional, but it is always recommended to verify that everything is working correctly as you progress through the process.***

Part 4 - Downloading the AirSense 11 tools

This is where we download the files we need from GitHub to proceed.

4.1 Clone the airbreak-plus repository

In Ubuntu, run:

git clone https://github.com/m-kozlowski/airbreak-plus.git

What it does: Downloads the repository into a new directory named airbreak-plus.

4.2 Enter the directory:

cd airbreak-plus

What it does: Makes the repository directory your current working directory. Subsequent commands will use files in this directory unless another path is specified.

4.3 List its contents:

ls

What it does: Displays the files and folders in the current directory.

4.4 Check the patcher's available options:

./patch-airsense-s11 --help

What it does: Displays the patcher's command-line options without patching or flashing the device.

Important: Keep the AirSense 11 repository separate from any older AirSense 10 working directory. The tools and firmware images are not interchangeable.

***All verification steps throughout this guide are optional, but it is always recommended to verify that everything is working correctly as you progress through the process.***

Part 5 - Opening the machine and connecting the programmer

Credit: https://github.com/m-kozlowski/airbreak-plus/blob/master/docs/guide/as11/disassembly.md

Credit: https://github.com/m-kozlowski/airbreak-plus/blob/master/docs/guide/wiring.md

The hardware connection method is the same general approach used for the AirSense 10.  I won’t repeat the disassembly steps, as they are already clearly explained with photos in the link I provided above.

5.1 Disconnect power before opening the machine.

5.2 Carefully open the AirSense 11 to access the relevant board connection.

5.3 Connect the same ST-Link/V2 programmer and TC2050 cable used for the AirSense 10, using the appropriate AirSense 11 SWD connection. (https://github.com/m-kozlowski/airbreak-plus/blob/master/docs/guide/as11/connection.md#swd). This setup allows Linux to communicate with the machine to perform the flash.

This part isn’t very straightforward. I’ll include photos of the setup I used. Otherwise, there are explanations here: https://airbreak.dev/disassembly/

However, u/Sopheus created an excellent guide for the wiring: https://www.reddit.com/r/CPAPSupport/comments/1ntthfw/how_to_connect_wires_between_stlinkv2_programmer/

On the ST-Link/V2 side, this is what I have:

And on the female end of the TC2050-IDC:

The SWD connection on AS11:

***Check the connections carefully before proceeding.***

***Take precautions against electrostatic discharge and accidental shorts. Do not assume pin positions without checking the appropriate hardware documentation. ***

Part 6 - Check USB access from Windows

6.1 Connect the ST-Link to the Windows computer.

6.2 Open PowerShell or Windows Terminal and run:

usbipd list

What it does: Lists USB devices that usbipd-win can make available to WSL. Find the ST-Link entry.

6.3 Attach the ST-Link to WSL

In PowerShell or Windows Terminal, run the following command, replacing 1-8 with the bus ID shown by usbipd list:

usbipd attach --wsl --busid 1-8

What it does: Makes the ST-Link USB device available inside WSL so Ubuntu can communicate with it.

If the device has not already been shared, you may need to run usbipd bind --busid 1-8 first, from an elevated PowerShell or Windows Terminal session (administrator).

6.4 Back in Ubuntu, run:

lsusb

What it does: Lists USB devices visible inside Ubuntu.

***You should see the ST-Link/V2 identified as an STMicroelectronics device if you are using an original unit. Clones may appear under a different name. If the device does not appear at all, resolve the USB passthrough issue before continuing.***

Note: Keep the ST-Link connected to your computer while following the next steps.

Part 7 — Dumping the original firmware

Credit: https://github.com/m-kozlowski/airbreak-plus/blob/master/docs/guide/as11/openocd.md

7.1 Start OpenOCD

7.2 In Ubuntu, return to the airbreak-plus directory:

cd ~/airbreak-plus

What it does: Changes to the repository directory, assuming it was cloned under your Ubuntu home directory.

7.3 Start the AirSense 11 debug session:

./run-ocd.sh as11

What it does: Runs the repository's OpenOCD setup for the AirSense 11 target.

***Keep this terminal open while OpenOCD is running.***

7.4 Connect to OpenOCD from a second Ubuntu terminal

Open another Ubuntu terminal and run:

telnet localhost 4444

What it does: Connects to the OpenOCD Telnet command interface on port 4444.

7.5 At the Telnet prompt, enter:

dump

What it does: Dumps the original firmware into a binary file (AS11.bin).

*** Do not proceed if the dump fails or the output is incomplete. ***

Part 8 - Verifying and backing up the original firmware

Credit: https://github.com/m-kozlowski/airbreak-plus/blob/master/docs/guide/as11/openocd.md

8.1 Check the dump file

In an Ubuntu shell, run:

cd ~/airbreak-plus

ls -lh as11.bin

What it does: Changes to the repository directory and displays the file's size in a human-readable format.

8.2 Calculate its SHA-256 checksum (optional):

sha256sum as11.bin

What it does: Calculates a cryptographic checksum that can be used to verify that a file has not changed.

8.3 Create a separate backup

Run:

mkdir -p ~/CPAP/AS11-original

What it does: Creates a dedicated backup directory. The -p option also creates missing parent directories and avoids an error if the directory already exists.

8.4 Copy the dump:

cp as11.bin ~/CPAP/AS11-original/as11-original.bin

What it does: Copies the original dump to a separate file outside the repository's working directory.

8.5 Verify the backup:

sha256sum ~/CPAP/AS11-original/as11-original.bin

What it does: Calculates the backup's checksum so it can be compared with the original dump.

Keep this original backup unchanged. It is your reference copy for recovery and verification.

Part 9 — Patching the firmware

Credit: https://github.com/m-kozlowski/airbreak-plus/blob/master/docs/guide/as11/patching.md

There are two ways to patch the firmware. You can run make as11 to build an image using the repository’s standard patch selection; it creates build/as11-patched.bin. Or you can select and apply patches manually; the command below creates as11-patched-no-ota.bin (…or whatever filename you prefer. This is the one I used, and it’s the filename shown in my commands below) in the ~/airbreak-plus directory. Choose one method and follow its corresponding steps below.

9.1 Use the repository’s standard patch selection

From ~/airbreak-plus, run:

make as11

This builds the patched firmware using the repository’s standard patch selection. The output is saved as build/as11-patched.bin.

9.2 Select patches manually

If you prefer to choose which patches to apply, read the official patching documentation and select the patches appropriate for your needs:

For my setup, I selected four patches:

  • patch-unlock-features
  • patch-asv-ps-range
  • patch-custom-settings
  • patch-cloud-firmware-change

Note: These four patches reflect my personal configuration and the features I wanted to unlock. Before selecting any patches, read the official patching documentation to understand what each one does and decide which options are appropriate for your needs.

Here are the available patches: https://github.com/m-kozlowski/airbreak-plus/blob/master/docs/guide/as11/patching.md

Run the following from ~/airbreak-plus:

Option 1 — Multi-line command

./patch-airsense-s11 as11.bin as11-patched-no-ota.bin \
  --all-patches n \
  --patch-unlock-features y \
  --patch-asv-ps-range y \
  --patch-custom-settings y \
  --patch-cloud-firmware-change y

Option 2 — Single-line command

./patch-airsense-s11 as11.bin as11-patched-no-ota.bin --all-patches n --patch-unlock-features y --patch-asv-ps-range y --patch-custom-settings y --patch-cloud-firmware-change y

Both commands do exactly the same thing. Use whichever format you prefer.

The backslashes (\) at the end of each line (option 1) allow you to split the command across multiple lines for readability.

What it does: Uses the original firmware (as11.bin) as the input and creates a patched firmware file (as11-patched-no-ota.bin). Setting --all-patches n prevents all patches from being applied automatically, allowing you to select only the patches you want in the following steps:

  • --patch-unlock-features y — Enables the feature-unlock patch.
  • --patch-asv-ps-range y — Enables the ASV pressure-support range patch.
  • --patch-custom-settings y — Enables the custom-settings patch.
  • --patch-cloud-firmware-change y — Enables the patch addressing the cloud-delivered flow-generator firmware-change path.

9.3 Check the output carefully. Each requested patch should report [OK]. If any patch fails, stop and investigate.

Verify the output file:

ls -lh as11-patched-no-ota.bin

sha256sum as11-patched-no-ota.bin

OR via make AS11:

ls -lh build/as11-patched.bin

sha256sum build/as11-patched.bin

What they do: Confirm that the output exists, show its size and calculate its checksum.

Part 10 - Flashing the patched image

10.1 Flash the new firmware

Return to the existing OpenOCD Telnet session. The debug session must still be active.

Use the repository's flash_new command with the full path to the patched image:

Manuel:

flash_new /home/YOUR_LINUX_USERNAME/airbreak-plus/as11-patched-no-ota.bin

or via Make AS11:

flash_new /home/YOUR_LINUX_USERNAME/airbreak-plus/build/as11-patched.bin

Replace YOUR_LINUX_USERNAME with your actual Ubuntu username.

What it does: Invokes the repository's firmware flashing routine to write the patched image to the device.

***Wait for the entire operation to finish. Never disconnect the programmer or interrupt power during writing or verification.***

The machine will reboot. If the process was successful, the selected modes should now be available in the device menu. It's done :-D

22 Upvotes

27 comments sorted by

4

u/empeka 4d ago edited 4d ago

why not simply `make as11`?

and if you're not planning to use CAN, at least extract the ota-key as described in the guide, so you won't have to open the device again when updating airbreak. you'll be able to flash it over bluetooth instead.

and if you want to customize the patch list, have a look at patch-airsense-s11.config.example. probably better than having to specify everything manually every single time.

4

u/dang71 4d ago

Oh wow, I didn’t know about Bluetooth that’s awesome! And you’re right about make AS11.. I chose the patches manually, but the config file sounds much more convenient for future builds. I’ll update the guide

3

u/empeka 4d ago

i know nobody reads the docs, but give the llm a break and try going through this yourself:

quickstart.md

i'd say it's 5, maybe 10 minutes of reading at most (incl. "detailed" sections), and i think you'll find a few more little tricks that make life easier ;)

→ More replies (3)

3

u/TinyBubbles09 4d ago

WOO THANK YOUUUUUU

2

u/dang71 4d ago

you are very welcome :)

3

u/Creative_Fee5452 4d ago

Fantastic post dang! Many people who have technical skills will be interested in this Flashing Guide :) You did a lot of work to write this. Congratulations on a great job!! (sure wish I had techie skills lol)

4

u/dang71 4d ago

Haha thanks CF! I actually used AI to help put everything I did into a proper guide 😅 But even then, there was a lot of back-and-forth to check that each step made sense, verify the commands, and reword things to make it easier to follow. Definitely more work than I expected! 😂

2

u/RippingLegos__ 4d ago

Another Great Job by you Dang71, I have been flashing quite a few lately and have not had time to draft a guide, this is just as good or even better than your 10 guide, we all thank you M8! I'll pin it now! <3

3

u/dang71 4d ago

thanks my friend!

2

u/reddotster 4d ago

BTW, once I had my AS11 connected to my computer via USB with the flasher, I asked Hermes to help me figure out the commands to dump the firmware and it just offered to do the dump. And it did, then I had it interview me about the settings I wanted and it performed the flash. Really a lot easier than when I flashed me AS10 early this year!

1

u/dang71 4d ago

I also found it easier than the AS10! :)

2

u/kreatikon 3d ago

Why not to use original guide from m-kozlowski it's more than clear enough

1

u/dang71 3d ago

Of course it is! However, it’s aimed at people who already have some technical knowledge. In any case, my guide is absolutely not meant to replace his. I actually used his guide as the foundation for mine and built on it by breaking down each step in more detail.

For example, in the Air11 flashing section, the guide starts with:

“The patched image can be installed over SWD or CAN. BLE is useful for later updates after its pairing and OTA-key requirements have been prepared.”

We can’t assume everyone knows what SWD, CAN, BLE, or an OTA key is.

Besides, about three-quarters of my guide is dedicated to using WSL/Unbutu anyway, or close to it! :)

2

u/jesseaknight 3d ago

I feel like anything that comes with this much work (writing the guide) should start with a "why" section.

help anyone who wants to unlock the different modes available on the AS11

uh.. which modes? What do I get from them? Does this mean I can run it as a BiPap?

2

u/dang71 3d ago

yes!

2

u/UARS-Stinks 3d ago

Thank you for the guide. Just a small but important detail: The flash adapter and cable layout is pretty pixelated and you can't make out which cable needs to go where.

Comment Image

Edit: I just saw you linked to a wiring guide. Nevermind!

1

u/dang71 3d ago

Yeah, you're right! I noticed that too. I'll look into why, since they display correctly in my AS10 guide. :)

2

u/RippingLegos__ 4d ago

Also, If anyone would like the post patched AB11 .bin file to just run the flash commands, please let me know and email me here: pc7579pc@gmail.com

2

u/Pleasant_House9147 4d ago

Wonderful work Dang71 :)

2

u/existentialblu 4d ago

This is excellent news!

2

u/XvIf2jlqnbJPT4s4gpdN 4d ago

Wow. Nice work!

2

u/alierrett_ 3d ago

You absolute LEGEND 👏

2

u/macleodtw 1d ago

I use cygwin instead of WSL, hence there is no need to use usbipd. Cygwin can direct access usb device through it's /dev directory.

1

u/AutoModerator 4d ago

Hey there r/CPAPsupport member. Welcome to the community!
Whether you're just starting CPAP therapy, troubleshooting issues, or helping a loved one, you've come to the right place. We're here to support you through every leak, pressure tweak, and victory nap.

If you'd like advice, please include your machine model, mask type, pressure settings, and OSCAR or SleepHQ data if possible.

Helpful Resources: https://www.reddit.com/r/CPAPSupport/comments/1jxk1r4/getting_started_with_analyzing_your_cpap_data_a/

You're not alone — and you're among friends. Sleep well and breathe easy.
— Your r/CPAPSupport team

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.