Skip to content

Commit c6371d7

Browse files
authored
Merge pull request #4624 from paroga/usb_dfu_reset
embassy-usb-dfu: fix: do net reset in GetStatus request
2 parents 90f6497 + 12cb85c commit c6371d7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

embassy-usb-dfu/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
<!-- next-header -->
99
## Unreleased - ReleaseDate
1010

11+
- changed: Do not reset in the GetStatus request
1112
- Allow enabling the `application` and `dfu` feature at the same time
1213

1314
## 0.2.0 - 2025-08-27

embassy-usb-dfu/src/dfu.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl<'d, DFU: NorFlash, STATE: NorFlash, RST: Reset, const BLOCK_SIZE: usize> Ha
183183
Ok(Request::GetStatus) => {
184184
match self.state {
185185
State::DlSync => self.state = State::Download,
186-
State::ManifestSync => self.reset.sys_reset(),
186+
State::ManifestSync => self.state = State::ManifestWaitReset,
187187
_ => {}
188188
}
189189

@@ -202,6 +202,12 @@ impl<'d, DFU: NorFlash, STATE: NorFlash, RST: Reset, const BLOCK_SIZE: usize> Ha
202202
_ => None,
203203
}
204204
}
205+
206+
fn reset(&mut self) {
207+
if matches!(self.state, State::ManifestSync | State::ManifestWaitReset) {
208+
self.reset.sys_reset()
209+
}
210+
}
205211
}
206212

207213
/// An implementation of the USB DFU 1.1 protocol

0 commit comments

Comments
 (0)