I'm attempting to figure out how to mass-upload a single Arduino INO
sketch file to several different microcontrollers on a Windows 10 system.
It was understanding that, every time that the Arduino IDE compiles & uploads an INO
sketch, it essentially calls the avrdude.exe
executable in the installed Arduino directory. Therefore, I assumed it would be possible to create some sort of a Windows batch script that manually executes that file, and uploads the sketch to a given COM port connected to my Windows 10 system. In fact, an answer to a simillar Arduino Forums post some time ago has provided a potential solution in the following batch script:
@echo off
SET FILE_TO_UPLOAD=%1
SET ARDUINO_DIR="C:\Program Files (x86)\arduino"
@echo off
for /f "tokens=*" %%a in (ports2.txt) do (
echo Com Port for Arduino device is detected as %comport%.
echo --------------------------------------- & echo Uploading to: %%a & "C:\Program Files (x86)\arduino\hardware\tools\avr\bin\avrdude.exe" -C "C:\Program Files (x86)\arduino\hardware\tools\avr\etc\avrdude.conf" -p atmega328p -c arduino -P %%a -b 115200 -D -V -U flash:w:%FILE_TO_UPLOAD%:i
)
pause
However, it appears that the latest verions of the Arduino IDE (v2.3.3 in my case) does not store it's data in "C:\Program Files (x86)\arduino"
anymore. I saw in other simillar examples that the avrdude.exe
path is referenced as "Applications\Arduino\"
, yet that path does not exist on my Arduino IDE version either. The installation path for my Arduino IDE instance appears to be "C:\Users\*user*\AppData\Local\Programs\Arduino IDE\"
, and in that directory there is no trace of avrdude.exe
.
I'm therefore assuming that the latest versions of the Arduino IDE have a different method of compiling & uploading sketches without avrdude.exe
, so I'm assuming that the batch sketch uploading method using avrdude.exe
referenced in the previous post answer does not work anymore with the latest versions of the Arduino IDE.
Moreover, this specific example appears to always specify specifically what type of boards to upload to (atmega328p
in the specific example above), and what I'm looking for is a method of uploading to several different types of microcontrollers.
A different StackExchange answer provided a method of uploading a sketch to several Arduinos connected in series. However, what I'm looking for is a method of mass-uploading to several microcontrollers in parallel, all connected to separate COM ports.
Another Arduino Forums post showcases a method of mass-uploading via a custom-made circuit that uses another Arduino NANO to "forward" the code to several Arduino NANOs. However, this method relies on an intermediary microcontroller for "forwarding" the code to the remainder of the connected microcontrollers through a custom circuit, yet what I'm looking for is just uploading to a bunch of microcontrollers connected in parallel via several USB connections to COM ports on my Windows system.
Is it possible to mass-upload a single Arduino INO
sketch to several different microcontrollers via some sort of batch script on a Windows 10 system? What kind of a Windows batch script, if any, would achieve such a goal?
Thanks for reading my post, any guidance is appreciated.