Skip to content

resmed_flash.py#22

Open
m-kozlowski wants to merge 8 commits intoAsmageddon:masterfrom
m-kozlowski:uart_flasher_pr
Open

resmed_flash.py#22
m-kozlowski wants to merge 8 commits intoAsmageddon:masterfrom
m-kozlowski:uart_flasher_pr

Conversation

@m-kozlowski
Copy link

UART-only flash tool for ResMed AirSense 10.
Enters bootloader via RES + BID, erases and writes flash blocks (CCX/CDX/CMX/BLX), with auto baud negotiation.
Supports full 1MB image or individual block flashing, CRC16 validation with optional fix, and auto-detection by file size.

UART-only flash tool for ResMed AirSense 10.
Enters bootloader via RES + BID, erases and writes flash blocks (CCX/CDX/CMX/BLX), with auto baud negotiation.
Supports full 1MB image or individual block flashing, CRC16 validation with optional fix, and auto-detection by file size.
@m-kozlowski m-kozlowski marked this pull request as draft February 24, 2026 09:31
@m-kozlowski
Copy link
Author

Hit some issues today with switching to bootloader (timing?). need to investigate...

@m-kozlowski
Copy link
Author

setting #BLL = 0001 triggers a fast restart without reinitializing peripherals.
This minor change allowed me to communicate with the bootloader correctly on every attempt.
The only exception is the value BKP6R = 0x1B183CA7, which forces the bootloader to be skipped and transfers execution to the code in the CDX block (0x080fc1ac — init_peripherals_and_os).

@m-kozlowski m-kozlowski marked this pull request as ready for review February 24, 2026 16:34
@m-kozlowski
Copy link
Author

m-kozlowski commented Feb 24, 2026

Ahh.. there's one very important caveat:
current patch_tamper implementation forces bootloader to skip immediately to app code without even attemptin uart communication, so the patcher will not work for airbreak users running current version.
(Though it will work on vanilla firmware and airbreak with fixed CRC and tamper patch disabled.)

I will try to rework patch_tamper later, in separate PR

- multiple blocks can be selected by passing more --block args
- block alias 'all' also includes bootloader
- sort and deduplicate specified blocks
Sending completion frame after single block causes reboot, so we need to
reenter bootloader. There /should/ be a way to do this in a single pass,
but it requires further reverse engineering of the protocol.
- support alternative block layout
- cross flashing safety check
- sanity checks when trying to flash blocks not including bootloader
  that does not match currently running image layout
- support only SX577-0200 by default as the SX585 platform
  is currently a minefield.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant