Add dev bootloader chip erase#1999
Open
NickeZ wants to merge 1 commit into
Open
Conversation
Add a development-only bootloader command that requests a chip erase after the USB response has been sent. Expose the command through the Python bootloader client and defer execution until outgoing transport writes are idle.
f11f7de to
17899b0
Compare
benma
reviewed
Jun 27, 2026
| // Reset and halt the device | ||
| r | ||
|
|
||
| // Temporarily disable bootloader protection before flashing. |
Collaborator
There was a problem hiding this comment.
Why? Doesn't the chip erase bootprot too?
Collaborator
Author
There was a problem hiding this comment.
No, the user row is not reset by chip erase.
| da14531_handler(frame, uart_write_queue); | ||
| } | ||
| if (!hww_data && rust_bytequeue_num(uart_write_queue) == 0) { | ||
| bootloader_process_pending_action(); |
Collaborator
There was a problem hiding this comment.
Why all the effort to wait until the response is done and not do it right away when handling OP_CHIP_ERASE? We do it too for the hww reset and reboot API calls in the firmware - the client simply knows to not expect a response in these cases.
Collaborator
Author
There was a problem hiding this comment.
Right, we are pretty unique in having a request/reponse protocol and allow some requests to not have responses, so I totally forgot about it.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add a development-only bootloader command that requests a chip erase after the USB response has been sent.
Expose the command through the Python bootloader client and defer execution until outgoing transport writes are idle.
It was useful to restore debug access during experiments with bootloader.