I have been following the online discussions about various methods of command line programming the mega core X devices for some time, and have had some success with various tools. I have done a project that uses a ATMEGA3208 device, and to date I have done all my programming from within Atmel Studio 7 (I had issues with MPLABX, under Linux, hanging up, and ran out of time to trouble-shoot).
We run Linux in Production, and thus I now need to program the ATMEGA3208 devices on the line, via a Linux terminal.
I can program successfully from Atmel Studio GUI (Windows VM), using an Atmel-ICE.
I can program successfully from MPLAB-IPE GUI (in Linux), using an Atmel-ICE or a PicKit4.
I can program successfully from Arduino GUI (in Linux), using Atmel-ICE(UPDI) option.
I cannot get any command line version to work, however. So frustrating.
Commands I am using:
java -jar /opt/microchip/mplabx/latest/mplab_platform/mplab_ipe/ipecmd.jar -PATMEGA3208 -TPAICE -M -Y -F"V107.hex"
java -jar /opt/microchip/mplabx/latest/mplab_platform/mplab_ipe/ipecmd.jar -PATMEGA3208 -TPPK4 -M -Y -F"V107.hex"
java -jar /opt/microchip/mplabx/latest/mplab_platform/mplab_ipe/ipecmd.jar -PATMEGA3208 -TPPK4 -M -Y -ORIUPDI -F"V107.hex"
Avrdude - this is not correct, as it needs to be atmelice_updi... but there is no option for that:
./avrdude -p m3208 -c atmelice_pdi -e -P usb -U flash:w:['V107.hex'] -B 5 -v -v
Re. MPLAB-IPE ipecmd.jar command: If you run it and print the list of supported devices, ipecmd.jar does not return a list that contains the Atmel-ICE. However, then documentation (Readme for IPECMD.htm) clearly lists it:
-TPPM3 to select the MPLAB PM3
-TPPK4 to select the MPLAB PICkit 4
-TPAICE to select the Atmel ICE
And if I use -PKAICE, I do see the tool trying to do something... but it does not succeed.
Now, my preference is for avrdude with the Atmel-ICE, as I have maintained my own version for a while, as we added custom details for programming Atmel ATA8510 devices. But... I get a failure if I try to use avrdude (my version), even with the correct config file (I added the coreX details). I only have atmelice, atmelice_isp, atmelice_dw and atmelice-pdi. In all cases the tool says that the device does not have the matching interface, which is 100% correct, as it needs to be programmed via a UPDI interface.
So my main attack has been to figure out what the Arduino guys are doing with their Atmel-ICE(UPDI) option, which works perfectly from the GUI! I have the Arduino avrdude, as well as the custom code to build their version (from Github), but it has the same error? What exactly is Arduino running to do the programming? Anyone know?