xmega32D3 AVRDUDE config

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

Hi guys,

 

I have an ATXMega32D3 hooked up to a bluetooth chip and I would like to be able to reprogram it using a bootloader. I found https://github.com/bandtank/Xmega_Bootloader and installed it to my board. Then using AVRDUDE I ran 

avrdude -p x32d3 -P com6 -b 9600 -c avr911 -U flash:w:ClipCounter.hex

Since AVRDUDE does not currently support the xmega32d3 I had to add it to the config file

 


#------------------------------------------------------------
# ATxmega32D3
#------------------------------------------------------------

part parent ".xmega"
    id		= "x32d3";
    desc	= "ATxmega32D3";
    signature	= 0x1e 0x95 0x4a;

	memory "eeprom"
        size		= 0x0800;
        offset		= 0x08c0000;
        page_size	= 0x20;
        readsize	= 0x100;
    ;

    memory "application"
        size		= 0x00008000;
        offset		= 0x0800000;
        page_size	= 0x100;
        readsize	= 0x100;
    ;

    memory "apptable"
        size		= 0x00000800;
        offset		= 0x00800000;
        page_size	= 0x100;
        readsize	= 0x100;
    ;

    memory "boot"
        size		= 0x00000800;
        offset		= 0x00808000;
        page_size	= 0x100;
        readsize	= 0x100;
    ;

    memory "flash"
        size		= 0x00008800;
        offset		= 0x0800000;
        page_size	= 0x100;
        readsize	= 0x100;
    ;

    memory "usersig"
        size		= 0x200;
        offset		= 0x8e0400;
        page_size	= 0x100;
        readsize	= 0x100;
    ;
;

I believe that some of the values are wrong because when I try to upload a test program I get this:

This topic has a solution.

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

I don't know.  I'm surprised avrdude doesn't quit after reporting ****failed;.  I wonder what  failed. 

 

I guess avrdude was able to read the programmer ID from the AVR etc., because my avrdude quits if it can't do that.

 

Here is what a good session looks like:

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I got a similar error and I solved it by adding option -e: http://www.avrfreaks.net/forum/x...

 

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

Wow well that was simple. Thanks! The -e option fixed everything.

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

This is a very bizarre problem.  Normally it works for me without the -e option.  The failure depends on where I run avrdude, and with which shell.

 

The only time I have seen the failure is when I'm testing and I run from: 

But if I back up one directory and run from here:

I don't get the failure.

 

But even when I'm in the first directory, I don't get the failure if I use sh instead of powershell or cmd.  sh is the Linux type shell included in winavr. 

 

The failures start happening right after avrdude reads the device signature.  While avrdude is reporting failures it is not sending anything to the bootloader and is not receiving anything from the bootloader.  The last thing avrdude sends before the failures is the 's' command which requests the bootloader to send the device signature, and the last thing the bootloader sends is that signature.

 

At this point I think avrdude is deciding whether to erase all the application flash at once (and the EEPROM), which is what the -e option does in this bootloader, or erase each flash page just before it is written.

Last Edited: Fri. Oct 24, 2014 - 11:05 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seems I was wrong about the -e option.  Avrdude does a "chip erase" whether the -e option is present or not.  As far as I can tell the -e option has no effect except to prevent the ***failed; stuff.

 

Actually I can eliminate those ***failed; things by using the -D option instead of the -e option.  The -D option causes avrdude to not do any erase so your flash programming will be bad unless the flash is already erased.

Last Edited: Fri. Oct 24, 2014 - 12:38 PM