Skip to content

Commit 521ff38

Browse files
authored
Merge pull request #7 from sparkfun/nsUpdates
Add support for 8MB flash devices.
2 parents 4cb756b + bcb3caf commit 521ff38

File tree

9 files changed

+59
-43
lines changed

9 files changed

+59
-43
lines changed

.github/workflows/build-and-release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,23 @@ jobs:
3939
needs: [call-macos-build, call-linux-build, call-windows-build, call-python-build]
4040
steps:
4141
# Download the generated app files that are part of the release
42-
- uses: actions/download-artifact@v3
42+
- uses: actions/download-artifact@v4
4343
with:
4444
name: ${{ needs.call-macos-build.outputs.build-file }}
45-
- uses: actions/download-artifact@v3
45+
- uses: actions/download-artifact@v4
4646
with:
4747
name: ${{ needs.call-linux-build.outputs.build-file }}
48-
- uses: actions/download-artifact@v3
48+
- uses: actions/download-artifact@v4
4949
with:
5050
name: ${{ needs.call-windows-build.outputs.build-file }}
51-
- uses: actions/download-artifact@v3
51+
- uses: actions/download-artifact@v4
5252
with:
5353
name: ${{ needs.call-python-build.outputs.build-file }}
5454
- name: Output Listing
5555
run: ls -la
5656

5757
- name: Publish Release
58-
uses: softprops/action-gh-release@v1
58+
uses: softprops/action-gh-release@v2
5959
with:
6060
files: |
6161
${{ needs.call-macos-build.outputs.build-file }}

.github/workflows/build-linux.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
# Steps represent a sequence of tasks that will be executed as part of the job
2626
steps:
2727
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28-
- uses: actions/checkout@v3
29-
- uses: actions/setup-python@v4
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-python@v5
3030
with:
31-
python-version: '3.10'
31+
python-version: '3.12'
3232

3333
# Setup python
3434
- name: System Setup
@@ -39,12 +39,13 @@ jobs:
3939
- name: Build Linux Installer
4040
run: |
4141
ESPTOOL_LOCATION=$(pip show esptool | grep "Location: " | cut -c 11- | tr -d '\n')
42-
ESPTOOL_TARGETS=$(echo "${ESPTOOL_LOCATION}/esptool/targets/stub_flasher/*.json:./esptool/targets/stub_flasher/")
43-
pyinstaller --onefile --clean --name RTKUploader --noconsole --distpath=. --icon=RTK_Firmware_Uploader/resource/RTK.ico --add-data="RTK_Firmware_Uploader/resource/*:resource/" --add-data="${ESPTOOL_TARGETS}" RTK_Firmware_Upload.py
42+
ESPTOOL_TARGETS_1=$(echo "${ESPTOOL_LOCATION}/esptool/targets/stub_flasher/1/*.json:./esptool/targets/stub_flasher/1/")
43+
ESPTOOL_TARGETS_2=$(echo "${ESPTOOL_LOCATION}/esptool/targets/stub_flasher/2/*.json:./esptool/targets/stub_flasher/2/")
44+
pyinstaller --onefile --clean --name RTKUploader --noconsole --distpath=. --icon=RTK_Firmware_Uploader/resource/RTK.ico --add-data="RTK_Firmware_Uploader/resource/*:resource/" --add-data="${ESPTOOL_TARGETS_1}" --add-data="${ESPTOOL_TARGETS_2}" RTK_Firmware_Upload.py
4445
gzip RTKUploader
4546
mv RTKUploader.gz RTKUploader.linux.gz
4647
47-
- uses: actions/upload-artifact@v3
48+
- uses: actions/upload-artifact@v4
4849
with:
4950
name: RTKUploader.linux.gz
5051
path: RTKUploader.linux.gz

.github/workflows/build-macos.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
# Steps represent a sequence of tasks that will be executed as part of the job
2626
steps:
2727
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28-
- uses: actions/checkout@v3
29-
- uses: actions/setup-python@v4
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-python@v5
3030
with:
31-
python-version: '3.10'
31+
python-version: '3.12'
3232

