Go Down

Topic: Trouble uploading to Xplained board via Xmegaduino (Read 1 time) previous topic - next topic


Hi! I have an XmegaB1-Xplained board that i'd like to program using the Arduino IDE. I've tried to get it working using Xmegaduino, but I get an error:

Code: [Select]
java.io.IOException: Cannot run program "{path}/bin/avrdude": CreateProcess error=2, The system cannot find the file specified

My IDE works fine with my UNO, and I can program the Xmega through Atmel Studio just fine. Any suggestions appreciated!


Please provide an exact set of steps to reproduce the problem, including installation of Xmegaduino. It appears that you're using a modified version of the Xmegaduino project.


Running Windows 10. (also tried on ubuntu)
  • Install Arduino IDE from here
  • Open IDE
  • Go to File > Preferences, add the .json link from the Xmegaduino download page to the Additional Boards Manager URLs
  • Go to Tools > Board > Boards Manager, select the Xmegaduino and install
  • Connect Xplained board via USB, select it from the Tools > Board menu
  • Attempt to program but get error message as above

Am I missing something obvious?  :(


Ok, I see why I thought it was modified. The Arduino IDE automatically converts the upload recipe, thus {path} even though there is no use of {path} in the Xmegaduino platform.txt.

Which version of the Arduino IDE are you using. I'm getting a different upload error.


I figured out why I couldn't reproduce your error. You forgot to tell me to select Tools > Upload Programmer > Serial.

To fix it, do this:
  • Tools > Board > XPlain
  • File > Examples > EEPROM > eeprom_clear
  • Sketch > Show Sketch Folder
  • Navigate up 4 folder levels to the 0.7.0 folder.
  • Open platform.txt in a text editor
  • At line 59 add:

Code: [Select]
  • Save the file
  • Restart the Arduino IDE


Ooh a new error!

Code: [Select]
avrdude: stk500_recv(): programmer is not responding


Wait, what do you mean about the programmer? I'm just programming the board straight from my computer over USB, no external programmer involved. Maybe that's the problem?


What do you have selected in the Tools > Upload Programmer menu?


I've tried all of the options I think, with varying error messages, along the lines of "not found". With JTAG for example, I get
Code: [Select]
java.lang.NullPointerException at cc.arduino.packages.uploaders.SerialUploader.uploadUsingProgrammer(SerialUploader.java:314)

it then tries to upload for a long while, then fails and returns. It says it's trying to use a programmer though, which I assume is an external programmer but is not connected here. I feel like there must be a way to directly upload to the board, since it has the programmer built in as far as I understand.


Unfortunately I don't know anything about the Xplain board or ATxmega in general. I see it does create a virtual COM port through the USB jack, which would lead me to think it's possible to use the Serial programming option but you also would need a bootloader on the ATxmega to receive the data over serial and flash it to program memory, as is done on the ATmega Arduino boards. I only see mention of a bootloader on the AT90USB1287, not the ATxmega, in the manual.

AVRDUDE talks about a programmer even when you are doing an upload over serial. In that case the bootloader is the programmer. In the ATmega world we also have the option of using an external ISP programmer to upload, which also is done using AVRDUDE.


The board that the Xmega chip is built onto does, as far as I understand, have a USB bootloader on it, which I think is pretty similar to the one on the Atmega Arduino boards (link). I was hoping that there would be some way to use that to upload directly, without needing an external programmer, but I'm not sure how to get AVRDUDE to talk to it.


Have you read this?
"3.4 Programming the ATxmega128B1 through the USB interface 
The ATxmega128B1 can be programmed through the USB interface. This can be accomplished using the USB boot loader that is preprogrammed in the device. The boot loader is evoked by shorting pin 6 on J1 to GND before applying power to the board. A 100mil jumper can be used. Programming is performed through the FLIP plug-in in AVR Studio (which can also be started as a standalone application). NOTE If any external programming tool is used on the ATxmega128B1, the boot loader might be erased, and it will not be possible to program the device through the USB interface. In this case, the boot loader has to be restored (available on the Atmel website) with an external programming tool."

"3.1 Downloading the firmware 
If the on-chip Atmel ATxmega128B1 firmware needs to be downloaded into the XMEGA-B1 Xplained kit, this could be achieved by using one of the following methods: 
• Using the ATxmega128B1 on-chip DFU bootloader and FLIP (please refer to Atmel AVR1619 application note about using the on-chip DFU bootloader with ATxmega128B1) 
• Using the Atmel AVR Studio® 5 and the regular Atmel AVR tools like JTAGICE3, AVR ONE!, or JTAGICE mkII (please refer to the on-line help of AVR Studio 5 about how to use it for part programming)"

AVRDUDE is not mentioned in either document.
I don't see Atmega128B1 listed in avrdude.conf (in IDE 1.8.2, the latest I have), I would think support there would be a prerequisite, yes?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Dec 03, 2017, 12:28 am Last Edit: Dec 03, 2017, 05:35 pm by janizer
Thanks for the links!

I do have the pin 6 shorted to GND on J1, but I'm not sure I understand what the second document means about the firmware. As far as I understand from the Atmel website, the firmware comes pre-installed on the board, and I haven't erased it.

Is it possible to add boards to avrdude.conf?

edit: I did find the AtxmegaB1 in the avrdude.conf file finally, from line 13485


The avrdude.conf file in Arduino 1.8.4 supports the ATxmega128B1 mcu and the flip1 and flip2 DFU protocols.

-c flip1 or flip2 -p ATxmega128B1

Go Up