-
-
Notifications
You must be signed in to change notification settings - Fork 445
Uploading with multiple programmers attached does not work #2254
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
Comments
Hi @CreativeRobotics. If you enable Show verbose output during:
This is because nEDBG programmer that is used for the upload is a pure USB device, which is identified in the upload command only by using its VID/PID pair ( There is sometimes a mechanism for uniquely identifying specific hardware instances. In the case of serial ports, this is a serial number. AVRDUDE supports the use of the serial number in the upload command via Modern versions of Arduino IDE do make the serial number associated with a selected serial port accessible for use in the upload command via the https://arduino.github.io/arduino-cli/latest/platform-specification/#pluggable-discovery So in theory this change to the "megaTinyCore" platform could solve the problem of the diff --git a/megaavr/platform.txt b/megaavr/platform.txt
index bbf02bf7..c4de0e83 100644
--- a/megaavr/platform.txt
+++ b/megaavr/platform.txt
@@ -174,6 +174,15 @@ tools.avrdude.program.params.quiet=-q -q
tools.avrdude.program.params.noverify=-V
tools.avrdude.program.pattern={upload.prog_interlock}"{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} "-Ufuse0:w:{bootloader.WDTCFG}:m" "-Ufuse2:w:{bootloader.OSCCFG}:m" "-Ufuse5:w:{bootloader.SYSCFG0}:m" "-Ufuse6:w:{bootloader.SYSCFG1}:m" "-Ufuse7:w:{bootloader.APPEND}:m" "-Ufuse8:w:{bootloader.BOOTEND}:m" "-Uflash:w:{build.path}/{build.project_name}.hex:i"
+## This tool targets the specific device instance with the serial number obtained via the selected serial port.
+tools.avrdude-with-sn.path={runtime.tools.avrdude.path}
+tools.avrdude-with-sn.cmd.path={path}/bin/avrdude
+tools.avrdude-with-sn.config.path={runtime.platform.path}/avrdude.conf
+tools.avrdude-with-sn.program.params.verbose=-v
+tools.avrdude-with-sn.program.params.quiet=-q -q
+tools.avrdude-with-sn.program.params.noverify=-V
+tools.avrdude-with-sn.program.pattern={upload.prog_interlock}"{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} -Pusb:{upload.port.properties.serialNumber} "-Ufuse0:w:{bootloader.WDTCFG}:m" "-Ufuse2:w:{bootloader.OSCCFG}:m" "-Ufuse5:w:{bootloader.SYSCFG0}:m" "-Ufuse6:w:{bootloader.SYSCFG1}:m" "-Ufuse7:w:{bootloader.APPEND}:m" "-Ufuse8:w:{bootloader.BOOTEND}:m" "-Uflash:w:{build.path}/{build.project_name}.hex:i"
+
## Used for "upload" through bootloader
tools.avrdude.upload.params.verbose=-v
tools.avrdude.upload.params.quiet=-q -q
diff --git a/megaavr/programmers.txt b/megaavr/programmers.txt
index cdc7aa20..ba497a59 100644
--- a/megaavr/programmers.txt
+++ b/megaavr/programmers.txt
@@ -59,7 +59,10 @@ nedbg.name=Curiosity Nano (nEDBG, debug chip: ATSAMD21E18)
nedbg.communication=usb
nedbg.protocol=curiosity_updi
nedbg.program.protocol=curiosity_updi
+# This tool recipe will be used as a fallback by development tools that don't have pluggable discovery support.
nedbg.program.tool=avrdude
+# This tool recipe will be used by development tools that do have pluggable discovery support.
+nedbg.program.tool.default=avrdude-with-sn
nedbg.program.extra_params=-Pusb
edbg.name=Xplained Pro (EDBG, debug chip: AT32UC3A4256) I have used this successfully with other devices but I don't own an nEDBG device so I can't test it. I do own an ATtiny817 Xplained Mini, which has the mEDBG instead of the nEDBG. I tried applying the patch above to the "Xplained Mini (mEDBG, debug chip: ATmega32u4)" programmer of megaTinyCore. Unfortunately I find that the upload fails:
It seems that the "ATML2658061800005922" serial number produced by the mEDBG is somehow not accepted by AVRDUDE, even though I have verified using operating system tools ( I don't know whether that same problem occurs with the nEDBG. What I do know is that this has nothing to do with the Arduino IDE codebase hosted in this repository so I will close this as off topic. If you have any questions or would like to discuss the subject further, feel free to make a topic on Arduino Forum: Semi-related (but different since in this case we do have a discovered port that provides us with the serial number): arduino/arduino-cli#770 |
Thanks, I suspected this might be the case, but I thought it was worth posting an issue just in case there was a fix. |
Describe the problem
I have a setup with two boards, each with an embedded debugger (Curiosity Nano dev boards with ATTiny 3227 MCU and the Mega Tiny Core)
Both are recognised as comm ports and I can work with two IDE windows using both serial interfaces.
If I try and upload with "Upload using programmer" it will always use the same programmer regardless of which IDE window I am using.
To reproduce
Connect two curiosity nano boards
Open two different sketches with Arduino
Upload using programmer from one instance
Upload from the second instance
Expected behavior
This ought to behave the same way that it does when using two boards simultaniously with two sketches with USB or serial bootloaders.
Arduino should be able to recognise if multiple programmers are attached as USB devices, just as it recognises multiple COMM ports.
Multiple debugger/programmers should be selectable for each Arduino IDE window, as happens with COMM ports.
Arduino IDE version
2.2.1
Operating system
Windows
Operating system version
10
Additional context
I am developing a board to board comm system so it helps to have both boards connected. The devices are too small for bootloaders so I have to use the programmers. If they had serial bootloaders then this setup would work properly because each window would be connected to a different serial port.
*Edited because I realised that the IDE is a single instance, even when using multiple sketches.
Issue checklist
The text was updated successfully, but these errors were encountered: