Skip to content

feat(esptool): Upgrade to esptool v5 #11433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: release/v3.3.x
Choose a base branch
from

Conversation

lucasssvaz
Copy link
Collaborator

This pull request includes updates to the ESP32 platform files, focusing on upgrading the esptool_py tool version, improving argument consistency, and enhancing functionality for binary merging and flashing. The changes ensure compatibility with the latest tool version and refine command-line arguments for clarity and correctness.

Version Upgrade and Compatibility Updates:

  • Updated esptool_py version from 4.9.dev3 to 5.0.dev1 in package/package_esp32_index.template.json, including URLs, checksums, and file sizes for various system architectures.

Command Argument Improvements:

  • Fixed inconsistencies in argument names by replacing underscores (_) with hyphens (-) for options like --flash_mode, --flash_freq, and --flash_size in platform.txt.

Binary Merging Enhancements:

  • Improved the binary merge command by replacing merge_bin with merge-bin and introducing the --pad-to-size argument for better handling of flash size padding in platform.txt.

@lucasssvaz lucasssvaz self-assigned this Jun 4, 2025
@lucasssvaz lucasssvaz added the Area: Tools & Build System Issue is related to tools and/or the build system label Jun 4, 2025
Copy link
Contributor

github-actions bot commented Jun 4, 2025

Warnings
⚠️
	The **target branch** for this Pull Request **must be the default branch** of the project (`master`).

	If you would like to add this feature to a different branch, please state this in the PR description and we will consider it.

👋 Hello lucasssvaz, we appreciate your contribution to this project!


📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 2418fdd

Copilot

This comment was marked as outdated.

Copy link
Contributor

github-actions bot commented Jun 4, 2025

Test Results

 76 files   76 suites   12m 44s ⏱️
 38 tests  38 ✅ 0 💤 0 ❌
241 runs  241 ✅ 0 💤 0 ❌

Results for commit 2418fdd.

♻️ This comment has been updated with latest results.

@lucasssvaz lucasssvaz added the Status: In Progress ⚠️ Issue is in progress label Jun 4, 2025
@lucasssvaz lucasssvaz marked this pull request as draft June 4, 2025 12:33
@lucasssvaz lucasssvaz marked this pull request as ready for review June 4, 2025 18:00
@lucasssvaz lucasssvaz requested a review from me-no-dev as a code owner June 4, 2025 18:00
@lucasssvaz lucasssvaz requested a review from P-R-O-C-H-Y June 4, 2025 18:00
@lucasssvaz lucasssvaz added Status: Review needed Issue or PR is awaiting review and removed Status: In Progress ⚠️ Issue is in progress labels Jun 4, 2025
@lucasssvaz lucasssvaz requested a review from Copilot June 4, 2025 18:24
Copilot

This comment was marked as outdated.

# Check version argument
if [[ $# -ne 3 ]]; then
echo "Usage: $0 <version> <base_folder> <json_path>"
echo "Example: $0 5.0.dev1 /tmp/esptool /tmp/esptool-5.0.dev1.json"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain the arguments a bit. It is not clear what each one is. Is base_folder the output? Where does json_path come from?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@me-no-dev I've reworked the script to be way more flexible and useful. PTAL if there is anything missing.

@lucasssvaz lucasssvaz requested review from Copilot and me-no-dev June 5, 2025 11:46
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the ESP32 platform’s esptool_py tool to version 5.0.dev1, harmonizes command-line options to use hyphens, and enhances the binary merge step.

  • Bump esptool_py version and update URLs, checksums, and sizes in the package index JSON
  • Standardize flags in platform.txt (use hyphens, add --pad-to-size, rename merge_binmerge-bin)
  • Add a helper script (update_esptool.py) to automate JSON updates for new esptool releases

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
platform.txt Switched underscores to hyphens on esptool flags; replaced merge_bin with merge-bin and introduced --pad-to-size
package/package_esp32_index.template.json Updated esptool_py version to 5.0.dev1; refreshed URLs, checksums, and sizes for each host
.github/scripts/update_esptool.py New script to repack esptool artifacts and update the JSON metadata
Comments suppressed due to low confidence (2)

.github/scripts/update_esptool.py:42

  • [nitpick] Add a docstring explaining the purpose, parameters, and return value of this helper function to improve readability and maintenance.
def compute_sha256(filepath):

.github/scripts/update_esptool.py:1

  • Consider adding unit or integration tests for this script (e.g., for JSON update logic and archive creation) to ensure future changes remain correct.
#!/usr/bin/env python3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Tools & Build System Issue is related to tools and/or the build system Status: Review needed Issue or PR is awaiting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants