Skip to content

add s3 h2 support for USB_RAM_BLOCK - #259

Open
brianignacio5 wants to merge 1 commit into
mainfrom
bugfix/usbRamBlockForFlashWriteSize
Open

add s3 h2 support for USB_RAM_BLOCK#259
brianignacio5 wants to merge 1 commit into
mainfrom
bugfix/usbRamBlockForFlashWriteSize

Conversation

@brianignacio5

Copy link
Copy Markdown
Collaborator

Description

Fix #255

This pull request introduces improved detection and handling of Espressif USB-Serial/JTAG and USB-OTG interfaces, with changes to both the core loader logic and chip-specific ROM classes. The main goal is to better distinguish between connection types (USB-Serial/JTAG vs. USB-OTG), adapt flash write sizes accordingly, and expose relevant USB identifiers for external use.

USB Interface Detection and Handling:

  • Added usesUsbJtagSerial() and usesUsbOtg() methods to ESPLoader to reliably detect if the connection uses Espressif USB-Serial/JTAG or USB-OTG, using both USB VID/PID and chip-specific helpers for fallback.
  • When running the stub (runStub()), the loader now applies a USB-specific flash write size limit if USB-OTG is detected, matching esptool.py's buffer limits. [1] [2]
  • The ROM base class and specific chip classes (ESP32S3ROM, ESP32H2ROM) now include helper methods (usesUsbJtagSerial, usesUsbOtg, usingUsbOtg) for fallback detection via hardware registers. [1] [2] [3] [4]

USB VID/PID Constants and Transport Enhancements:

  • Defined and exported constants for Espressif USB vendor ID (ESPRESSIF_VID) and USB-Serial/JTAG product ID (USB_JTAG_SERIAL_PID) for use throughout the codebase and by consumers. [1] [2] [3] [4]
  • Added getVid() method to the Transport class to retrieve the USB vendor ID from the connected device.

These changes make USB connection type detection more robust and allow the loader to optimize behavior based on the actual hardware interface in use.

Related

Replace #257 with an approach closer to esptool.py

Testing

  • ESP32-S3 native USB (USB-Serial/JTAG), compressed 1.3 MB write previously failing at seq 42

Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@brianignacio5 brianignacio5 added this to the v0.7.0 milestone Aug 20, 2026
@brianignacio5 brianignacio5 self-assigned this Aug 20, 2026
@github-actions

Copy link
Copy Markdown

Download the artifacts for this pull request:

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.

Compressed write_flash fails deterministically mid-image on ESP32-S3 (status 201 at ~75%)

1 participant