Skip to content

Commit fc7283c

Browse files
committed
Modify SystemCheck for use during UART ZED firmware update
1 parent f3fd0fb commit fc7283c

File tree

3 files changed

+50
-33
lines changed

3 files changed

+50
-33
lines changed

Firmware/Test Sketches/System_Check/System_Check.ino

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,19 @@ void setup()
336336
oled.display();
337337
}
338338

339+
//Select port 0 on MUX so UART1 is connected to ZED if bootloading is needed
340+
if(pin_muxA >= 0)
341+
{
342+
pinMode(pin_muxA, OUTPUT);
343+
digitalWrite(pin_muxA, LOW);
344+
}
345+
if(pin_muxB >= 0)
346+
{
347+
pinMode(pin_muxB, OUTPUT);
348+
digitalWrite(pin_muxB, LOW);
349+
Serial.println("MUX should now be UART");
350+
}
351+
339352
menuSystem();
340353
}
341354

800 Bytes
Binary file not shown.

Firmware/Test Sketches/System_Check/menuSystem.ino

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -106,39 +106,6 @@ void menuSystem()
106106
Serial.print(macAddress);
107107
Serial.print(F("): "));
108108

109-
//Verify the ESP UART2 can communicate TX/RX to ZED UART1
110-
if (online.gnss == true)
111-
{
112-
if (zedUartPassed == false)
113-
{
114-
//stopUART2Tasks(); //Stop absoring ZED serial via task
115-
116-
theGNSS.setSerialRate(460800, COM_PORT_UART1); //Defaults to 460800 to maximize message output support
117-
serialGNSS.begin(460800); //UART2 on pins 16/17 for SPP. The ZED-F9P will be configured to output NMEA over its UART1 at the same rate.
118-
119-
SFE_UBLOX_GNSS myGNSS;
120-
if (myGNSS.begin(serialGNSS) == true) //begin() attempts 3 connections
121-
{
122-
zedUartPassed = true;
123-
Serial.print(F("Online"));
124-
}
125-
else
126-
Serial.print(F("Offline"));
127-
128-
theGNSS.setSerialRate(settings.dataPortBaud, COM_PORT_UART1); //Defaults to 460800 to maximize message output support
129-
serialGNSS.begin(settings.dataPortBaud); //UART2 on pins 16/17 for SPP. The ZED-F9P will be configured to output NMEA over its UART1 at the same rate.
130-
131-
//startUART2Tasks(); //Return to normal operation
132-
}
133-
else
134-
Serial.print(F("Online"));
135-
}
136-
else
137-
{
138-
Serial.print("Can't check (GNSS offline)");
139-
}
140-
Serial.println();
141-
142109
Serial.println(F("s) Scan I2C"));
143110
Serial.println(F("S) Verbose scan of I2C"));
144111
Serial.println(F("t) Toggle pin"));
@@ -298,3 +265,40 @@ void printCurrentConditions()
298265
Serial.println();
299266
}
300267
}
268+
269+
void testGNSS()
270+
{
271+
//The following ZED test blocks the usage of UART1 for bootloading.
272+
//Verify the ESP UART2 can communicate TX/RX to ZED UART1
273+
if (online.gnss == true)
274+
{
275+
if (zedUartPassed == false)
276+
{
277+
//stopUART2Tasks(); //Stop absoring ZED serial via task
278+
279+
theGNSS.setSerialRate(460800, COM_PORT_UART1); //Defaults to 460800 to maximize message output support
280+
serialGNSS.begin(460800); //UART2 on pins 16/17 for SPP. The ZED-F9P will be configured to output NMEA over its UART1 at the same rate.
281+
282+
SFE_UBLOX_GNSS myGNSS;
283+
if (myGNSS.begin(serialGNSS) == true) //begin() attempts 3 connections
284+
{
285+
zedUartPassed = true;
286+
Serial.print(F("Online"));
287+
}
288+
else
289+
Serial.print(F("Offline"));
290+
291+
theGNSS.setSerialRate(settings.dataPortBaud, COM_PORT_UART1); //Defaults to 460800 to maximize message output support
292+
serialGNSS.begin(settings.dataPortBaud); //UART2 on pins 16/17 for SPP. The ZED-F9P will be configured to output NMEA over its UART1 at the same rate.
293+
294+
//startUART2Tasks(); //Return to normal operation
295+
}
296+
else
297+
Serial.print(F("Online"));
298+
}
299+
else
300+
{
301+
Serial.print("Can't check (GNSS offline)");
302+
}
303+
Serial.println();
304+
}

0 commit comments

Comments
 (0)