Building bootloader for ATXMega16A4U from avr1916.zip

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Newbie question. All I want to do is to build the standard bootloader for the ATXMega16A4U chip.

I've downloaded the zip file with the source in but I don't see anything resembling a project file.

I did find some files with *.ewd,*ewp,*eww extensions but I can't import these into atmel studio 6.

So how do I go about building the bootloader?? Any help would be most appreciated.

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

Which bootloader? There isn't a "standard" one.

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

Quote:

Which bootloader? There isn't a "standard" one.

I thought all Atmel USB chips came preloaded with "DFU". Is that not the case with Xmega-U chips then?
Quote:
I did find some files with *.ewd,*ewp,*eww extensions but I can't import these into atmel studio 6.

Those are IAR files I think. The "Kicstart" version of IAR can generate up to 4KB so as long as the bootloader is smaller then you should be able to build it with the "free" version. If it turns out to be bigger you may have a slight problem as the full version of IAR for AVR is $3,000.

These days Atmel usually tend to provide both IAr and GCC files for any example code so I'd be surprised if there aren't also files there for use with GCC.

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

Quote:
I did find some files with *.ewd,*ewp,*eww extensions but I can't import these into atmel studio 6.

These are IAR project files. You will probably have to do a bit of 'porting' to avr-gcc. It should not be difficult.

Most 'older' app notes were written exclusively for IAR. Nowadays, they tend to support both IAR and GCC.

Note that it is relatively trivial to port most app notes to GCC, CodeVision or Imagecraft.

No, I have not looked at AVR1916. Is it the Flip DFU bootloader ?

David.

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

Quote:

Is it the Flip DFU bootloader ?

atmel.com wrote:
Atmel AVR1916: USB DFU Boot Loader for Atmel XMEGA
(file size: 670KB, 13 pages, revision B, updated: 07/2012)

The Atmel® AVR® XMEGA® devices now make easy to implement and use USB.

The USB boot loader allows performing in-system programming (ISP) from a USB host controller without removing the part from the system, and without any external programming interface other than the USB connector.


I was prompted to look at atmel.com and have a look in the .zip file. It's true there only appear to be project files for IAR's embedded workbench (EW) but most of the source seems to have both GCC and IAR paths through it so I have a feeling that it might be buildable in GCC though the (unthinkably stupid!) nesting of files/directories that Atmel use look like it could be a right old can of worms trying to persuade it to "see" all the right files in the right places.

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

XMega USB chips do NOT ship with a bootloader.

IAR is "required" to get the bootloader into the 4k of flash that the 16a4u has available for bootloaders. The IAR free kickstart edition is able to compile it, since it comes in under 4k.

While I'm sure GCC could compile it, I think you'd have a devil of a time getting it small enough. That's why there's no Atmel Studio project or GCC makefile.

I usually just disassemble Atmel's binaries and hex edit the instructions to the desired opcodes (e.g. to remove the pin check routine). Then there are no legal issues with IAR.

Jeff Nichols

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

Quote:

While I'm sure GCC could compile it, I think you'd have a devil of a time getting it small enough.

Oh I don't know - is it really THAT close? GCC probably only lags IAR by about 5% these days. On 4096 bytes that would be 205 bytes. OTOH if there are less than 205 bytes in the 4K BLS with the IAR code I guess it could be a squeeze.

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

Does anyone use the DFU code anyway? It seems to be virtually abandoned and poorly documented. I evaluated it for a product and ended up just writing my own.

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

Well what makes it nice is that you can get started with an Atmel USB chip with nothing more than an A-B lead. There's little advantage for anyone with any form of ISP/JTAG/PDI but certainly for beginners you could see the appeal.(*)

(*) or rather you could if the Java Flip! application wasn't the biggest pile of steaming dung the planet has ever endured.

It is quite a surprise that X-U chips don't come with some kind of bootloader though something that just did Ymodem over CDC-ACM and could be driven from any terminal program might be better than something requiring proprietary software that crashes a lot. However loaders that crash a lot seem to be Atmel's forte. I have a lot of experience of their SAMBA for ATSAM9 as well and it makes Flip! look really good.