@@ -505,23 +505,48 @@ void menuDebugHardware()
505
505
}
506
506
else if (incoming == 13 && present.gnss_um980 )
507
507
{
508
- systemPrintln (" Press ! to exit" );
508
+ // Stop all UART tasks
509
+ tasksStopGnssUart ();
510
+
511
+ systemPrintln (" Entering UM980 direct connect at 115200bps for firmware update and configuration. Use "
512
+ " UPrecise to update "
513
+ " the firmware. Power cycle RTK Torch to "
514
+ " return to normal operation." );
515
+
516
+ // Make sure ESP-UART1 is connected to UM980
517
+ digitalWrite (pin_muxA, LOW);
518
+
519
+ // UPrecise needs to query the device before entering bootload mode
520
+ // Wait for UPrecise to send bootloader trigger (character T followed by character @) before resetting UM980
521
+ bool inBootMode = false ;
509
522
510
523
// Echo everything to/from UM980
511
524
while (1 )
512
525
{
513
- while (serialGNSS->available ())
526
+ // Data coming from UM980 to external USB
527
+ if (serialGNSS->available ())
514
528
systemWrite (serialGNSS->read ());
515
529
530
+ // Data coming from external USB to UM980
516
531
if (systemAvailable ())
517
532
{
518
533
byte incoming = systemRead ();
519
- if (incoming == ' !' )
520
- break ;
521
- else if (incoming == ' 1' )
522
- serialGNSS->println (" mask" );
523
- else if (incoming == ' 2' )
524
- serialGNSS->println (" config" );
534
+ serialGNSS->write (incoming);
535
+
536
+ // Detect bootload sequence
537
+ if (inBootMode == false && incoming == ' T' )
538
+ {
539
+ byte nextIncoming = Serial.peek ();
540
+ if (nextIncoming == ' @' )
541
+ {
542
+ // Reset UM980
543
+ um980Reset ();
544
+ delay (25 );
545
+ um980Boot ();
546
+
547
+ inBootMode = true ;
548
+ }
549
+ }
525
550
}
526
551
}
527
552
}
0 commit comments