Skip to content

Add support for 8MB flash devices. #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@ jobs:
needs: [call-macos-build, call-linux-build, call-windows-build, call-python-build]
steps:
# Download the generated app files that are part of the release
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ needs.call-macos-build.outputs.build-file }}
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ needs.call-linux-build.outputs.build-file }}
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ needs.call-windows-build.outputs.build-file }}
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ needs.call-python-build.outputs.build-file }}
- name: Output Listing
run: ls -la

- name: Publish Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
${{ needs.call-macos-build.outputs.build-file }}
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

# Setup python
- name: System Setup
Expand All @@ -39,12 +39,13 @@ jobs:
- name: Build Linux Installer
run: |
ESPTOOL_LOCATION=$(pip show esptool | grep "Location: " | cut -c 11- | tr -d '\n')
ESPTOOL_TARGETS=$(echo "${ESPTOOL_LOCATION}/esptool/targets/stub_flasher/*.json:./esptool/targets/stub_flasher/")
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
ESPTOOL_TARGETS_1=$(echo "${ESPTOOL_LOCATION}/esptool/targets/stub_flasher/1/*.json:./esptool/targets/stub_flasher/1/")
ESPTOOL_TARGETS_2=$(echo "${ESPTOOL_LOCATION}/esptool/targets/stub_flasher/2/*.json:./esptool/targets/stub_flasher/2/")
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
gzip RTKUploader
mv RTKUploader.gz RTKUploader.linux.gz

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: RTKUploader.linux.gz
path: RTKUploader.linux.gz
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

# Setup python
- name: System Setup
Expand All @@ -40,13 +40,14 @@ jobs:
- name: Build Mac Installer
run: |
ESPTOOL_LOCATION=$(pip show esptool | grep "Location: " | cut -c 11- | tr -d '\n')
ESPTOOL_TARGETS=$(echo "${ESPTOOL_LOCATION}/esptool/targets/stub_flasher/*.json:./esptool/targets/stub_flasher/")
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
ESPTOOL_TARGETS_1=$(echo "${ESPTOOL_LOCATION}/esptool/targets/stub_flasher/1/*.json:./esptool/targets/stub_flasher/1/")
ESPTOOL_TARGETS_2=$(echo "${ESPTOOL_LOCATION}/esptool/targets/stub_flasher/2/*.json:./esptool/targets/stub_flasher/2/")
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
mkdir tmp
mv "RTKUploader.app" "tmp/"
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/"

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: RTKUploader.dmg
path: RTKUploader.dmg
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

# Setup python
- name: System Setup
Expand All @@ -44,7 +44,7 @@ jobs:
run: |
python setup.py sdist

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: python-install-package
path: dist
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

# Setup python
- name: System Setup
Expand All @@ -41,8 +41,9 @@ jobs:
run: |
$ESPTOOL_TARGETS = echo "$(pip show esptool | findstr "Location: ")"
$ESPTOOL_TARGETS = $ESPTOOL_TARGETS.Substring(10)
$ESPTOOL_TARGETS = echo "${ESPTOOL_TARGETS}\esptool\targets\stub_flasher\*.json;.\esptool\targets\stub_flasher\"
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
$ESPTOOL_TARGETS_1 = echo "${ESPTOOL_TARGETS}\esptool\targets\stub_flasher\1\*.json;.\esptool\targets\stub_flasher\1\"
$ESPTOOL_TARGETS_2 = echo "${ESPTOOL_TARGETS}\esptool\targets\stub_flasher\2\*.json;.\esptool\targets\stub_flasher\2\"
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

- name: Compress Installer
shell: powershell
Expand All @@ -54,7 +55,7 @@ jobs:
}
Compress-Archive @compress

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: RTKUploader.win.zip
path: RTKUploader.win.zip
Expand Down
43 changes: 28 additions & 15 deletions RTK_Firmware_Uploader/RTK_Firmware_Uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def on_worker_callback(self, *args): #msg_type, arg):
elif msg_type == AUxWorker.TYPE_FINISHED:
# finished takes 3 args - status, job type, and job id
if len(args) < 4:
self.writeMessage("Invalid parameters from the uploader.");
self.writeMessage("Invalid parameters from the uploader.")
return;

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

