Skip to content

Commit f350c8a

Browse files
Lower transfer size to 1024 and add debug logging (v1.0.7)
1 parent ace1df7 commit f350c8a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

web-flasher/dfu.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class DFUDevice {
5454
constructor() {
5555
this.device = null;
5656
this.interfaceNumber = 0;
57-
this.transferSize = 2048; // STM32 typical transfer size
57+
this.transferSize = 1024; // Reduced to 1024 for better stability
5858
this.startAddress = 0x08000000; // STM32H750 Flash start address
5959
}
6060

@@ -180,6 +180,12 @@ class DFUDevice {
180180

181181
// Wait for poll timeout or default minimum to prevent tight loop
182182
const waitTime = status.pollTimeout > 0 ? status.pollTimeout : 10;
183+
184+
// Debug logging for long operations (like erase)
185+
if (attempts % 10 === 0) {
186+
console.log(`Waiting for ready... State: ${status.state}, Status: ${status.status}, Wait: ${waitTime}ms, Attempt: ${attempts}`);
187+
}
188+
183189
await new Promise(resolve => setTimeout(resolve, waitTime));
184190

185191
status = await this.getStatus();

web-flasher/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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.6</span>
128+
<span class="version">Web Flasher v1.0.7</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.6"></script>
135-
<script type="module" src="flasher.js?v=1.0.6"></script>
134+
<script type="module" src="dfu.js?v=1.0.7"></script>
135+
<script type="module" src="flasher.js?v=1.0.7"></script>
136136
</body>
137137
</html>

0 commit comments

Comments
 (0)