3333
# Setup python
3434
- name: System Setup
@@ -40,13 +40,14 @@ jobs:
4040
- name: Build Mac Installer
4141
run: |
4242
ESPTOOL_LOCATION=$(pip show esptool | grep "Location: " | cut -c 11- | tr -d '\n')
43-
ESPTOOL_TARGETS=$(echo "${ESPTOOL_LOCATION}/esptool/targets/stub_flasher/*.json:./esptool/targets/stub_flasher/")
44-
pyinstaller --windowed -n RTKUploader --noconsole --distpath=. --icon=RTK_Firmware_Uploader/resource/RTK.ico --add-data="RTK_Firmware_Uploader/resource/*:resource/" --add-data="${ESPTOOL_TARGETS}" RTK_Firmware_Upload.py
43+
ESPTOOL_TARGETS_1=$(echo "${ESPTOOL_LOCATION}/esptool/targets/stub_flasher/1/*.json:./esptool/targets/stub_flasher/1/")
44+
ESPTOOL_TARGETS_2=$(echo "${ESPTOOL_LOCATION}/esptool/targets/stub_flasher/2/*.json:./esptool/targets/stub_flasher/2/")
45+
pyinstaller --windowed -n RTKUploader --noconsole --distpath=. --icon=RTK_Firmware_Uploader/resource/RTK.ico --add-data="RTK_Firmware_Uploader/resource/*:resource/" --add-data="${ESPTOOL_TARGETS_1}" --add-data="${ESPTOOL_TARGETS_2}" RTK_Firmware_Upload.py
4546
mkdir tmp
4647
mv "RTKUploader.app" "tmp/"
4748
create-dmg --volicon "RTK_Firmware_Uploader/resource/sparkdisk.icns" --background "RTK_Firmware_Uploader/resource/sfe_logo_med.png" --hide-extension "RTKUploader.app" --icon "RTKUploader.app" 100 100 --window-size 600 440 --app-drop-link 400 100 "RTKUploader.dmg" "tmp/"
4849
49-
- uses: actions/upload-artifact@v3
50+
- uses: actions/upload-artifact@v4
5051
with:
5152
name: RTKUploader.dmg
5253
path: RTKUploader.dmg

.github/workflows/build-python.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ jobs:
2929
# Steps represent a sequence of tasks that will be executed as part of the job
3030
steps:
3131
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
32-
- uses: actions/checkout@v3
33-
- uses: actions/setup-python@v4
32+
- uses: actions/checkout@v4
33+
- uses: actions/setup-python@v5
3434
with:
35-
python-version: '3.10'
35+
python-version: '3.12'
3636

3737
# Setup python
3838
- name: System Setup
@@ -44,7 +44,7 @@ jobs:
4444
run: |
4545
python setup.py sdist
4646
47-
- uses: actions/upload-artifact@v3
47+
- uses: actions/upload-artifact@v4
4848
with:
4949
name: python-install-package
5050
path: dist

.github/workflows/build-windows.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
# Steps represent a sequence of tasks that will be executed as part of the job
2626
steps:
2727
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28-
- uses: actions/checkout@v3
29-
- uses: actions/setup-python@v4
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-python@v5
3030
with:
31-
python-version: '3.10'
31+
python-version: '3.12'
3232

3333
# Setup python
3434
- name: System Setup
@@ -41,8 +41,9 @@ jobs:
4141
run: |
4242
$ESPTOOL_TARGETS = echo "$(pip show esptool | findstr "Location: ")"
4343
$ESPTOOL_TARGETS = $ESPTOOL_TARGETS.Substring(10)
44-
$ESPTOOL_TARGETS = echo "${ESPTOOL_TARGETS}\esptool\targets\stub_flasher\*.json;.\esptool\targets\stub_flasher\"
45-
pyinstaller --onefile --clean --name RTKUploader --noconsole --distpath=. --icon=RTK_Firmware_Uploader\resource\RTK.ico --add-data="RTK_Firmware_Uploader\resource\*;resource\" --add-data="${ESPTOOL_TARGETS}" RTK_Firmware_Upload.py
44+
$ESPTOOL_TARGETS_1 = echo "${ESPTOOL_TARGETS}\esptool\targets\stub_flasher\1\*.json;.\esptool\targets\stub_flasher\1\"
45+
$ESPTOOL_TARGETS_2 = echo "${ESPTOOL_TARGETS}\esptool\targets\stub_flasher\2\*.json;.\esptool\targets\stub_flasher\2\"
46+
pyinstaller --onefile --clean --name RTKUploader --noconsole --distpath=. --icon=RTK_Firmware_Uploader\resource\RTK.ico --add-data="RTK_Firmware_Uploader\resource\*;resource\" --add-data="${ESPTOOL_TARGETS_1}" --add-data="${ESPTOOL_TARGETS_2}" RTK_Firmware_Upload.py
4647
4748
- name: Compress Installer
4849
shell: powershell
@@ -54,7 +55,7 @@ jobs:
5455
}
5556
Compress-Archive @compress
5657
57-
- uses: actions/upload-artifact@v3
58+
- uses: actions/upload-artifact@v4
5859
with:
5960
name: RTKUploader.win.zip
6061
path: RTKUploader.win.zip

RTK_Firmware_Uploader/RTK_Firmware_Uploader.py

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def on_worker_callback(self, *args): #msg_type, arg):
266266
elif msg_type == AUxWorker.TYPE_FINISHED:
267267
# finished takes 3 args - status, job type, and job id
268268
if len(args) < 4:
269-
self.writeMessage("Invalid parameters from the uploader.");
269+
self.writeMessage("Invalid parameters from the uploader.")
270270
return;
271271

