"Erase only program area" does not work in AS6

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

Hi.

I am using Atmel Studio 6 SP1 with an XMEGA128D3 and 128A3U. I am programming with an AVRISP mkII over PDI. If I select "Erase only program area" programming appears to complete but the flash memory is corrupt.

In my HEX file I have:

:100000000C94040B0C942F0B0C942F0B0C942F0BB3

In the actual flash read back with the AVRISP mkII I have:

:100000000C9404090C9422090C9422090C942209E2

If I change to "Erase entire chip" everything works and the flash memory matches the HEX file.

This is a bit of a problem because it erases the bootloader. Long story short the bootloader is quite slow so I want to use the AVRISP mkII for development, but need the bootloader to be in place for the application to perform certain functions. I tried combining the bootloader and application but could not find an automated way to do it in AS6, even with scripts in the build process.

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

PS. I opened a bug report: http://asf.atmel.com/bugzilla/sh...

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

Quote:

. I tried combining the bootloader and application but could not find an automated way to do it in AS6, even with scripts in the build process.

That's actually the best way - there's been a couple of fairly extensive threads about this recently. It basically involves using avr-objcopy to convert the bootloader.hex back into a bootloader.bin then using it again to convert bootloader.bin to a linkable bootloader.o that can be linked onto the end of the app code. I'll see if I can ferret out the threads...

EDIT: not the one I'm thinking of but useful maybe..

https://www.avrfreaks.net/index.p...

ah this was the oneI was thinking of:

https://www.avrfreaks.net/index.p...

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

Thanks clawson, there is some useful information there that I had not read since it was posted after I last looked. There are so many useful threads on AVR Freaks it can be hard to keep up :)

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

Sorry for the mega-bump but I just updated the bug report because AS6.1 is still broken.

At the moment my solution is to use the pre-build event and some linker hackery to combine the bootloader into the .elf file which is then loaded onto the XMEGA during development. It is not very portable or robust but works.

Does anyone else have this problem? It isn't going to be fixed until at least the next version of Atmel Studio now, which is probably a long away off. In the mean time developing apps that require a bootloader for the application to function is extremely difficult.