From 0685cc2a91324bca33ee307f71a1df82053b847f Mon Sep 17 00:00:00 2001 From: Paul Clark Date: Mon, 17 Nov 2025 12:42:16 +0000 Subject: [PATCH 01/13] Add sysSource - see #11 --- Firmware/GNSSDO_Firmware/Begin.ino | 2 ++ Firmware/GNSSDO_Firmware/Display.ino | 2 +- Firmware/GNSSDO_Firmware/settings.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Firmware/GNSSDO_Firmware/Begin.ino b/Firmware/GNSSDO_Firmware/Begin.ino index 6d65e37..750b658 100644 --- a/Firmware/GNSSDO_Firmware/Begin.ino +++ b/Firmware/GNSSDO_Firmware/Begin.ino @@ -635,6 +635,7 @@ void updateTCXOClockBias() tcxoClockBias_ms = gnssClockBias_ms; // Default to the PVTGeodetic RxClkBias tcxoClockDrift_ppm = gnssClockDrift_ppm; snprintf(rxClkBiasSource, sizeof(rxClkBiasSource), "PVT"); + snprintf(sysSource, sizeof(sysSource), mosaicTimeSystemNameFromId(gnssTimeSys)); if (settings.preferNonCompositeGPSBias || settings.preferNonCompositeGalileoBias) // These are mutex { @@ -645,6 +646,7 @@ void updateTCXOClockBias() tcxoClockDrift_ppm = fugroTimeSystems[index].RxClkDrift_ppm; fugroTimeSystems[index].updated = false; snprintf(rxClkBiasSource, sizeof(rxClkBiasSource), fugroTimeSystems[index].name); + snprintf(sysSource, sizeof(sysSource), "Fugro (%s)", fugroTimeSystems[index].name); } } } diff --git a/Firmware/GNSSDO_Firmware/Display.ino b/Firmware/GNSSDO_Firmware/Display.ino index 310c034..e21e0ca 100644 --- a/Firmware/GNSSDO_Firmware/Display.ino +++ b/Firmware/GNSSDO_Firmware/Display.ino @@ -158,7 +158,7 @@ void updateDisplay() yPos += 8; snprintf(textLine, sizeof(textLine), "Sys %s", - mosaicTimeSystemNameFromId(gnssTimeSys)); + sysSource); oled->setCursor(0, yPos); oled->print(textLine); yPos += 8; diff --git a/Firmware/GNSSDO_Firmware/settings.h b/Firmware/GNSSDO_Firmware/settings.h index a0d16b4..ae176d2 100644 --- a/Firmware/GNSSDO_Firmware/settings.h +++ b/Firmware/GNSSDO_Firmware/settings.h @@ -134,6 +134,7 @@ uint8_t mosaicTimeSystemIndexFromName(const char *name) double tcxoClockBias_ms; // Updated by updateTCXOClockBias float tcxoClockDrift_ppm; char rxClkBiasSource[8]; +char sysSource[16]; // "Fugro (Galileo)" const char *const mosaicPVTErrorTable[] = { "None", From 5dae587cb3c117b9473e4319f75b8dda9dca904c Mon Sep 17 00:00:00 2001 From: Paul Clark Date: Mon, 17 Nov 2025 12:44:30 +0000 Subject: [PATCH 02/13] Fix for #10 --- Firmware/GNSSDO_Firmware/menuSystem.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/GNSSDO_Firmware/menuSystem.ino b/Firmware/GNSSDO_Firmware/menuSystem.ino index 35d3647..d3b6b59 100644 --- a/Firmware/GNSSDO_Firmware/menuSystem.ino +++ b/Firmware/GNSSDO_Firmware/menuSystem.ino @@ -509,7 +509,7 @@ void menuOperation() { settings.ppsTimeScale++; if ((settings.ppsTimeScale >= mosaicPPSParametersTimeScaleEntries) || (settings.ppsTimeScale < 0)) - settings.ppsPolarity = 0; + settings.ppsTimeScale = 0; ppsStarted = false; // Restart PPS afterwards } else if (incoming == 12) From 0ed4448f2196131c0d3fc0c883f7195c28ef8382 Mon Sep 17 00:00:00 2001 From: Paul Clark Date: Mon, 17 Nov 2025 14:20:26 +0000 Subject: [PATCH 03/13] Add spm,Static,,auto - see #12 --- Firmware/GNSSDO_Firmware/GNSS.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Firmware/GNSSDO_Firmware/GNSS.ino b/Firmware/GNSSDO_Firmware/GNSS.ino index 7deb3bd..2abc846 100644 --- a/Firmware/GNSSDO_Firmware/GNSS.ino +++ b/Firmware/GNSSDO_Firmware/GNSS.ino @@ -236,6 +236,12 @@ bool initializeGNSS() return false; } + if (!sendWithResponse("spm, Static, , auto\n\r", "PVTMode")) + { + systemPrintln("GNSS FAIL (PVTMode)"); + return false; + } + // Copy current configuration into boot if (!sendWithResponse("eccf, Current, Boot\n\r", "CopyConfigFile", 5000)) { From 1dcebc7212b87753c9dcee916ba947bd8ab36306 Mon Sep 17 00:00:00 2001 From: Paul Clark Date: Mon, 17 Nov 2025 14:26:57 +0000 Subject: [PATCH 04/13] Add Dockerfile and compile_with_dockerfile.bat This makes local compilation a whole lot easier - using the correct core and library versions --- .github/workflows/non-release-build.yml | 67 +++++------------- Firmware/Dockerfile | 90 +++++++++++++++++++++++++ Firmware/GNSSDO_Firmware/compile_me.bat | 1 - Firmware/compile_with_docker.bat | 6 ++ 4 files changed, 112 insertions(+), 52 deletions(-) create mode 100644 Firmware/Dockerfile delete mode 100644 Firmware/GNSSDO_Firmware/compile_me.bat create mode 100644 Firmware/compile_with_docker.bat diff --git a/.github/workflows/non-release-build.yml b/.github/workflows/non-release-build.yml index e004e36..13ccc2c 100644 --- a/.github/workflows/non-release-build.yml +++ b/.github/workflows/non-release-build.yml @@ -44,56 +44,20 @@ jobs: echo "DEBUG_LEVEL=debug" >> "$GITHUB_ENV" fi - - name: Setup Arduino CLI - uses: arduino/setup-arduino-cli@v1 - - - name: Start config file - run: arduino-cli config init --additional-urls "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json,https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json" - - - name: Update core index - run: arduino-cli core update-index - - - name: Update library index - run: arduino-cli lib update-index - - - name: Install platform - run: arduino-cli core install esp32:esp32@${{ env.CORE_VERSION }} - - - name: Get IDF version + - name: Run Dockerfile and copy files run: | - cd /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs - IDF_VERSION=$(ls | grep idf-release) - echo "ESP_IDF=${IDF_VERSION}" >> "$GITHUB_ENV" - - - name: Get Known Libraries - run: arduino-cli lib install - ESP32Time@2.0.0 - JC_Button@2.1.2 - "SparkFun Qwiic OLED Arduino Library"@1.0.13 - "SparkFun Toolkit"@0.9.2 - # "SparkFun SiT5358 DCTCXO Arduino Library"@1.0.0 - # "SparkFun SiT5811 OCXO Arduino Library"@1.0.0 - # "SparkFun STP3593LF OCXO Arduino Library"@1.0.0 - - - name: Enable external libs - run: arduino-cli config set library.enable_unsafe_install true - - - name: Get Libraries - run: arduino-cli lib install --git-url - https://github.com/sparkfun/SparkFun_SiT5358_DCTCXO_Arduino_Library.git - https://github.com/sparkfun/SparkFun_SiT5811_OCXO_Arduino_Library.git - https://github.com/sparkfun/SparkFun_STP3593LF_OCXO_Arduino_Library.git - - - name: Copy custom app3M_fat9M_16MB.csv - run: - cp Firmware/app3M_fat9M_16MB.csv /home/runner/.arduino15/packages/esp32/hardware/esp32/${{ env.CORE_VERSION }}/tools/partitions/app3M_fat9M_16MB.csv - - - name: Compile Sketch - run: arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${{ env.DEBUG_LEVEL }} ./Firmware/GNSSDO_Firmware/GNSSDO_Firmware.ino - --build-property build.partitions=app3M_fat9M_16MB - --build-property upload.maximum_size=3145728 - --build-property "compiler.cpp.extra_flags=-MMD -c \"-DFIRMWARE_VERSION_MAJOR=$FIRMWARE_VERSION_MAJOR\" \"-DFIRMWARE_VERSION_MINOR=$FIRMWARE_VERSION_MINOR\"" - --export-binaries + cd ./Firmware + docker build -t gnssdo_firmware --no-cache \ + --build-arg CORE_VERSION=${{ env.CORE_VERSION }} \ + --build-arg FIRMWARE_VERSION_MAJOR=${{ env.FIRMWARE_VERSION_MAJOR }} \ + --build-arg FIRMWARE_VERSION_MINOR=${{ env.FIRMWARE_VERSION_MINOR }} \ + --build-arg DEBUG_LEVEL=${{ env.DEBUG_LEVEL }} \ + . + docker create --name=gnssdo_image rtk_firmware:latest + mkdir ./build + docker cp gnssdo_image:/GNSSDO_Firmware.ino.bin ./build + docker cp gnssdo_image:/GNSSDO_Firmware.ino.elf ./build + docker container rm gnssdo_image - name: Create artifact name run: | @@ -101,13 +65,14 @@ jobs: - name: Create artifact directory run: | - cd Firmware/GNSSDO_Firmware/build/esp32.esp32.esp32/ + cd ./Firmware/build/ mkdir ${{ env.ARTIFACT }} mv GNSSDO_Firmware.ino.bin ${{ env.ARTIFACT }} + mv GNSSDO_Firmware.ino.elf ${{ env.ARTIFACT }} - name: Upload artifact directory to action - avoid double-zip uses: actions/upload-artifact@v4 with: name: ${{ env.ARTIFACT }} - path: Firmware/GNSSDO_Firmware/build/esp32.esp32.esp32/${{ env.ARTIFACT }} + path: ./Firmware/build/${{ env.ARTIFACT }} retention-days: 7 diff --git a/Firmware/Dockerfile b/Firmware/Dockerfile new file mode 100644 index 0000000..8ceb4a5 --- /dev/null +++ b/Firmware/Dockerfile @@ -0,0 +1,90 @@ +FROM ubuntu:latest AS upstream + +ARG DEBIAN_FRONTEND=noninteractive + +ARG CORE_VERSION=3.0.7 + +ARG FIRMWARE_VERSION_MAJOR=9 +ARG FIRMWARE_VERSION_MINOR=9 + +# ESP32 Core Debug Level +# We use "none" for releases and "error" for release_candidate +# You may find "verbose" useful while you are debugging your changes +ARG DEBUG_LEVEL=error + +# arduino-cli warnings: none default more all +ARG WARNINGS=default + +# Get curl and python3 +RUN apt-get update \ + && apt-get install -y curl python3 python3-pip python3-venv \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Avoid the externally managed environment constraint +RUN PYTHON_VER=$(ls /usr/lib | grep python3.) \ + && echo "Python version: ${PYTHON_VER}" \ + && rm /usr/lib/${PYTHON_VER}/EXTERNALLY-MANAGED + +# Install Python dependencies - esptool needs pyserial +#RUN python3 -m pip install --upgrade pip && \ +RUN pip install pyserial + +# Setup Arduino CLI +#RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh +RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh + +# Start config file +RUN arduino-cli config init --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json,https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json + +# Update core index +RUN arduino-cli core update-index + +# Update library index +RUN arduino-cli lib update-index + +# Install platform +RUN arduino-cli core install "esp32:esp32@${CORE_VERSION}" + +# Get Known Libraries +RUN arduino-cli lib install ESP32Time@2.0.0 +RUN arduino-cli lib install JC_Button@2.1.2 +RUN arduino-cli lib install "SparkFun Qwiic OLED Arduino Library"@1.0.13 +RUN arduino-cli lib install "SparkFun Toolkit"@0.9.2 +#RUN arduino-cli lib install "SparkFun SiT5358 DCTCXO Arduino Library"@1.0.1 +#RUN arduino-cli lib install "SparkFun SiT5811 OCXO Arduino Library"@1.0.1 +#RUN arduino-cli lib install "SparkFun STP3593LF OCXO Arduino Library"@1.0.1 + +# Enable external libs +RUN arduino-cli config set library.enable_unsafe_install true + +# Get external libs +RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_SiT5358_DCTCXO_Arduino_Library.git +RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_SiT5811_OCXO_Arduino_Library.git +RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_STP3593LF_OCXO_Arduino_Library.git + +# Copy GNSSDO_Firmware and build deployment image +FROM upstream AS deployment + +# Add the source files +ADD . . + +# Copy custom app3M_fat9M_16MB.csv +RUN cp app3M_fat9M_16MB.csv "/root/.arduino15/packages/esp32/hardware/esp32/${CORE_VERSION}/tools/partitions/app3M_fat9M_16MB.csv" + +# Compile Sketch +RUN cd ./GNSSDO_Firmware \ + && arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${DEBUG_LEVEL} \ + --warnings ${WARNINGS} \ + ./GNSSDO_Firmware.ino \ + --build-property build.partitions=app3M_fat9M_16MB \ + --build-property upload.maximum_size=3145728 \ + --build-property "compiler.cpp.extra_flags=-MMD -c \ + \"-DFIRMWARE_VERSION_MAJOR=${FIRMWARE_VERSION_MAJOR}\" \ + \"-DFIRMWARE_VERSION_MINOR=${FIRMWARE_VERSION_MINOR}\"" \ + --export-binaries + +# Copy the compile output. List the files +FROM deployment AS output +COPY --from=deployment ./GNSSDO_Firmware/build/esp32.esp32.esp32 / +CMD echo $(ls /*.*) diff --git a/Firmware/GNSSDO_Firmware/compile_me.bat b/Firmware/GNSSDO_Firmware/compile_me.bat deleted file mode 100644 index 2730e91..0000000 --- a/Firmware/GNSSDO_Firmware/compile_me.bat +++ /dev/null @@ -1 +0,0 @@ -arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=verbose GNSSDO_Firmware.ino --warnings default --build-property build.partitions=app3M_fat9M_16MB --build-property upload.maximum_size=3145728 --build-property "compiler.cpp.extra_flags=-MMD -c \"-DFIRMWARE_VERSION_MAJOR=9\" \"-DFIRMWARE_VERSION_MINOR=9\"" --export-binaries diff --git a/Firmware/compile_with_docker.bat b/Firmware/compile_with_docker.bat new file mode 100644 index 0000000..f3fc0ae --- /dev/null +++ b/Firmware/compile_with_docker.bat @@ -0,0 +1,6 @@ +docker build -t gnssdo_firmware --no-cache-filter deployment . +docker create --name=gnssdo_image gnssdo_firmware:latest +docker cp gnssdo_image:/GNSSDO_Firmware.ino.bin . +docker cp gnssdo_image:/GNSSDO_Firmware.ino.elf . +docker cp gnssdo_image:/GNSSDO_Firmware.ino.bootloader.bin . +docker container rm gnssdo_image From 9f1191fff9a334493019b2a9aa894bc359ea2c8c Mon Sep 17 00:00:00 2001 From: Paul Clark Date: Mon, 17 Nov 2025 14:54:25 +0000 Subject: [PATCH 05/13] Update non-release-build.yml --- .github/workflows/non-release-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/non-release-build.yml b/.github/workflows/non-release-build.yml index 13ccc2c..989eab0 100644 --- a/.github/workflows/non-release-build.yml +++ b/.github/workflows/non-release-build.yml @@ -53,7 +53,7 @@ jobs: --build-arg FIRMWARE_VERSION_MINOR=${{ env.FIRMWARE_VERSION_MINOR }} \ --build-arg DEBUG_LEVEL=${{ env.DEBUG_LEVEL }} \ . - docker create --name=gnssdo_image rtk_firmware:latest + docker create --name=gnssdo_image gnssdo_firmware:latest mkdir ./build docker cp gnssdo_image:/GNSSDO_Firmware.ino.bin ./build docker cp gnssdo_image:/GNSSDO_Firmware.ino.elf ./build From acc7b2d6cef3b612af88846d851aa7a0d91a8f47 Mon Sep 17 00:00:00 2001 From: Paul Clark Date: Mon, 17 Nov 2025 14:54:52 +0000 Subject: [PATCH 06/13] Update docs - add compilation instructions --- docs/assets/img/Download_Zip.png | Bin 0 -> 1273 bytes docs/software_overview.md | 70 +++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 docs/assets/img/Download_Zip.png diff --git a/docs/assets/img/Download_Zip.png b/docs/assets/img/Download_Zip.png new file mode 100644 index 0000000000000000000000000000000000000000..00163c2f1650b73eaa6842950ad46a52f6719b22 GIT binary patch literal 1273 zcmeAS@N?(olHy`uVBq!ia0vp^(}38LgAGVt@xF8uNHG=%xjQkeJ16rJ$YDu$^mSxl z*x1kgCy^D%=PdAuEM{QfI}E~%$MaXD0M+z)x;TbZ#J!!nJ6qIIr2VhIPEJt7ji`tS zO^pmyjffu%ih`{2f-Ndt{sQs7A}-SRGeku1uZUP8AaaB~qJzuKP0&T?bk85Lb5HL~ zw%k42dN;TE_wNT218nW#N2x98x6iS0m|dh|20KWO@@ z?6xrCe*K?K(>?o{)zfstB&9huKdFT4=+z%#&MVOoQ>=Wl(`lo}@h3YksfEQkIwe({ z3(%R=@|@?Wk|$oK&)THi7x!h`_+I)1M?GU5N3*3*e^m*qY@)oZ;?>ZOuR zdX^~nBL}6#f*&4Yhqi94Ha<1s-J#-Tfg4$LZye3uzNzTDy#4m0G57ZV7x*Qn$MsqK z%hscp)1Tg6A#|tw?5(efMXTo3x7^v7?Jr?leQq9~u(18%N2=cGJeI-kJra-Z!IYLQgdTR>4wr6mLpO7ib`)cbmU0vShn%xYAOFU5)#5ayvLYt z?7O*b!+fRb&wUmr-CP>rAUQ?X+easXeXC~9r&Y&JO=#E6{++h|@t^z zHmo|rRQ6!Q`sH;y({4{lb)6Q>V>$I{eEaTi9^vdqB zlu*2z&h7pimezJF`4@u>sq{{qnv{4U#d6E#J=5H~nK!s9E!8{q$ZA`VzmQ7l(lvhb z_NrZ9+ffv+ZSrf4>x4Sd&ZnF~D%1Af&-pkfGepNan6tDa_2|aysqt)*x08?ir*39` zwP@b7Gitu-KJSnJdiK?ILQ3`1H9Up^Zl`sQ9Jyp%(G_w49MakmQayT{AJc4{3t#PI0kb><$%FZVXG@O;@Mx;pCl1+%_X&nZ=@M}-8xY-)LZ ziU0PrFP@WntD;zb?zEBIqZ%;db5if!+8MI`zJE_|vk$WhIblDYAQTzGUE0OavqmJI%QtJQhxc`Eu z7Y`+R-l_jm^5VYbm9Xh0?DLGbc71(tvfH5Mhs!qoq?ft}y#E|nx9~&JpQ$T-cQJzW zUP?%d+Fn_$Cc5p{)43)3zyRrVeWo_gSfpF!p{4Ui4^oVk z8m?2vruot17tf^#Rwsvv>c&Tyb}`vMpBrKIYfgDW?i2H1feC-kiW~@Y`>?yDYP#1x zZ}$zo1`<}EPKa{fI3~g4BG{V5xh>Hx-!0Os+x0}wf`}zz8e%J3|7Qn2*(|Yc-63Fc O#o+1c=d#Wzp$Pz;i%q8h literal 0 HcmV?d00001 diff --git a/docs/software_overview.md b/docs/software_overview.md index d96462a..9a67037 100644 --- a/docs/software_overview.md +++ b/docs/software_overview.md @@ -439,3 +439,73 @@ The **[/Firmware/Binaries](https://github.com/sparkfun/SparkFun_GNSSDO/tree/main You can update or reload the firmware using the [SparkFun RTK Firmware Uploader](https://github.com/sparkfun/SparkFun_RTK_Firmware_Uploader). +## :fontawesome-solid-screwdriver-wrench: Compiling Firmware + +The GNSSDO Firmware can be compiled locally using Docker: + +### Clone, fork or download the GNSSDO repo + +To build the GNSSDO Firmware, you obviously need a copy of the source code. + +Click on the icon below to download a copy of the main (released) branch: + +[![Download ZIP](./assets/img/Download_Zip.png)](https://github.com/sparkfun/SparkFun_GNSSDO/archive/refs/heads/main.zip "Download ZIP (main branch)") + +For the real Wild West experience, you can also download a copy of the `release_candidate` code branch. This is where the team is actively changing and testing the code, before it becomes a full release. The code there will _usually_ compile and will _usually_ work, but we don't guarantee it! We may be part way through implementing some breaking changes at the time of your download... + +[![Download ZIP - release candidate](./assets/img/Download_Zip.png)](https://github.com/sparkfun/SparkFun_GNSSDO/archive/refs/heads/release_candidate.zip "Download ZIP (release_candidate branch)") + +### Install Docker Desktop + +* **(Optional)** Head to [Docker](https://www.docker.com/) and create an account. A free "Personal" account will cover occasional compilations of the firmware +* Download and install [Docker Desktop](https://docs.docker.com/get-started/get-docker/) - there are versions for Mac, Windows and Linux. You may need to restart to complete the installation. +* Run the Desktop + * You don't _need_ to have an account and you don't _need_ to be signed in + * You only need to be signed in if you want to store or share your Container on Docker Hub + * If you don't sign in, Docker Desktop will run in Personal mode - which will cover local compilations of the firmware +* On Windows, you may see an error saying "**WSL needs updating** Your version of Windows Subsystem for Linux (WSL) is too old". If you do: + * Open a command prompt + * Type `wsl --update` to update WSL. At the time of writing, this installs Windows Subsystem for Linux 2.6.1 + * Restart the Docker Desktop +* If you are using Docker for the first time, the "What is a container?" and "How do I run a container?" demos are useful - _but not essential_ + * On Windows, you may want to give Docker Desktop permission to access to your Network, so it can access (e.g.) HTML ports + * You can Stop the container and Delete it when you are done +* You may want to prevent Docker from running when your machine starts up + * Uncheck "Start Docker Desktop when you sign in to your computer" in the Desktop settings + +### Using Docker to create the firmware binary + +* **Make sure you have Docker Desktop running.** You don't need to be signed in, but it needs to be running. +* Open a Command Prompt and `cd` into the SparkFun_GNSSDO folder +* Check you are in the right place. Type `dir` and hit enter. You should see the following files and folders: + +``` + .gitattributes + .github + .gitignore + CONTRIBUTING.md + docs + Firmware +``` + +* `cd Firmware` and then `dir` again. You should see: + +``` + app3M_fat9M_16MB.csv + Binaries + compile_with_docker.bat + Dockerfile + GNSSDO_Firmware + Utils +``` + +* The file that does most of the work is the `Dockerfile` + +* Run `compile_with_docker.bat` to compile the firmware. It does everything for you + +* Type `dir` again. Hey presto! You have your newly compiled firmware binary! + +You can then use (e.g.) the [SparkFun RTK Firmware Uploader](https://github.com/sparkfun/SparkFun_RTK_Firmware_Uploader) to upload the binary onto the ESP32. + +You may find the `.elf` file useful if you are trying to debug the code with [me-no-dev's Exception Decoder](https://github.com/me-no-dev/EspExceptionDecoder). + From 96407604b5afac9a9ddbf993ebca5119e38fc52e Mon Sep 17 00:00:00 2001 From: Paul Clark Date: Mon, 17 Nov 2025 16:12:53 +0000 Subject: [PATCH 07/13] Update software_overview.md --- docs/software_overview.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/docs/software_overview.md b/docs/software_overview.md index 9a67037..e9f4fb2 100644 --- a/docs/software_overview.md +++ b/docs/software_overview.md @@ -439,9 +439,13 @@ The **[/Firmware/Binaries](https://github.com/sparkfun/SparkFun_GNSSDO/tree/main You can update or reload the firmware using the [SparkFun RTK Firmware Uploader](https://github.com/sparkfun/SparkFun_RTK_Firmware_Uploader). -## :fontawesome-solid-screwdriver-wrench: Compiling Firmware +## :fontawesome-solid-screwdriver-wrench: Compiling Firmware - using Docker -The GNSSDO Firmware can be compiled locally using Docker: +To compile the GNSSDO Firmware, you need to use the correct version of the ESP32 Arduino core and of each required Arduino library. It is tedious and error-prone. Especially on Windows. We've lost count of the number of times code compilation fails on our local machines, because we had the wrong ESP32 core installed... It is much easier to sandbox the firmware compilation using an environment like [Docker](https://www.docker.com/). + +Docker is open-source. It is our new favourite thing! + +Here is a step-by-step guide for how to install Docker and compile the firmware from scratch: ### Clone, fork or download the GNSSDO repo @@ -509,3 +513,28 @@ You can then use (e.g.) the [SparkFun RTK Firmware Uploader](https://github.com/ You may find the `.elf` file useful if you are trying to debug the code with [me-no-dev's Exception Decoder](https://github.com/me-no-dev/EspExceptionDecoder). +## :fontawesome-solid-screwdriver-wrench: Uploading Firmware - using esptool + +The [SparkFun RTK Firmware Uploader](https://github.com/sparkfun/SparkFun_RTK_Firmware_Uploader) contains a copy of Espressif's esptool. It is esptool that actually performs the code upload. + +If you want to upload new firmware manually from the command line, here are the commands: + +``` +esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 460800 --before default_reset --after no_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 RTK_Surveyor.ino.bootloader.bin 0x8000 RTK_Surveyor_Partitions_16MB.bin 0xe000 boot_app0.bin 0x10000 GNSSDO_Firmware.ino.bin +``` + +followed by: + +``` +esptool.py --chip esp32 --port /dev/ttyUSB0 --before default_reset run +``` + +On Windows, you can replace `esptool.py` with `esptool.exe`. You can find a copy of `esptool.exe` in the [Utils](https://github.com/sparkfun/SparkFun_GNSSDO/tree/release_candidate/Firmware/Utils) folder. + +On Windows, replace `/dev/ttyUSB0` with the name of your CH340 COM port: `COM1` or similar. + +You can find copies of `RTK_Surveyor.ino.bootloader.bin`, `RTK_Surveyor_Partitions_16MB.bin` and `boot_app0.bin` in the [Firmware Uploader resource folder](https://github.com/sparkfun/SparkFun_RTK_Firmware_Uploader/tree/main/RTK_Firmware_Uploader/resource). + +Enjoy! + +* Your friends at SparkFun From 23916c5c7c74a2ee34efff09f2095c58a2c0af8d Mon Sep 17 00:00:00 2001 From: Paul Clark Date: Mon, 17 Nov 2025 16:15:55 +0000 Subject: [PATCH 08/13] Update build-for-release.yml --- .github/workflows/build-for-release.yml | 66 ++++++------------------- 1 file changed, 14 insertions(+), 52 deletions(-) diff --git a/.github/workflows/build-for-release.yml b/.github/workflows/build-for-release.yml index 52336d1..b8b02cb 100644 --- a/.github/workflows/build-for-release.yml +++ b/.github/workflows/build-for-release.yml @@ -6,7 +6,7 @@ on: env: FILENAME_PREFIX: GNSSDO_Firmware FIRMWARE_VERSION_MAJOR: 2 - FIRMWARE_VERSION_MINOR: 0 + FIRMWARE_VERSION_MINOR: 1 CORE_VERSION: 3.0.7 jobs: @@ -44,61 +44,23 @@ jobs: echo "DEBUG_LEVEL=debug" >> "$GITHUB_ENV" fi - - name: Setup Arduino CLI - uses: arduino/setup-arduino-cli@v1 - - - name: Start config file - run: arduino-cli config init --additional-urls "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json,https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json" - - - name: Update core index - run: arduino-cli core update-index - - - name: Update library index - run: arduino-cli lib update-index - - - name: Install platform - run: arduino-cli core install esp32:esp32@${{ env.CORE_VERSION }} - - - name: Get IDF version + - name: Run Dockerfile and copy files run: | - cd /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs - IDF_VERSION=$(ls | grep idf-release) - echo "ESP_IDF=${IDF_VERSION}" >> "$GITHUB_ENV" - - - name: Get Known Libraries - run: arduino-cli lib install - ESP32Time@2.0.0 - JC_Button@2.1.2 - "SparkFun Qwiic OLED Arduino Library"@1.0.13 - "SparkFun Toolkit"@0.9.2 - # "SparkFun SiT5358 DCTCXO Arduino Library"@1.0.0 - # "SparkFun SiT5811 OCXO Arduino Library"@1.0.0 - # "SparkFun STP3593LF OCXO Arduino Library"@1.0.0 - - - name: Enable external libs - run: arduino-cli config set library.enable_unsafe_install true - - - name: Get Libraries - run: arduino-cli lib install --git-url - https://github.com/sparkfun/SparkFun_SiT5358_DCTCXO_Arduino_Library.git - https://github.com/sparkfun/SparkFun_SiT5811_OCXO_Arduino_Library.git - https://github.com/sparkfun/SparkFun_STP3593LF_OCXO_Arduino_Library.git - - - name: Copy custom app3M_fat9M_16MB.csv - run: - cp Firmware/app3M_fat9M_16MB.csv /home/runner/.arduino15/packages/esp32/hardware/esp32/${{ env.CORE_VERSION }}/tools/partitions/app3M_fat9M_16MB.csv - - - name: Compile Sketch - run: arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${{ env.DEBUG_LEVEL }} ./Firmware/GNSSDO_Firmware/GNSSDO_Firmware.ino - --build-property build.partitions=app3M_fat9M_16MB - --build-property upload.maximum_size=3145728 - --build-property "compiler.cpp.extra_flags=-MMD -c \"-DFIRMWARE_VERSION_MAJOR=$FIRMWARE_VERSION_MAJOR\" \"-DFIRMWARE_VERSION_MINOR=$FIRMWARE_VERSION_MINOR\"" - --export-binaries + cd ./Firmware + docker build -t gnssdo_firmware --no-cache \ + --build-arg CORE_VERSION=${{ env.CORE_VERSION }} \ + --build-arg FIRMWARE_VERSION_MAJOR=${{ env.FIRMWARE_VERSION_MAJOR }} \ + --build-arg FIRMWARE_VERSION_MINOR=${{ env.FIRMWARE_VERSION_MINOR }} \ + --build-arg DEBUG_LEVEL=${{ env.DEBUG_LEVEL }} \ + . + docker create --name=gnssdo_image gnssdo_firmware:latest + docker cp gnssdo_image:/GNSSDO_Firmware.ino.bin . + docker container rm gnssdo_image - name: Rename binary run: | - cd Firmware/GNSSDO_Firmware/build/esp32.esp32.esp32/ - mv GNSSDO_Firmware.ino.bin ../../../Binaries/${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin + cd ./Firmware + mv GNSSDO_Firmware.ino.bin Binaries/${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin - name: Commit and push binary uses: actions-js/push@master From e1ede960e34ead081317e465cff18a29ad78b41b Mon Sep 17 00:00:00 2001 From: Paul Clark Date: Tue, 18 Nov 2025 09:02:38 +0000 Subject: [PATCH 09/13] Update software_overview.md --- docs/software_overview.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/software_overview.md b/docs/software_overview.md index e9f4fb2..8a3f786 100644 --- a/docs/software_overview.md +++ b/docs/software_overview.md @@ -439,6 +439,8 @@ The **[/Firmware/Binaries](https://github.com/sparkfun/SparkFun_GNSSDO/tree/main You can update or reload the firmware using the [SparkFun RTK Firmware Uploader](https://github.com/sparkfun/SparkFun_RTK_Firmware_Uploader). +See [below](#fontawesome-solid-screwdriver-wrench-uploading-firmware---using-esptool) for details on how to upload with esptool from the command line. + ## :fontawesome-solid-screwdriver-wrench: Compiling Firmware - using Docker To compile the GNSSDO Firmware, you need to use the correct version of the ESP32 Arduino core and of each required Arduino library. It is tedious and error-prone. Especially on Windows. We've lost count of the number of times code compilation fails on our local machines, because we had the wrong ESP32 core installed... It is much easier to sandbox the firmware compilation using an environment like [Docker](https://www.docker.com/). From f6bb6614b4c496b62679e2cae30bed142e18ec7e Mon Sep 17 00:00:00 2001 From: Paul Clark Date: Tue, 18 Nov 2025 09:15:56 +0000 Subject: [PATCH 10/13] Update compile_with_docker.bat --- Firmware/compile_with_docker.bat | 1 - 1 file changed, 1 deletion(-) diff --git a/Firmware/compile_with_docker.bat b/Firmware/compile_with_docker.bat index f3fc0ae..5edaa75 100644 --- a/Firmware/compile_with_docker.bat +++ b/Firmware/compile_with_docker.bat @@ -2,5 +2,4 @@ docker build -t gnssdo_firmware --no-cache-filter deployment . docker create --name=gnssdo_image gnssdo_firmware:latest docker cp gnssdo_image:/GNSSDO_Firmware.ino.bin . docker cp gnssdo_image:/GNSSDO_Firmware.ino.elf . -docker cp gnssdo_image:/GNSSDO_Firmware.ino.bootloader.bin . docker container rm gnssdo_image From 5278eafd6d56264f56373d467cc110811505e9bf Mon Sep 17 00:00:00 2001 From: Paul Clark Date: Wed, 19 Nov 2025 09:43:07 +0000 Subject: [PATCH 11/13] Update version history --- Firmware/GNSSDO_Firmware/GNSSDO_Firmware.ino | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Firmware/GNSSDO_Firmware/GNSSDO_Firmware.ino b/Firmware/GNSSDO_Firmware/GNSSDO_Firmware.ino index ff00cc4..a379d3b 100644 --- a/Firmware/GNSSDO_Firmware/GNSSDO_Firmware.ino +++ b/Firmware/GNSSDO_Firmware/GNSSDO_Firmware.ino @@ -5,12 +5,13 @@ This is the firmware for the SparkFun SparkPNT GNSSDO. It runs on an ESP32 and communicates with the mosaic-T and SiT5358. + The SiTime SiT5811 and Rakon STP3593LF are also supported. - Compiled with Arduino v1.8.19 with ESP32 core v3.0.1. + Compiled with arduino-cli with ESP32 core v3.0.7 - Set the board to "ESP32 Wrover Module" + If you are compiling manually in the Arduino IDE: set the board to "ESP32 Wrover Module" - Settings are pulled from ESP32's file system LittleFS. + Settings are stored in the ESP32's file system LittleFS. Version history: 1.0: Initial release @@ -31,6 +32,14 @@ Allow extra time when copying the mosaic-T configuration Print an error if no TCXO / OCXO is detected, but allow firmware to continue Print an ERROR if the display is not detected on I2C, but allow firmware to continue + 2.1: Resolves #10: + Corrects an error an menuOperation where option 11 (ppsTimescale) was not wrapping correctly + Resolves #11: + OLED "Sys" will show "Fugro (GPS)" when the non-composite GPS time system is preferred and in use + OLED "Sys" will show "Fugro (Galileo)" when the non-composite Galileo time system is preferred and in use + Resolves #12: + PVT Mode defaults to Static (after a Factory Reset) for best performance + The user can modify the Mode and save the configuration if needed */ // This is passed in from compiler extra flags From 7d5be23b8d7d560d604594851091b7078298e69d Mon Sep 17 00:00:00 2001 From: Paul Clark Date: Thu, 27 Nov 2025 07:53:41 +0000 Subject: [PATCH 12/13] Update Dockerfile --- Firmware/Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Firmware/Dockerfile b/Firmware/Dockerfile index 8ceb4a5..d1ae2a5 100644 --- a/Firmware/Dockerfile +++ b/Firmware/Dockerfile @@ -32,7 +32,7 @@ RUN pip install pyserial # Setup Arduino CLI #RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh -RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh +RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh -s nightly-latest # Start config file RUN arduino-cli config init --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json,https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json @@ -51,17 +51,17 @@ RUN arduino-cli lib install ESP32Time@2.0.0 RUN arduino-cli lib install JC_Button@2.1.2 RUN arduino-cli lib install "SparkFun Qwiic OLED Arduino Library"@1.0.13 RUN arduino-cli lib install "SparkFun Toolkit"@0.9.2 -#RUN arduino-cli lib install "SparkFun SiT5358 DCTCXO Arduino Library"@1.0.1 -#RUN arduino-cli lib install "SparkFun SiT5811 OCXO Arduino Library"@1.0.1 -#RUN arduino-cli lib install "SparkFun STP3593LF OCXO Arduino Library"@1.0.1 +RUN arduino-cli lib install "SparkFun SiT5358 DCTCXO Arduino Library"@1.0.1 +RUN arduino-cli lib install "SparkFun SiT5811 OCXO Arduino Library"@1.0.1 +RUN arduino-cli lib install "SparkFun STP3593LF OCXO Arduino Library"@1.0.1 # Enable external libs -RUN arduino-cli config set library.enable_unsafe_install true +#RUN arduino-cli config set library.enable_unsafe_install true # Get external libs -RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_SiT5358_DCTCXO_Arduino_Library.git -RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_SiT5811_OCXO_Arduino_Library.git -RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_STP3593LF_OCXO_Arduino_Library.git +#RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_SiT5358_DCTCXO_Arduino_Library.git +#RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_SiT5811_OCXO_Arduino_Library.git +#RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_STP3593LF_OCXO_Arduino_Library.git # Copy GNSSDO_Firmware and build deployment image FROM upstream AS deployment From 3da932719195505c6d666704f8c44500a47a317c Mon Sep 17 00:00:00 2001 From: Paul Clark Date: Thu, 27 Nov 2025 07:55:00 +0000 Subject: [PATCH 13/13] Update software_overview.md --- docs/software_overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/software_overview.md b/docs/software_overview.md index 8a3f786..02e587e 100644 --- a/docs/software_overview.md +++ b/docs/software_overview.md @@ -435,7 +435,7 @@ The format of the **Print conditions** CSV data is: ## :fontawesome-solid-screwdriver-wrench: Firmware Upgrade -The **[/Firmware/Binaries](https://github.com/sparkfun/SparkFun_GNSSDO/tree/main/Firmware/Binaries)** folder contains the firmware binaries. v2.0 is the latest stable release - as at 11-5-25. +The **[/Firmware/Binaries](https://github.com/sparkfun/SparkFun_GNSSDO/tree/main/Firmware/Binaries)** folder contains the firmware binaries. v2.1 is the latest stable release - as at 11-27-25. You can update or reload the firmware using the [SparkFun RTK Firmware Uploader](https://github.com/sparkfun/SparkFun_RTK_Firmware_Uploader).