272272
self.sig_finished.emit(args[1], args[2], args[3])
@@ -635,33 +635,46 @@ def do_upload(self) -> None:
635635
else:
636636
self.writeMessage("Flash size is " + str(self.flashSize) + "MB\n")
637637

638-
thePartitionFileName = ''
638+
thePartitionFileName = resource_path("RTK_Surveyor_Partitions_16MB.bin")
639639
firmwareSizeCorrect = True
640-
if self.flashSize == 16:
641-
thePartitionFileName = resource_path("RTK_Surveyor_Partitions_16MB.bin")
642-
# if self.theFileName.find("16MB") < 0:
643-
# firmwareSizeCorrect = False
644-
else:
640+
if self.flashSize == 16: # Could be RTK Firmware or RTK Everywhere
641+
pass # Nothing to do
642+
elif self.flashSize == 8: # RTK Postcard (ESP32 Pico Mini)
643+
thePartitionFileName = resource_path("RTK_Everywhere_Partitions_8MB.bin")
644+
if self.theFileName.find("RTK_Everywhere_Firmware") < 0:
645+
self.writeMessage("Flash size is 8MB. RTK Everywhere Firmware not detected\n")
646+
firmwareSizeCorrect = False
647+
elif self.flashSize == 4: # Original RTK Surveyor
645648
thePartitionFileName = resource_path("RTK_Surveyor_Partitions_4MB.bin")
646-
# if self.theFileName.find("4MB") < 0:
647-
# firmwareSizeCorrect = False
649+
if self.theFileName.find("RTK_Surveyor_Firmware") < 0:
650+
self.writeMessage("Flash size is 4MB. RTK Surveyor Firmware not detected\n")
651+
firmwareSizeCorrect = False
652+
else:
653+
firmwareSizeCorrect = False
648654

649655
if firmwareSizeCorrect == False:
650-
reply = QMessageBox.warning(self, "Firmware size mismatch", "Do you want to continue?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
656+
reply = QMessageBox.warning(self, "Firmware and flash size mismatch", "Do you want to continue?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
651657
if reply == QMessageBox.No:
652658
self.disable_interface(False)
653659
return
654660

655-
sleep(1.0);
661+
theBootloaderFileName = resource_path("RTK_Surveyor.ino.bootloader.bin")
662+
if self.theFileName.find("RTK_Everywhere_Firmware") >= 0:
663+
theBootloaderFileName = resource_path("RTK_Everywhere.ino.bootloader.bin")
664+
self.writeMessage("RTK Everywhere Firmware detected. Using RTK_Everywhere.ino.bootloader.bin\n")
665+
else:
666+
self.writeMessage("Using RTK_Surveyor.ino.bootloader.bin\n")
667+
668+
sleep(1.0)
656669
self.writeMessage("Uploading firmware\n")
657670

658671
baud = self.baudRate
659672
if baud == "921600":
660673
if (platform.system() == "Darwin"): # 921600 fails on MacOS
661674
self.writeMessage("MacOS detected. Limiting baud to 460800\n")
662675
baud = "460800"
663-
if (str(self.port_combobox.currentText()).find("CH342") >= 0): # 921600 fails on CH342
664-
self.writeMessage("CH342 detected. Limiting baud to 460800\n")
676+
if ((str(self.port_combobox.currentText()).find("CH342") >= 0) and (self.flashSize == 16)): # 921600 fails on CH342 + 16MB ESP32 (ie, RTK Torch)
677+
self.writeMessage("RTK Torch detected. Limiting baud to 460800\n")
665678
baud = "460800"
666679

667680
command = []
@@ -670,7 +683,7 @@ def do_upload(self) -> None:
670683
command.extend(["--port",self.port])
671684
command.extend(["--baud",baud])
672685
command.extend(["--before","default_reset","--after","no_reset","write_flash","-z","--flash_mode","dio","--flash_freq","80m","--flash_size","detect"])
673-
command.extend(["0x1000",resource_path("RTK_Surveyor.ino.bootloader.bin")])
686+
command.extend(["0x1000",theBootloaderFileName])
674687
command.extend(["0x8000",thePartitionFileName])
675688
command.extend(["0xe000",resource_path("boot_app0.bin")])
676689
command.extend(["0x10000",self.theFileName])
@@ -704,7 +717,7 @@ def esptool_reset(self) -> None:
704717
except:
705718
pass
706719

707-
sleep(1.0);
720+
sleep(1.0)
708721
self.writeMessage("Resetting ESP32\n")
709722

710723
# ---- The esptool method -----
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.6.1"
1+
__version__ = "1.7.0"

0 commit comments

Comments
 (0)