File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,9 @@ static void handleUpdate(twai_message_t *rxframe) {
228
228
updstate = SEND_SIZE;
229
229
DBG_OUTPUT_PORT.printf (" Sending ID %" PRIu32 " \r\n " , *(uint32_t *)tx_frame.data );
230
230
twai_transmit (&tx_frame, pdMS_TO_TICKS (10 ));
231
+
232
+ if (rxframe->data [1 ] < 1 ) // boot loader with timing quirk, wait 100 ms
233
+ delay (100 );
231
234
}
232
235
break ;
233
236
case SEND_SIZE:
@@ -317,14 +320,15 @@ static void handleUpdate(twai_message_t *rxframe) {
317
320
// Do not exit this state
318
321
break ;
319
322
}
320
-
321
323
}
322
324
323
325
int StartUpdate (String fileName) {
324
326
updateFile = SPIFFS.open (fileName, " r" );
325
327
// Reset host processor
326
328
setValueSdo (SDO_INDEX_COMMANDS, SDO_CMD_RESET, 1U );
327
329
updstate = SEND_MAGIC;
330
+ currentPage = 0 ;
331
+ DBG_OUTPUT_PORT.println (" Starting Update" );
328
332
329
333
return (updateFile.size () + PAGE_SIZE_BYTES - 1 ) / PAGE_SIZE_BYTES;
330
334
}
You can’t perform that action at this time.
0 commit comments