-
-
Notifications
You must be signed in to change notification settings - Fork 781
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
Feature: Flash blank check #1971
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has some good ideas and we like the concept. The review items are mostly all about code style and clarity.
8c8db53
to
aeb352c
Compare
aeb352c
to
c1b2c0a
Compare
c1b2c0a
to
c3fbf5b
Compare
At a quick glance, this is looking really good now. Because we're in a feature freeze for v2.0.0, we will defer this PR to the start of the v2.1 cycle as this introduces new commands and such. We'll give it a proper re-review before then though and aim to merge it at the start of that cycle. |
* Reuse flash write buffer for block reads * Compare against erased value and skip to next sector on mismatch * Indicate progress via tc_printf() to gdb_if.c or BMDA stdout
When did v2.0.0 feature freeze begin? I had implemented and tested this more than two months ago, October 18, posted the PR 19th, and answered/applied all review items October 24th same day I saw them. CI size-diff shows about +340 bytes and I see same size increase for The single new command is in remote-monitor (and BMDA), is not debug-related (does not intend to affect execution), and responds in a similar fashion to Note that I only mention but not actually implement any interconnections with flash Can you then please give an ETA for when v2.1 may happen, or at least post-v2.0.0? In 2026? That gives plenty time for mentioned related-changes to add / build upon this / test in synergy. |
c3fbf5b
to
d5e8780
Compare
Start of December, which is why we've been avoiding merging anything that's not a bugfix or already agreed on by that point.
v2.0 final should be out in the next month or two, so.. not more than that. |
Detailed description
(gdb) x/16zw 0x08004000
etc.)Many alternative gdbservers already implement a similar mechanism -- openocd flash, pyocd, Segger JLinkGDBServer, etc.
I opted to reuse the whatever flash write buffer is allocated in BMP heap for fast block reads (like bmd_crc32). The memcmp could be optimized to run in 4 bytes per comparison, but for a quick PoC 1 byte is enough, I get I/O bounded on swdptap.c (100-150 KiB/s for FS probes).
Tested on BMDA for dual blackpills, as usual, over JTAG transport, example output is
Notice how it walks the singly linked flash bank list backwards, but walks eraseblocks forwards. I erased the BMF from DUT, keeping only the BMD bootloader on it (in first 16 KiB). Output in GDB is similar, but there are progress dots printed before some lines.
Needs testing on smaller probes. Future usage could be skipping vFlashErase-triggered erase delays if reading memory-mapped flash is faster than waiting on it to erase (break-even is different for genuine STM32 with true simultaneous mass-erase vs. The Compatibles which back it with some sequential slow QuadSPI-like flash). It could also have interesting interactions with mass-erase -> load (skips all slow sector erases and starts writing to empty flash immediately), eliminating some unresponsiveness.
Your checklist for this pull request
Closing issues