Get Your Open Source XPLAIN/XMEGA Programmer Here!

122 posts / 0 new
Last post
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yep, AVRDude's jiggered - no idea how you got yours working ArnoldB. I compiled from the latest source and ran some tests - AVRDude is trying to read the wrong addresses (it reads address 0x02000090UL for the signature, instead of 0x01000090UL, for example). If I force it to continue, I see the same crazily slow read speed you do when reading out normal bytes.

I think I might see if I can figure out the avrdude code, and make my own patch.

EDIT: Darn. After fixing it myself in the source, I then through to seek out ArnoldB's mentioned patch, and found it at http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=645370. Using that and the slightly updated version attached here, it all works great now.

EDIT 2: Removed updated build - see original post for latest version.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The first revision of the Xplain board was a composite device with a dual CDC class so both programmer and serial interface was available at the same time.

This can be achieved by using the association descriptors in the USB which will wrap each of the CDC in it's own class. However, Windows XP SP2 do not have drivers that support this without manually updating the usbser.sys and another .sys file. Updates available at microsoft.com. The SP3 do however include this so it will work without any magic updates.

Dean can probably make this work without any jumpers or such and use the driver (.inf) file for the rev1 of the Xplain. It's in the zip-file for the Xplain at www.atmel.com/xplain.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SuperAVRMan,

The Atmel firmware apparently uses a CDC interface for the programming; what host side application is Atmel using to program the XPLAIN? That method won't work here as my version clones a full AVRISP-MKII (including the V2 protocol and ISP/PDI programming modes) which can't be part of a composite device.

Also, if Atmel has a semi-complete version already made, why isn't it in general use?

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using Ubuntu 9.04, an avrdude 5.8 compiled from original source with the PDI patch.

With the R2 version it still takes 25 seconds for dumping the first 256 bytes of flash. And avrdude crashes on a second attempt:

$ avrdude -p atxmega128a1 -c avrispmkII -P usb -t

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.30s

avrdude: Device signature = 0x1e974c
avrdude> dump flash 0 256
>>> dump flash 0 256 
0000  0c 94 fa 00 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|
0010  0c 94 1c 01 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|
0020  0c 94 1c 01 0c 94 1c 01  0c 94 d7 06 0c 94 1c 01  | ... ... ... ...|
0030  0c 94 1c 01 0c 94 1c 01  0c 94 24 06 0c 94 1c 01  | ... ... .$. ...|
0040  0c 94 1c 01 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|
0050  0c 94 1c 01 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|
0060  0c 94 1c 01 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|
0070  0c 94 1c 01 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|
0080  0c 94 1c 01 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|
0090  0c 94 1c 01 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|
00a0  0c 94 1c 01 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|
00b0  0c 94 1c 01 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|
00c0  0c 94 1c 01 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|
00d0  0c 94 1c 01 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|
00e0  0c 94 1c 01 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|
00f0  0c 94 1c 01 0c 94 1c 01  0c 94 1c 01 0c 94 1c 01  | ... ... ... ...|

avrdude> dump flash 0 256
>>> dump flash 0 256 
avrdude: usbdev_send(): wrote 0 out of 1 bytes, err = No error
avrdude: stk500_send_mk2(): failed to send command to serial port
$

The USB interface is still there, and when starting avrdude again I can again read the flash (at the low rate).

So the crash must be something inside avrdude.

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Congratulations Dean.

You are a pretty smart guy and I am sure Atmel with consider you in their future plans (Better they do it soon or they will lose the opportunity).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I am using Ubuntu 9.04, an avrdude 5.8 compiled from original source with the PDI patch.

With the R2 version it still takes 25 seconds for dumping the first 256 bytes of flash. And avrdude crashes on a second attempt:

Try using non terminal mode -- that's what I tested with and what appears to work great (with the patched version). Try this:

$ avrdude -p atxmega128a1 -c avrispmkII -P usb -U flash:r:FIRMWARE.hex

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hallo,

thanks to Dean for his great work! I've just downloaded the newest LUFA and tried to get the Xplain bridge to work. I could build the project for the 1287 with no errors in Studio 4.18 Build 692

Program: 4190 bytes (3.2% Full)
(.text + .data + .bootloader)

Data: 307 bytes (3.7% Full)
(.data + .bss + .noinit)

Flip succeeded in programming and Windows XP SP3 shows a 'LUFA XPLAIN Bridge' I set the driver to the 'LUFA XPLAIN Bridge.inf' file and get a 'communications port'

But the AVRstudio is not able to connect to an AVRISP mkII using an USB connection.

Does anybody know where the fault is?

Thanks and greetings from Germany

Eumel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Eumel,

The XPLAINBridge code is for making a USB to Serial bridge between the XMEGA and the host for communications -- but not for programming. To be able to make the XPLAIN board appear as a AVRISP-MKII for programming of the XMEGA, you'll instead need to compile and flash the "AVRISP" project in LUFA, compiled for the XPLAIN board.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you very much Dean!

Merry Christmas to you and your family.

Greetings from the cold (and a little bit snowy) north west Germany
Einhart

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now it works! I'm able to read the Xmegas signature.

Again, thank you Dean. LUFA is the best project I've seen so far - perfect working and well documented code.

Greetings

Pages