Skip to content

Fix/flash erase area#70

Merged
erhankur merged 4 commits intomasterfrom
fix/flash_erase_area
Feb 23, 2026
Merged

Fix/flash erase area#70
erhankur merged 4 commits intomasterfrom
fix/flash_erase_area

Conversation

@erhankur
Copy link
Collaborator

  • When adding a public flash API, it must support large flash mode. stub_lib_flash_erase_sector and stub_lib_flash_erase_block did not support large mode, so I removed them.
  • stub_lib_flash_erase_area is now implemented using functions that support large flash mode.
  • And removed some unnecessary log prints and reduced log levels as verbose

@erhankur erhankur requested a review from Copilot February 22, 2026 13:40
@github-actions
Copy link

github-actions bot commented Feb 22, 2026

Messages
📖 You might consider squashing your 4 commits (simplifying branch history).

👋 Hello erhankur, we appreciate your contribution to 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.
- Addressing info messages (📖) is strongly recommended; they're less critical but valuable.
- 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 50c8f44

Copy link

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 pull request refactors the flash erase API to ensure all public functions support large flash mode (>16MB) using 4-byte addressing. The PR removes stub_lib_flash_erase_sector and stub_lib_flash_erase_block from the public API because they didn't support large flash mode, and reimplements stub_lib_flash_erase_area to use the existing stub_lib_flash_start_next_erase helper which properly handles both regular and large flash modes. Additionally, the PR reduces logging verbosity by converting TRACE-level logs to VERBOSE-level and removing some redundant log statements.

Changes:

  • Removed stub_lib_flash_erase_sector and stub_lib_flash_erase_block from public and internal APIs
  • Reimplemented stub_lib_flash_erase_area to support large flash mode using stub_lib_flash_start_next_erase
  • Reduced log verbosity across all target implementations by converting STUB_LOG_TRACEF to STUB_LOGV and removing redundant logs

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
include/esp-stub-lib/flash.h Removed public API declarations for stub_lib_flash_erase_sector and stub_lib_flash_erase_block
src/flash.c Reimplemented stub_lib_flash_erase_area with large flash support, reduced log verbosity, removed old erase functions, increased severity of unknown flash ID warning
src/target/base/include/target/flash.h Removed internal API declarations for sector/block/area erase functions
src/target/common/src/flash.c Removed common implementations of sector/block/area erase functions and redundant trace logs
src/target/esp8266/src/flash.c Converted STUB_LOG_TRACEF to STUB_LOGV for erase operations, removed redundant write result log
src/target/esp32/src/flash.c Converted STUB_LOG_TRACEF to STUB_LOGV for erase operations
src/target/esp32s2/src/flash.c Converted STUB_LOG_TRACEF to STUB_LOGV for erase operations
src/target/esp32s3/src/flash.c Converted STUB_LOG_TRACEF to STUB_LOGV for erase operations, increased octal mode log from debug to info
src/target/esp32c2/src/flash.c Converted STUB_LOG_TRACEF to STUB_LOGV for erase operations
src/target/esp32c3/src/flash.c Converted STUB_LOG_TRACEF to STUB_LOGV for erase operations
src/target/esp32c5/src/flash.c Converted STUB_LOG_TRACEF to STUB_LOGV for erase operations
src/target/esp32c6/src/flash.c Converted STUB_LOG_TRACEF to STUB_LOGV for erase operations
src/target/esp32c61/src/flash.c Converted STUB_LOG_TRACEF to STUB_LOGV for erase operations
src/target/esp32h2/src/flash.c Converted STUB_LOG_TRACEF to STUB_LOGV for erase operations
src/target/esp32h4/src/flash.c Converted STUB_LOG_TRACEF to STUB_LOGV for erase operations
src/target/esp32h21/src/flash.c Converted STUB_LOG_TRACEF to STUB_LOGV for erase operations
src/target/esp32p4/src/flash.c Converted STUB_LOG_TRACEF to STUB_LOGV for erase operations
example/stub_main.c Updated example to remove usage of deprecated erase_sector and erase_block functions

@erhankur erhankur force-pushed the fix/flash_erase_area branch 2 times, most recently from 181c4c8 to e3aaade Compare February 22, 2026 13:53
@erhankur erhankur requested a review from Dzarda7 February 22, 2026 14:06
@Dzarda7
Copy link
Collaborator

Dzarda7 commented Feb 23, 2026

LGTM, thanks, nice update.

@erhankur erhankur force-pushed the fix/flash_erase_area branch from e3aaade to a3f6246 Compare February 23, 2026 22:02
@erhankur erhankur force-pushed the fix/flash_erase_area branch from a3f6246 to 50c8f44 Compare February 23, 2026 22:17
@Dzarda7
Copy link
Collaborator

Dzarda7 commented Feb 23, 2026

Feel free to merge this, esp8266 issue is in recently merged commits.

@erhankur erhankur merged commit 1404e36 into master Feb 23, 2026
30 checks passed
@erhankur erhankur deleted the fix/flash_erase_area branch February 23, 2026 22:25
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.

3 participants