Skip to content

Commit 7324b8a

Browse files
authored
Merge pull request #787 from sparkfun/release_candidate
Support ZED HPG firmware >= 1.51
2 parents d7716f3 + 1acf7eb commit 7324b8a

File tree

4 files changed

+633
-617
lines changed

4 files changed

+633
-617
lines changed

Diff for: .github/workflows/non-release-build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ jobs:
140140
cd Firmware/RTK_Surveyor/build/esp32.esp32.esp32/
141141
mkdir ${{ env.ARTIFACT }}
142142
mv RTK_Surveyor.ino.bin ${{ env.ARTIFACT }}
143+
mv RTK_Surveyor.ino.elf ${{ env.ARTIFACT }}
143144
144145
- name: Upload artifact directory to action - avoid double-zip
145146
uses: actions/upload-artifact@v3

Diff for: Firmware/RTK_Surveyor/Begin.ino

+27-13
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,15 @@ void beginGNSS()
807807
// Check the firmware version of the ZED-F9P. Based on Example21_ModuleInfo.
808808
if (theGNSS.getModuleInfo(1100) == true) // Try to get the module info
809809
{
810+
// Clear the module type. Default to PLATFORM_F9P below - if needed
811+
zedModuleType = 0;
812+
813+
// Determine if we have a ZED-F9P (Express/Facet) or an ZED-F9R (Express Plus/Facet Plus)
814+
if (strstr(theGNSS.getModuleName(), "ZED-F9P") != nullptr)
815+
zedModuleType = PLATFORM_F9P;
816+
else if (strstr(theGNSS.getModuleName(), "ZED-F9R") != nullptr)
817+
zedModuleType = PLATFORM_F9R;
818+
810819
// Reconstruct the firmware version
811820
snprintf(zedFirmwareVersion, sizeof(zedFirmwareVersion), "%s %d.%02d", theGNSS.getFirmwareType(),
812821
theGNSS.getFirmwareVersionHigh(), theGNSS.getFirmwareVersionLow());
@@ -815,13 +824,14 @@ void beginGNSS()
815824
zedFirmwareVersionInt = (theGNSS.getFirmwareVersionHigh() * 100) + theGNSS.getFirmwareVersionLow();
816825

817826
// Check if this is known firmware
818-
//"1.20" - Mostly for F9R HPS 1.20, but also F9P HPG v1.20
819-
//"1.21" - F9R HPS v1.21
820-
//"1.30" - ZED-F9P (HPG) released Dec, 2021. Also ZED-F9R (HPS) released Sept, 2022
821-
//"1.32" - ZED-F9P released May, 2022
827+
//"1.51" - ZED-F9P released November, 2024
822828
//"1.50" - ZED-F9P released July, 2024
829+
//"1.32" - ZED-F9P released May, 2022
830+
//"1.30" - ZED-F9P (HPG) released Dec, 2021. Also ZED-F9R (HPS) released Sept, 2022
831+
//"1.21" - F9R HPS v1.21
832+
//"1.20" - Mostly for F9R HPS 1.20, but also F9P HPG v1.20
823833

824-
const uint8_t knownFirmwareVersions[] = {100, 112, 113, 120, 121, 130, 132, 150};
834+
const uint8_t knownFirmwareVersions[] = {151, 150, 132, 130, 121, 120, 113, 112, 100};
825835
bool knownFirmware = false;
826836
for (uint8_t i = 0; i < (sizeof(knownFirmwareVersions) / sizeof(uint8_t)); i++)
827837
{
@@ -832,17 +842,21 @@ void beginGNSS()
832842
if (!knownFirmware)
833843
{
834844
systemPrintf("Unknown firmware version: %s\r\n", zedFirmwareVersion);
835-
zedFirmwareVersionInt = 99; // 0.99 invalid firmware version
845+
// Let's be clever and allow ZED-F9P firmware versions higher than knownFirmwareVersions[0]
846+
if ((zedModuleType == PLATFORM_F9P) && (zedFirmwareVersionInt > knownFirmwareVersions[0]))
847+
{
848+
zedFirmwareVersionInt = knownFirmwareVersions[0];
849+
systemPrintf("Assuming firmware compatibility with %d.%02d\r\n", zedFirmwareVersionInt / 100, zedFirmwareVersionInt % 100);
850+
}
851+
else
852+
{
853+
zedFirmwareVersionInt = 99; // 0.99 invalid firmware version
854+
}
836855
}
837856

838-
// Determine if we have a ZED-F9P (Express/Facet) or an ZED-F9R (Express Plus/Facet Plus)
839-
if (strstr(theGNSS.getModuleName(), "ZED-F9P") != nullptr)
840-
zedModuleType = PLATFORM_F9P;
841-
else if (strstr(theGNSS.getModuleName(), "ZED-F9R") != nullptr)
842-
zedModuleType = PLATFORM_F9R;
843-
else
857+
if (zedModuleType == 0)
844858
{
845-
systemPrintf("Unknown ZED module: %s\r\n", theGNSS.getModuleName());
859+
systemPrintf("Unknown ZED module: %s. Assuming compatibility with ZED-F9P\r\n", theGNSS.getModuleName());
846860
zedModuleType = PLATFORM_F9P;
847861
}
848862

0 commit comments

Comments
 (0)