Skip to content

Commit 18385bf

Browse files
authored
Merge pull request #20 from sparkfun/develop
Version 3.1.0
2 parents 53836aa + fae20fa commit 18385bf

23 files changed

+148
-77
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
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: 4 additions & 4 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
@@ -42,7 +42,7 @@ jobs:
4242
gzip ArtemisUploader
4343
mv ArtemisUploader.gz ArtemisUploader.linux.gz
4444
45-
- uses: actions/upload-artifact@v3
45+
- uses: actions/upload-artifact@v4
4646
with:
4747
name: ArtemisUploader.linux.gz
4848
path: ArtemisUploader.linux.gz

.github/workflows/build-macos.yml

Lines changed: 4 additions & 4 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
@@ -44,7 +44,7 @@ jobs:
4444
mv "ArtemisUploader.app" "tmp/"
4545
create-dmg --volicon "artemis_uploader/resource/sparkdisk.icns" --background "artemis_uploader/resource/sfe_logo_med.png" --hide-extension "ArtemisUploader.app" --icon "ArtemisUploader.app" 100 100 --window-size 600 440 --app-drop-link 400 100 "ArtemisUploader.dmg" "tmp/"
4646
47-
- uses: actions/upload-artifact@v3
47+
- uses: actions/upload-artifact@v4
4848
with:
4949
name: ArtemisUploader.dmg
5050
path: ArtemisUploader.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: 4 additions & 4 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
@@ -50,7 +50,7 @@ jobs:
5050
}
5151
Compress-Archive @compress
5252
53-
- uses: actions/upload-artifact@v3
53+
- uses: actions/upload-artifact@v4
5454
with:
5555
name: ArtemisUploader.win.zip
5656
path: ArtemisUploader.win.zip