thePartitionFileName = ''
thePartitionFileName = resource_path("RTK_Surveyor_Partitions_16MB.bin")
firmwareSizeCorrect = True
if self.flashSize == 16:
thePartitionFileName = resource_path("RTK_Surveyor_Partitions_16MB.bin")
# if self.theFileName.find("16MB") < 0:
# firmwareSizeCorrect = False
else:
if self.flashSize == 16: # Could be RTK Firmware or RTK Everywhere
pass # Nothing to do
elif self.flashSize == 8: # RTK Postcard (ESP32 Pico Mini)
thePartitionFileName = resource_path("RTK_Everywhere_Partitions_8MB.bin")
if self.theFileName.find("RTK_Everywhere_Firmware") < 0:
self.writeMessage("Flash size is 8MB. RTK Everywhere Firmware not detected\n")
firmwareSizeCorrect = False
elif self.flashSize == 4: # Original RTK Surveyor
thePartitionFileName = resource_path("RTK_Surveyor_Partitions_4MB.bin")
# if self.theFileName.find("4MB") < 0:
# firmwareSizeCorrect = False
if self.theFileName.find("RTK_Surveyor_Firmware") < 0:
self.writeMessage("Flash size is 4MB. RTK Surveyor Firmware not detected\n")
firmwareSizeCorrect = False
else:
firmwareSizeCorrect = False

if firmwareSizeCorrect == False:
reply = QMessageBox.warning(self, "Firmware size mismatch", "Do you want to continue?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
reply = QMessageBox.warning(self, "Firmware and flash size mismatch", "Do you want to continue?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
if reply == QMessageBox.No:
self.disable_interface(False)
return

sleep(1.0);
theBootloaderFileName = resource_path("RTK_Surveyor.ino.bootloader.bin")
if self.theFileName.find("RTK_Everywhere_Firmware") >= 0:
theBootloaderFileName = resource_path("RTK_Everywhere.ino.bootloader.bin")
self.writeMessage("RTK Everywhere Firmware detected. Using RTK_Everywhere.ino.bootloader.bin\n")
else:
self.writeMessage("Using RTK_Surveyor.ino.bootloader.bin\n")

sleep(1.0)
self.writeMessage("Uploading firmware\n")

baud = self.baudRate
if baud == "921600":
if (platform.system() == "Darwin"): # 921600 fails on MacOS
self.writeMessage("MacOS detected. Limiting baud to 460800\n")
baud = "460800"
if (str(self.port_combobox.currentText()).find("CH342") >= 0): # 921600 fails on CH342
self.writeMessage("CH342 detected. Limiting baud to 460800\n")
if ((str(self.port_combobox.currentText()).find("CH342") >= 0) and (self.flashSize == 16)): # 921600 fails on CH342 + 16MB ESP32 (ie, RTK Torch)
self.writeMessage("RTK Torch detected. Limiting baud to 460800\n")
baud = "460800"

command = []
Expand All @@ -670,7 +683,7 @@ def do_upload(self) -> None:
command.extend(["--port",self.port])
command.extend(["--baud",baud])
command.extend(["--before","default_reset","--after","no_reset","write_flash","-z","--flash_mode","dio","--flash_freq","80m","--flash_size","detect"])
command.extend(["0x1000",resource_path("RTK_Surveyor.ino.bootloader.bin")])
command.extend(["0x1000",theBootloaderFileName])
command.extend(["0x8000",thePartitionFileName])
command.extend(["0xe000",resource_path("boot_app0.bin")])
command.extend(["0x10000",self.theFileName])
Expand Down Expand Up @@ -704,7 +717,7 @@ def esptool_reset(self) -> None:
except:
pass

sleep(1.0);
sleep(1.0)
self.writeMessage("Resetting ESP32\n")

# ---- The esptool method -----
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion RTK_Firmware_Uploader/resource/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.6.1"
__version__ = "1.7.0"
Loading