This repository was archived by the owner on Mar 7, 2026. It is now read-only.
Feature: add log message for flash_prepare() - #2098
Merged
dragonmux merged 1 commit intoJul 26, 2025
Merged
Conversation
ALTracer
force-pushed
the
feature/flash-prepare-log
branch
from
March 23, 2025 13:11
b92f286 to
c2b4652
Compare
ALTracer
force-pushed
the
feature/flash-prepare-log
branch
from
July 21, 2025 21:28
c2b4652 to
4c95b1c
Compare
dragonmux
approved these changes
Jul 26, 2025
dragonmux
left a comment
Member
There was a problem hiding this comment.
This LGTM, and we'll merge this once it's been rebased on main. There is one item we spotted, but we don't think it's a blocker - just a nice to have item to dot I's and cross T's.
Thank you for the contribution and helping improve the debugability of the Target Flash API!
ALTracer
force-pushed
the
feature/flash-prepare-log
branch
from
July 26, 2025 15:20
4c95b1c to
f7985cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detailed description
flash_prepare()functions of target drivers called transparently but, depending on specific flash controller, double unlocking (for erase, for write) may trigger potentially hard to detect errors.I've used a similar patch to confirm speed of
stlinkv3+STM32H743ZI reflashing operation with help oftiotimestamping onttyBmpTarg.There could be more such logging extracted from per-target functions into central target_flash.c API layer, but a broader refactoring requires more effort.
target_flash_erase()is logged,target_flash_write()isn't. I don't like how less readable this becomes, but this is the best place to log -- when all the conditions are passed but before the actual call (which may fail or hang or throw in future drivers). I could move the string array out of two branch scopes.C has no enum->string reflection. Not urgent for v2.0.
Your checklist for this pull request
Closing issues