README.md

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ If you need to install the application, see the [Installation Section](#installa
2727
* Attach the Artemis target board over USB
2828
* Select the COM port from the dropdown menu
2929
* Adjust the Baud Rate as desired
30-
* Click the ```Upload Firmware``` Button in the lower left of the app.
30+
* Click the ```Upload Firmware``` Button in the lower right corner of the app.
3131

3232
The selected firmware is then uploaded to the connected SparkFun Artemis product. Upload information and progress are displayed in the output portion of the interface.
3333

@@ -49,36 +49,70 @@ Installation binaries are available for all major platforms (macOS, Window, and
4949
### Windows
5050
* Download the [github release](https://github.com/sparkfun/Artemis-Firmware-Upload-GUI/releases) zip file - *ArtemisUploader.win.zip*
5151
* Unzip the release file - *ArtemisUploader.zip*
52-
* This results in the application executable, *ArtemisUploader.exe*
52+
* This results in the application executable *ArtemisUploader.exe*
5353
* Double-click *ArtemisUploader.exe* to start the application
54+
* The Windows EXE isn't signed, so you will see the following warning. Click **More info**:
5455

55-
![macOS Artemis Uploader](images/artemis-windows.png)
56+
![Artemis Uploader on Windows - Warning 1](images/artemis-windows-1.png)
57+
58+
* Click **Run anyway** to start the GUI:
59+
60+
![Artemis Uploader on Windows - Warning 2](images/artemis-windows-2.png)
61+
62+
![Artemis Uploader on Windows](images/artemis-windows.png)
5663

5764
### macOS
65+
66+
* Check that you have the latest WCH drivers installed for the CH340 interface chip.
67+
* Full instructions can be found in our [CH340 Tutorial](https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all#mac-osx)
68+
* Here is a link to the WCH downloads page for the [CH340 / CH341 macOS driver](https://www.wch-ic.com/downloads/CH341SER_MAC_ZIP.html)
69+
* The Zip file contains more instructions: CH34X_DRV_INSTAL_INSTRUCTIONS.pdf
70+
5871
* Download the [github release](https://github.com/sparkfun/Artemis-Firmware-Upload-GUI/releases) file - *ArtemisUploader.dmg*
59-
* Double click on the file to unzip the file to *ArtemisUploader.dmg*
60-
* Double click the *ArtemisUploader.dmg* file to mount the disk image.
72+
* Click on the downloads icon
73+
* Click the *ArtemisUploader.dmg* file to mount the disk image
6174
* The following Finder window, with the contents of the file will open
6275

6376
![Artemis Uploader macOS Finder](images/macos-finder.png)
6477

65-
* Install the *ArtemisUploader.app* by dragging it on the *Applications* in the ArtemisUploader Finder Window, or copying the file to a desired location.
66-
* Once complete, unmount the ArtemisUploader disk image by right-clicking on the mounted disk in Finder and ejecting it.
78+
* Install the *ArtemisUploader.app* by dragging it onto the *Applications* icon in the ArtemisUploader Finder Window, or copying the file to a desired location.
79+
* Once complete, unmount the ArtemisUploader disk image by clicking on the disk eject in Finder.
80+
81+
![Artemis Uploader macOS Finder](images/artemis-macos-install-1.png)
6782

6883
To launch the Artemis Uploader application:
84+
6985
* Double-click ArtemisUploader.app to launch the application
70-
* The ArtemisUploader.app isn't signed, so macOS won't run the application, and will display a warning dialog. Dismiss this dialog.
71-
* To approve app execution bring up the macOS *System Preferences* and navigate to: *Security & Privacy > General*.
72-
* On this page, select the *Open Anyway* button to launch the ArtemisUploader application.
7386

87+
![Artemis Uploader macOS Finder](images/artemis-macos-install-2.png)
88+
89+
* The ArtemisUploader.app isn't signed, so macOS won't run the application, and will display a warning dialog. Click **Done**.
90+
91+
![Artemis Uploader macOS Finder](images/artemis-macos-install-3.png)
7492

75-
![macOS Security](images/macos-security.png)
93+
* To approve app execution bring up the macOS *System Settings* and navigate to *Privacy & Security*.
94+
* On this page, select the **Open Anyway** button to launch the ArtemisUploader application.
7695

77-
* Once selected, macOS will present one last dialog. Select *Open* to run the application. The ArtemisUploader will now start.
96+
![Artemis Uploader macOS System Settings](images/artemis-macos-install-4.png)
7897

79-
![macOS Artemis Uploader](images/artemis-macos.png)
98+
* Once selected, macOS will present one last dialog. Select **Open Anyway** to run the application.
99+
100+
![Artemis Uploader macOS System Settings](images/artemis-macos-install-5.png)
101+
102+
* Enter your password and click The ArtemisUploader will now start.
103+
104+
![Artemis Uploader macOS System Settings](images/artemis-macos-install-6.png)
105+
106+
* Ensure you select the correct *COM Port*. The port name should begin with **cu.wchusbserial**.
107+
108+
![macOS Artemis Uploader](images/artemis-macos-1.png)
109+
110+
* When you select the *Firmware File*, click **Allow** to allow the app to open the file.
111+
112+
![macOS Artemis Uploader](images/artemis-macos-2.png)
80113

81114
### Linux
115+
82116
* Download the [github release](https://github.com/sparkfun/Artemis-Firmware-Upload-GUI/releases) file - *ArtemisUploader.linux.gz*
83117
* Unzip the release file - *ArtemisUploader.linux.gz*
84118
* Un-gzip the file, either by double-clicking in on the desktop, or using the `gunzip` command in a terminal window. This results in the file *ArtemisUploader*
@@ -87,7 +121,6 @@ To launch the Artemis Uploader application:
87121

88122
![Linux Artemis Uploader](images/artemis-linux.png)
89123

90-
91124
### Python Package
92125
The Artemis Uploader App is also provided as an installable Python package. This is advantageous for platforms that lack a pre-compiled application.
93126

artemis_uploader/artemis_svl.py

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -365,34 +365,50 @@ def upload_firmware(binfile, port, baud, timeout=0.5):
365365
bl_success = False
366366
entered_bootloader = False
367367

368-
for _ in range(num_tries):
368+
# Instantiate ser here and set dtr and rts before opening the port
369+
ser = serial.Serial()
370+
ser.port = port
371+
ser.baudrate = baud
372+
ser.timeout = timeout
369373

370-
with serial.Serial(port, baud, timeout=timeout) as ser:
374+
attempt = 0
371375

372-
# startup time for Artemis bootloader (experimentally determined - 0.095 sec min delay)
373-
t_su = 0.15
376+
while (attempt < num_tries) and (bl_success == False):
374377

375-
time.sleep(t_su) # Allow Artemis to come out of reset
378+
# Set dtr and rts before opening the port
379+
# https://community.sparkfun.com/t/unable-to-flash-artemis-thing-plus-on-macos-sequoia/60766/6
380+
ser.dtr=False
381+
ser.rts=False
376382

377-
# Perform baud rate negotiation
378-
entered_bootloader = phase_setup(ser)
383+
ser.open()
379384

380-
if(entered_bootloader == True):
381-
bl_success = phase_bootload(ser, binfile)
382-
if(bl_success == True): # Bootload
383-
#print("Bootload complete!")
384-
break
385-
else:
386-
verboseprint("Failed to enter bootload phase")
385+
ser.dtr=True # True sets the CH340 RTS pin low
386+
ser.rts=True
387387

388+
# startup time for Artemis bootloader (experimentally determined - 0.095 sec min delay)
389+
t_su = 0.15
388390

391+
time.sleep(t_su) # Allow Artemis to come out of reset
389392

390-
if(bl_success == True):
391-
break
393+
ser.reset_input_buffer() # reset the input bufer to discard any UART traffic that the device may have generated
392394

393-
if(entered_bootloader == False):
394-
print(
395-
"Target failed to enter bootload mode. Verify the right COM port is selected and that your board has the SVL bootloader.")
395+
# Perform baud rate negotiation
396+
entered_bootloader = phase_setup(ser)
397+
398+
if(entered_bootloader == True):
399+
bl_success = phase_bootload(ser, binfile)
400+
else:
401+
verboseprint("Failed to enter bootload phase")
402+
403+
ser.close()
404+
attempt = attempt + 1
405+
406+
if (entered_bootloader == False):
407+
print("Target failed to enter bootload mode. Verify the right COM port is selected and that your board has the SVL bootloader.")
408+
elif (bl_success == False):
409+
print("Target entered bootloader mode but firmware upload failed. Verify the right COM port is selected and that your board has the SVL bootloader.")
410+
else:
411+
print("Success!")
396412

397413
except serial.SerialException:
398414
phase_serial_port_help(port)

artemis_uploader/asb/asb.py

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,17 @@ def upload(args, verboseprint):
378378
connection_timeout = 5
379379

380380
print('Connecting over serial port {}...'.format(args.port), flush=True)
381-
print('Baud rate:',args.baud)
381+
print('Requested baud rate:',args.baud)
382+
383+
useBaud = int(args.baud)
384+
if (useBaud > 115200):
385+
print('Limiting baud rate to 115200')
386+
useBaud = 115200
387+
useBaud = str(useBaud)
382388

383389
#Check to see if the com port is available
384390
try:
385-
with serial.Serial(args.port, args.baud, timeout=connection_timeout) as ser:
391+
with serial.Serial(args.port, useBaud, timeout=connection_timeout) as ser:
386392
pass
387393
except:
388394

@@ -413,43 +419,56 @@ def upload(args, verboseprint):
413419
#fails to correctly catch the BOOT signal about 1 out of ten times.
414420
#Auto-retry this number of times before we give up.
415421

422+
# Instantiate ser here and set dtr and rts before opening the port
423+
ser = serial.Serial()
424+
ser.port = args.port
425+
ser.baudrate = useBaud
426+
ser.timeout = connection_timeout
427+
416428
loadTries = 0
417429

418430
while loadTries < 3:
419431
loadSuccess = False
420432

421-
with serial.Serial(args.port, args.baud, timeout=connection_timeout) as ser:
422-
#DTR is driven low when serial port open. DTR has now pulled RST low.
433+
# Set dtr and rts before opening the port
434+
ser.dtr=True
435+
ser.rts=True
423436

424-
time.sleep(0.01) #3ms and 10ms work well. Not 50, and not 0.
437+
ser.open()
425438

426-
#Setting RTS/DTR high causes the bootload pin to go high, then fall across 100ms
427-
ser.setDTR(0) #Set DTR high
428-
ser.setRTS(0) #Set RTS high - support the CH340E
439+
# RTS behaves differently on macOS. Use a double-reset
440+
time.sleep(0.01)
441+
ser.dtr=False # Set RTS and DTR high
442+
ser.rts=False
443+
time.sleep(0.01)
444+
ser.dtr=True # Set RTS and DTR low
445+
ser.rts=True
429446

430-
time.sleep(0.01) #A double-reset seems to work best on macOS
431-
ser.setDTR(1)
432-
ser.setRTS(1)
447+
time.sleep(0.008) #3ms and 10ms work well. Not 50, and not 0.
433448

434-
time.sleep(0.01)
435-
ser.setDTR(0)
436-
ser.setRTS(0)
449+
# Set RTS and DTR high
450+
# This causes BOOT to go high - and then decay back to zero
451+
ser.dtr=False
452+
ser.rts=False
437453

438-
#Give bootloader a chance to run and check bootload pin before communication begins. But must initiate com before bootloader timeout of 250ms.
439-
time.sleep(0.100) #100ms works well
454+
#Give bootloader a chance to run and check BOOT pin before communication begins. But must initiate com before bootloader timeout of 250ms.
455+
time.sleep(0.1) # 100ms works well
440456

441-
ser.reset_input_buffer() # reset the input bufer to discard any UART traffic that the device may have generated
457+
ser.reset_input_buffer() # reset the input bufer to discard any UART traffic that the device may have generated
442458

443-
connect_device(ser, args, verboseprint)
459+
connect_device(ser, args, verboseprint)
444460

445-
loadTries = loadTries + 1
446-
447-
if(loadSuccess == True):
448-
print("Tries =", loadTries)
449-
print('Upload complete')
450-
exit()
451-
else:
452-
print("Fail")
461+
loadTries = loadTries + 1
462+
463+
if(loadSuccess == True):
464+
ser.close()
465+
print("Tries =", loadTries)
466+
print('Upload complete')
467+
exit()
468+
else:
469+
print("Fail")
470+
471+
ser.close()
453472

454473
print("Tries =", loadTries)
455474
print("Upload failed")

artemis_uploader/resource/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.0.0"
1+
__version__ = "3.1.0"

images/artemis-macos-1.png

108 KB
Loading

images/artemis-macos-2.png

108 KB
Loading

images/artemis-macos-install-1.png

73.7 KB
Loading

images/artemis-macos-install-2.png

218 KB
Loading

images/artemis-macos-install-3.png

213 KB
Loading

images/artemis-macos-install-4.png

190 KB
Loading

images/artemis-macos-install-5.png

251 KB
Loading

images/artemis-macos-install-6.png

237 KB
Loading

images/artemis-macos.png

-133 KB
Binary file not shown.

images/artemis-windows-1.png

26.1 KB
Loading

images/artemis-windows-2.png

29.4 KB
Loading

images/artemis-windows.png

-23 KB
Loading

images/macos-security.png

-242 KB
Binary file not shown.

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ def get_version(rel_path: str) -> str:
128128
'Programming Language :: Python :: 3.7',
129129
'Programming Language :: Python :: 3.8',
130130
'Programming Language :: Python :: 3.9',
131+
'Programming Language :: Python :: 3.10',
132+
'Programming Language :: Python :: 3.11',
133+
'Programming Language :: Python :: 3.12',
131134

132135
],
133136

0 commit comments

Comments
 (0)