File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -259,6 +259,21 @@ class DFUDevice {
259259 await this . erase ( this . startAddress ) ;
260260 progressCallback ( { stage : 'erase' , percent : 10 , message : 'Flash erased' } ) ;
261261
262+ // Wait a moment for the device to stabilize after mass erase
263+ await new Promise ( resolve => setTimeout ( resolve , 500 ) ) ;
264+
265+ // Check status to ensure we are still connected and ready
266+ try {
267+ const status = await this . getStatus ( ) ;
268+ if ( status . state === DFU_STATE . DFU_ERROR ) {
269+ await this . clearStatus ( ) ;
270+ }
271+ } catch ( e ) {
272+ console . warn ( 'Status check failed between erase and write:' , e ) ;
273+ }
274+
275+ progressCallback ( { stage : 'write' , percent : 10 , message : 'Preparing to write...' } ) ;
276+
262277 // Set address again for writing
263278 await this . setAddress ( this . startAddress ) ;
264279
Original file line number Diff line number Diff line change @@ -125,13 +125,13 @@ <h4>Activity Log</h4>
125125 < p > Built with ❤️ using WebUSB API |
126126 < a href ="https://github.com/willbearfruits/KarplusStrongMachine " target ="_blank "> View on GitHub</ a > |
127127 < a href ="README.md "> Documentation</ a > |
128- < span class ="version "> Web Flasher v1.0.4 </ span >
128+ < span class ="version "> Web Flasher v1.0.5 </ span >
129129 </ p >
130130 < p class ="small "> Requires Chrome/Chromium browser with WebUSB support</ p >
131131 </ footer >
132132 </ div >
133133
134- < script type ="module " src ="dfu.js?v=1.0.3 "> </ script >
135- < script type ="module " src ="flasher.js?v=1.0.3 "> </ script >
134+ < script type ="module " src ="dfu.js?v=1.0.5 "> </ script >
135+ < script type ="module " src ="flasher.js?v=1.0.5 "> </ script >
136136</ body >
137137</ html >
You can’t perform that action at this time.
0 commit comments