Home > How-To > XBoot – Quick Start Guide (for a sweet XMega bootloader!)

XBoot – Quick Start Guide (for a sweet XMega bootloader!)


So in my recent XMega wanderings,  I needed a good bootloader.  After muddling through various app notes and forum postings, I came across the culmination of what I couldn’t do on my own – XBoot!

In my defense, I’ve worked on bootloaders before.  But the errata sheet on the XMegas is longer than the list of men Princess Leia has broken the hearts of.  And I’ve become one of the many casualties of that list.  (Erm, the errata list…  awkward…)

Big thanks to Alex Forencich!  XBoot, a fantastic reincarnation of the AVR1605 app note, is open source and highly configurable bootloader, which at the time of writing is capable of UART or I2C bootloading XMega processors.  I believe his intentions are to expand both processor compatibility and protocol options, so visit the XBoot Google Code project for more info.

I’ll  be going through and explaining the options that I used, so this isn’t an exhaustive tutorial.  This guide assumes you have a working XMega development environment, AVRDude installed, and SVN (if you want to download the code this way).  WinAVR should work just fine with a few minor alterations, but I’ve only tested this on Kubuntu with the development environment described in this previous blog post.  Also, as a side note, I’ve been using XBoot with XBee Series 1 wireless modules and it works fantabulous (that’s so good, I had to come up with a new word for it).

Overview

Here’s the step-by-step big picture:

  1. Download the code.
  2. Pick a bootloader entry method.
  3. Configure communication parameters (Port/Baud Rate/I2C addressing, etc.).
  4. Compile & program XBoot onto the MCU.
  5. Send main application via XBoot and AVRDude.

Download the Code

So let’s get started.  Download the code from the XBoot download page and uncompress it, or (my preference) use SVN to download the code:

svn checkout http://avr-xboot.googlecode.com/svn/trunk/ avr-xboot

Configure XBoot

Once the code is downloaded, find the file named “xboot.h”.  Most configuration changes, if not all, will be made here.  We’ll take it one section at a time.  Line item references are from Rev12 out of the repository, but you should be able to match them up to any version.  The idea is that all available options are enabled, so comment out what you won’t be using.

// AVR1008 fixes
// Really only applicable to 256a3 rev A and B devices
//#define USE_AVR1008_EEPROM

Uncomment this line if you’ll be using an XMega256a3.  This fixes certain problems (remember Princess Leia the errata list?). I’ve heard this has hit some people but not others, even on the same silicon revision.  It may be useful for certain other chips and families – YMMV.  Check with Google if concerned.

Line 64:
// bootloader entrance
#define USE_ENTER_DELAY
//#define USE_ENTER_PIN
#define USE_ENTER_UART
//#define USE_ENTER_I2C

Here I picked the “USE_ENTER_DELAY” and “USE_ENTER_UART”, hence I commented the other two out.  Note that the “USE_ENTER_DELAY” just puts a delay at the start of the program, and isn’t mutually exclusive with the other options.  Here’s what the options mean:

  • USE_ENTER_DELAY: Delays entry by a timeout.  Timeout is set by “ENTER_BLINK_COUNT” and “ENTER_BLINK_WAIT”, but I found the default settings worked well.
  • USE_ENTER_PIN: Select this option if you want to enter the bootloader when a pin is in a certain state at power on.  Ex: You press a switch when you power cycle to enter the bootloader.  You’ll have to configure which port/pin at line 95, at the section titled “ENTER_PIN”.
  • USE_ENTER_UART: Select this option if you want to enter the bootloader if a character is received on the UART.  This requires using “USE_ENTER_DELAY” by necessity.  You’ll need to configure the UART options at line 111.
  • USE_ENTER_I2C: Select this option if you want to enter the bootloader if a byte is received through I2C.  I haven’t used this option, hence I won’t try to elaborate.

On to the next section:

Line 73:
// bootloader communication
#define USE_LED
#define USE_UART
//#define USE_I2C
//#define USE_I2C_ADDRESS_NEGOTIATION
//#define USE_ATTACH_LED

I’ll be using the UART and LED, so everything else is commented out.  If you use the LED, configure the next section also:

Line 106:
// LED
#define LED_PORT                PORTA
#define LED_PIN                 0
#define LED_INV                 1

If you’re using the UART, configure this section:

Line 111:
// UART
#define UART_BAUD_RATE                  19200
#define UART_PORT                       PORTD
#define UART_DEVICE_PORT                D1
#define UART_DEVICE                     token_paste2(USART, UART_DEVICE_PORT)
#define UART_DEVICE_RXC_ISR             token_paste3(USART, UART_DEVICE_PORT, _RXC_vect)
#define UART_DEVICE_DRE_ISR             token_paste3(USART, UART_DEVICE_PORT, _DRE_vect)
#define UART_DEVICE_TXC_ISR             token_paste3(USART, UART_DEVICE_PORT, _TXC_vect)
#define UART_TX_PIN                     PIN7_bm

Should be pretty self-explanatory.  You should only need to change UART_BAUD_RATE, UART_PORT, UART_DEVICE_PORT, and UART_TX_PIN.  If you use an exotic baud rate (non-standard and/or fast), you might want to change the settings at line 51 and select the 32MHz clock option.

That’s pretty much it for this section!

Compile & Program

This should work if you’re using AVR-GCC in Linux.  I can’t vouch for WinAVR, but it shouldn’t take much to change it.  That said, the only thing that really needs to change in the Makefile is the programmer name and the chip you’re compiling it for:

Line 42:
# MCU name
## MCU = atxmega16a4
## MCU = atxmega32a4
## MCU = atxmega64a1
## MCU = atxmega64a3
## MCU = atxmega64a4
## MCU = atxmega128a1
## MCU = atxmega128a3
## MCU = atxmega128a4
## MCU = atxmega192a1
## MCU = atxmega192a3
## MCU = atxmega256a1
## MCU = atxmega256a3b
MCU = atxmega256a3
#MCU = atxmega64a3
#MCU = atxmega128a1
#MCU = atxmega32a4

For me, I’ve been using the XMega256A3 chip.  At random, I decided to uncomment the atxmega256a3 line.  YMMV.

Line 209:
#AVRDUDE_PROGRAMMER = jtag2pdi
#AVRDUDE_PROGRAMMER = avr109
AVRDUDE_PROGRAMMER = avrispmkII

And I’m using an AVRISP mkII programmer, which is pretty cheap for an authentic Atmel programmer.  It only does PDI programming (no debugging), and needs to be updated to the latest firmware using AVR Studio (sorry, penguins – you’ll have to boot into Windows), but it does the XMega trick right nicely.

To compile and subsequently program:

$ make
$ make program

This should compile and program XBoot into the programmer.  Shazaam!  If you get any errors, feel free to leave me a comment and I’ll try to help you out.

Programming an Application Via XBoot

So now that you’ve got XBoot loaded, you can use AVRDude again to program your application to your XMega:

avrdude -p atxmega64a3 -P /dev/ttyUSB0 -c avr109 -b 19200 -U flash:w:main.hex

For those of you who may have installed Eclipse as described in previous posts, you can make Eclipse use the bootloader by:

  • Click on “Run -> Run Configurations…”
  • Right click on “C/C++ Application” on the left and select “New”
  • In the “Name:” textbox, enter “Program via XBoot”
  • In the “C/C++ Application:” textbox, enter “/usr/bin/avrdude” (or where ever it’s installed if you’re using Windows)
  • Click on the “Arguments” tab.  Enter the following line, modify to suit your needs, and then click “Apply” and “Close”
-c avr109 -p x256a3 -P /dev/ttyUSB0 -b 19200 -e -U flash:w:Debug/eclipse_project_name.hex

There you have it.  As always, if you need any help just ask in the comments below!

 

svn checkout http://avr-xboot.googlecode.com/svn/trunk/ avr-xboot-read-only
Advertisements
  1. Alex
    14 October 2010 at 5:13 AM

    Hey guys,
    I want to add the XBOOT bootloader to my atxmega128a1 board.
    What USB to UART controller could I use? I looked at the FT232R because the easy pinout. Woud that chip work?

    Thanks.

  2. 14 October 2010 at 8:00 AM

    Yes, I’ve successfully used the FT232RL chip for serial bootloaders in the past (on my MP3 player project) and it worked great.

  3. 30 November 2010 at 10:38 AM

    Great site, though I would love to see some more media! – Great post anyway, Cheers!

  4. martin
    3 December 2010 at 5:57 AM

    Thank you so much for this tutorial! Using XBoot was easier than I ever thought.

  5. 9 January 2011 at 6:04 AM

    Thanks for publishing these zigbee projects. Its useful for my students.

  6. MBear
    18 January 2011 at 2:31 AM

    Hello, i have some issues with reentering bootloader. I’m able to program it only once. After reset it waits 3 sec but i cannot upload new firmware. Any help is appreciated. Here is my config code:
    // Configuration

    // clock config
    #define USE_DFLL
    // use 32MHz osc if makefile calls for it
    #if (F_CPU == 32000000L)
    // defaults to 2MHz RC oscillator
    // define USE_32MHZ_RC to override
    #define USE_32MHZ_RC
    #endif

    // AVR1008 fixes
    // Really only applicable to 256a3 rev A and B devices
    //#define USE_AVR1008_EEPROM

    // bootloader entrace
    #define USE_ENTER_DELAY
    //#define USE_ENTER_PIN
    #define USE_ENTER_UART
    //#define USE_ENTER_I2C

    // bootloader exit
    //#define LOCK_SPM_ON_EXIT

    // bootloader communication
    #define USE_LED
    #define USE_UART
    //#define USE_I2C
    //#define USE_I2C_ADDRESS_NEGOTIATION
    //#define USE_ATTACH_LED

    // General Options
    //#define USE_INTERRUPTS
    //#define USE_WATCHDOG

    // bootloader features
    #define ENABLE_BLOCK_SUPPORT
    #define ENABLE_FLASH_BYTE_SUPPORT
    #define ENABLE_EEPROM_BYTE_SUPPORT
    #define ENABLE_LOCK_BITS
    //#define ENABLE_FUSE_BITS

    // ENTER_PIN
    //#define ENTER_PORT PORTC
    //#define ENTER_PIN 0
    //#define ENTER_PIN_CTRL token_paste3(ENTER_PORT.PIN, ENTER_PIN, CTRL)
    //#define ENTER_PIN_STATE 0
    //#define ENTER_PIN_PUEN 1

    // ENTER_DELAY
    #define ENTER_BLINK_COUNT 3
    #define ENTER_BLINK_WAIT 30000

    // WATCHDOG
    // Select only one
    //#define WATCHDOG_TIMEOUT WDT_PER_8CLK_gc
    //#define WATCHDOG_TIMEOUT WDT_PER_16CLK_gc
    //#define WATCHDOG_TIMEOUT WDT_PER_32CLK_gc
    //#define WATCHDOG_TIMEOUT WDT_PER_64CLK_gc
    //#define WATCHDOG_TIMEOUT WDT_PER_128CLK_gc
    //#define WATCHDOG_TIMEOUT WDT_PER_256CLK_gc
    //#define WATCHDOG_TIMEOUT WDT_PER_512CLK_gc
    #define WATCHDOG_TIMEOUT WDT_PER_1KCLK_gc
    //#define WATCHDOG_TIMEOUT WDT_PER_2KCLK_gc
    //#define WATCHDOG_TIMEOUT WDT_PER_4KCLK_gc
    //#define WATCHDOG_TIMEOUT WDT_PER_8KCLK_gc

    // LED
    #define LED_PORT PORTC
    #define LED_PIN 0
    #define LED_INV 1

    // UART
    #define UART_BAUD_RATE 115200
    #define UART_PORT_NAME F
    #define UART_NUMBER 0

    • 18 January 2011 at 2:44 AM

      Quite a few things could be in play, but more info is needed to diagnose the problem. What chip are you using? When you say you can only load it once, do you mean load a main program using the bootloader, or the bootloader only responds once and then the main program doesn’t run?

      A couple general suggestions: Do you have a solid UART connection? Using a regularly flashed program, can you see bidirectional UART data?

      It could also be that you’re not loading it into the right Flash address. This shouldn’t be a problem if you’re using the included Makefile.

      • MBear
        18 January 2011 at 3:30 AM

        Oh i forgot to mention, MCU is Xmega128A1. It is connected via ftdi (usb-uart) so i don’t think that problem is in connection.
        Yes, i can load main program using bootloader, and it start its execution without any problem. I’m loading xboot from AVRstudio..Because with make all i only get compiled code…Avr dude isnt started at all. I have Windows XP OS.
        Thanks

  7. 18 January 2011 at 9:47 AM

    As I’m not a windows guy, I don’t know how it works in AVRStudio. I’ve heard mixed results. But it’s awfully hard to troubleshoot a toolset I’m not familiar with ;)

    Sounds like it could be one of a few things:
    1) The program isn’t loaded correctly. Give the “make program” with AVRDude another try.
    2) Are the fuse bits set correctly? Again, the Makefile does this for me. Refer to the makefile for the correct settings.
    3) The bootloader entry settings are incorrect. Try the default wait timeout settings, I’ve had trouble modifying this. Disable the watchdog and other features until you get it to work, then add them back in one at a time.

    Best of luck.

  8. foker
    11 February 2011 at 10:32 AM

    MBear :

    Oh i forgot to mention, MCU is Xmega128A1. It is connected via ftdi (usb-uart) so i don’t think that problem is in connection.
    Yes, i can load main program using bootloader, and it start its execution without any problem. I’m loading xboot from AVRstudio..Because with make all i only get compiled code…Avr dude isnt started at all. I have Windows XP OS.
    Thanks

    I’ve same problem too
    I think avrdude can’t erase the chip before programming at second time

  9. 11 February 2011 at 11:10 AM

    I’m not sure what your problem is. If you’re asking for help, I need more details.

    Without more info, all I can say is check to make sure that you’ve picked the correct processor in both the makefile as well as xboot.h. Make sure that baud rates match. I would highly, highly recommend using “make program” to load the bootloader. Bootloaders are not trivial – if you don’t know what you’re doing and things aren’t working, follow someone else’s lead (not mine by the way – Alex Forencich was the one who saved my bacon ;).

    AVRDude does not have a problem – it’s worked dozens of times over for dozens of people. Make sure the makefile is set up properly.

  10. foker
    13 February 2011 at 10:32 PM

    hohoho…
    here’s my mistake :

    bootloader doesn’t place on right place (i’m using xmega128a1 so bootloader must be place on address 0x10000)

    thx yaph

  11. Falko
    21 March 2011 at 4:09 AM

    Hello! Thanks for the great Bootloader, but i have a small problem. Writing flash with avrdude is working, but EEPROM i always get a Error.
    Comand is:
    avrdude -p atxmega128a1 -P com5 -c avr109 -b 115200 -e -Uflash:w:greenController.hex -U eeprom:w:greenController.eep -v

    Avrdude tells me:

    avrdude: 50970 bytes of flash written
    avrdude: verifying flash memory against greenController.hex:
    avrdude: load data flash data from input file greenController.hex:
    avrdude: input file greenController.hex auto detected as Intel Hex
    avrdude: input file greenController.hex contains 50970 bytes
    avrdude: reading on-chip flash data:

    Reading | ################################################## | 100% 5.13s

    avrdude: verifying …
    avrdude: 50970 bytes of flash verified
    avrdude: reading input file “greenController.eep”
    avrdude: input file greenController.eep auto detected as Intel Hex
    avrdude: writing eeprom (491 bytes):

    Writing | | 0% 0.00savrdude:
    error: programmer did not respond to command: write block

    Any Ideas????????????

    • 23 March 2011 at 7:33 AM

      I haven’t ever needed to write eeprom data using this bootloader, so I’m not sure. You might try the AVR1009 workaround, as it uses interrupts to write eeprom. You might try checking the AVRFreaks.net forum postings on this bootloader.

      • Prasanna
        5 December 2011 at 1:40 PM

        Hey… I had the same problem…. was using XBee(@115200)…. I got to know that Xbee doesnt support high data rates…. I lowered the data rates(@38400)…. Problem resolved….!!

  12. Sam
    6 June 2012 at 6:30 AM

    The template for wordpress seems to “chop” the article making it unreadable.

    I looked at the page source to get the information.

    • 6 June 2012 at 7:21 AM

      Thanks for the heads up – WordPress must’ve changed something. I just added a carriage return and saved again – problem gone.

      For the code sections (which don’t have scroll bars and are inordinately short widths), I just copy and paste them when I need to see them. Sorry, WordPress sucks and/or I’m too much of an idiot to figure it out.

  13. 20 September 2012 at 6:46 PM

    Hello, I was able to load the bootloader succesfully, but when I try to program my application through the UART there seems to be a problem. Here is the message that I am getting:

    felipe@sanandres:~/Desktop/Bootloader/avr-xboot/xboot$ sudo avrdude -v -v -p atxmega256a3b -P /dev/ttyUSB0 -c avr109 -b 115200 -U flash:w:Microcontroller.hex

    avrdude: Version 5.10, compiled on Jun 29 2010 at 03:44:14
    Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
    Copyright (c) 2007-2009 Joerg Wunsch

    System wide configuration file is “/etc/avrdude.conf”
    User configuration file is “/home/felipe/.avrduderc”
    User configuration file does not exist or is not a regular file, skipping

    Using Port : /dev/rfcomm2
    Using Programmer : avr109
    avr910_devcode (avrdude.conf) : none
    Overriding Baud Rate : 115200
    AVR Part : ATXMEGA256A3B
    Chip Erase delay : 0 us
    PAGEL : P00
    BS2 : P00
    RESET disposition : dedicated
    RETRY pulse : SCK
    serial program mode : yes
    parallel program mode : yes
    Timeout : 0
    StabDelay : 0
    CmdexeDelay : 0
    SyncLoops : 0
    ByteDelay : 0
    PollIndex : 0
    PollValue : 0x00
    Memory Detail :

    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    eeprom 0 0 0 0 no 4096 32 0 0 0 0x00 0x00
    application 0 0 0 0 no 262144 256 0 0 0 0x00 0x00
    apptable 0 0 0 0 no 8192 256 0 0 0 0x00 0x00
    boot 0 0 0 0 no 8192 256 0 0 0 0x00 0x00
    flash 0 0 0 0 no 270336 256 0 0 0 0x00 0x00
    prodsig 0 0 0 0 no 512 256 0 0 0 0x00 0x00
    usersig 0 0 0 0 no 512 256 0 0 0 0x00 0x00
    signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
    fuse0 0 0 0 0 no 1 0 0 0 0 0x00 0x00
    fuse1 0 0 0 0 no 1 0 0 0 0 0x00 0x00
    fuse2 0 0 0 0 no 1 0 0 0 0 0x00 0x00
    fuse4 0 0 0 0 no 1 0 0 0 0 0x00 0x00
    fuse5 0 0 0 0 no 1 0 0 0 0 0x00 0x00
    lock 0 0 0 0 no 1 0 0 0 0 0x00 0x00

    Programmer Type : avr910
    Description : Atmel AppNote AVR109 Boot Loader

    Connecting to programmer: .avrdude: ser_recv(): programmer is not responding
    avrdude: butterfly_recv(): programmer is not responding

    By the way, I am using an FTDI cable to connect to the microcontroller. Do you have any idea of what might be going on?

  14. redTzar
    5 October 2012 at 12:21 PM

    Felipe,
    I just ran into the same thing. Programming x32a4u. AVR dude for some reason is sending a request for a block read of EEPROM, and the bootloader does not respond. See if you get the below after adding a couple more “-v” to your AVRdude command.

    avrdude -p x32a4 -F -P /dev/ttyS0 -b 38400 -c AVR109 -D -u -q -U flash:w:test.hex -v -v -v -v
    avrdude: Version 5.10, compiled on Oct 2 2012 at 01:05:09
    Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
    Copyright (c) 2007-2009 Joerg Wunsch

    System wide configuration file is “/etc/avrdude.conf”
    User configuration file is “/home/root/.avrduderc”
    User configuration file does not exist or is not a regular file, skipping

    Using Port : /dev/ttyS0
    Using Programmer : AVR109
    avr910_devcode (avrdude.conf) : none
    Overriding Baud Rate : 38400
    AVR Part : ATXMEGA32A4
    Chip Erase delay : 0 us
    PAGEL : P00
    BS2 : P00
    RESET disposition : dedicated
    RETRY pulse : SCK
    serial program mode : yes
    parallel program mode : yes
    Timeout : 0
    StabDelay : 0
    CmdexeDelay : 0
    SyncLoops : 0
    ByteDelay : 0
    PollIndex : 0
    PollValue : 0x00
    Memory Detail :

    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    eeprom 0 0 0 0 no 1024 32 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    application 0 0 0 0 no 32768 256 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    apptable 0 0 0 0 no 4096 256 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    boot 0 0 0 0 no 4096 256 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    flash 0 0 0 0 no 36864 256 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    prodsig 0 0 0 0 no 512 256 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    usersig 0 0 0 0 no 512 256 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    fuse0 0 0 0 0 no 1 0 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    fuse1 0 0 0 0 no 1 0 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    fuse2 0 0 0 0 no 1 0 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    fuse4 0 0 0 0 no 1 0 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    fuse5 0 0 0 0 no 1 0 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ———– —- —– —– —- —— —— —- —— —– —– ———
    lock 0 0 0 0 no 1 0 0 0 0 0x00 0x00

    Programmer Type : avr910
    Description : Atmel AppNote AVR109 Boot Loader

    Connecting to programmer: .avrdude: Send: . [1b]
    avrdude: Send: S [53]
    avrdude: Recv: X [58]

    avrdude: Recv: B [42] o [6f] o [6f] t [74] + [2b] + [2b]
    avrdude: Send: V [56]
    avrdude: Recv: 1 [31] 7 [37]
    avrdude: Send: v [76]
    avrdude: Recv: ? [3f]
    avrdude: Send: p [70]
    avrdude: Recv: S [53]
    Found programmer: Id = “XBoot++”; type = S
    Software Version = 1.7; No Hardware Version given.
    avrdude: Send: a [61]
    avrdude: Recv: Y [59]
    Programmer supports auto addr increment.
    avrdude: Send: b [62]
    avrdude: Recv: Y [59]
    avrdude: Recv: . [01]
    avrdude: Recv: . [00]
    Programmer supports buffered memory access with buffersize=256 bytes.
    avrdude: Send: t [74]

    Programmer supports the following devices:
    avrdude: Recv: { [7b]
    Device code: 0x7b
    avrdude: Recv: . [00]

    avrdude: Send: T [54] { [7b]
    avrdude: Recv: . [0d]
    avrdude: devcode selected: 0x7b
    avrdude: Send: P [50]
    avrdude: Recv: . [0d]
    avrdude: AVR device initialized and ready to accept instructions
    avrdude: Send: s [73]
    avrdude: Recv: A [41] . [95] . [1e]
    avrdude: Device signature = 0x1e9541
    avrdude: Send: A [41] . [03] . [fc]
    avrdude: Recv: . [0d]
    avrdude: Send: g [67] . [00] . [01] E [45]
    avrdude: ser_recv(): programmer is not responding
    avrdude: butterfly_recv(): programmer is not responding

  15. pieter
    8 November 2012 at 8:45 AM

    I have use the bootloader in the past, but now it does not function properly.

    I have a atxmega32a4u, only think i have to change is usart from C to E. My serial is connect to USARTE0. USART works properly, can send data and recive data. And i can programma chip via pdi, works al fine.

    Does anyone have an idea what is going wrong?

    Microsoft Windows [versie 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. Alle rechten voorbehouden.

    E:\backup 2012 19sept\firmware1\aquarium controller firmware1\Debug>avrdude -c avr911 -p x32a4 -P com2 -b 115200 -U flash:w:”E:\backup 2012 19sept\aquarium controller firmware1\aquarium controller firmware1\Debug\firmware1.hex”:a

    E:\backup 2012 19sept\aquarium controller firmware1\ firmware1\Debug>
    Connecting to programmer: .
    Found programmer: Id = “XBoot++”; type = S
    Software Version = 1.7; No Hardware Version given.
    Programmer supports auto addr increment.
    Programmer supports buffered memory access with buffersize=256 bytes.

    Programmer supports the following devices:
    Device code: 0x7b

    avrdude: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.02s

    avrdude: Device signature = 0x1e9541
    avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
    To disable this feature, specify the -D option.
    avrdude: erasing chip
    avrdude: reading input file “E:\backup 2012 19sept\firmware1\aquarium controller firmware1\Debug\aquarium controller firmware1.hex”
    avrdude: input file E:\backup 2012 19sept\firmware1\aquarium controller firmware1\Debug\firmware1.hex auto detected as Intel Hex
    avrdude: writing flash (14796 bytes):

    Writing | #################################################avrdude: error: programmer did not respond to command: write block

  16. 7 February 2013 at 12:34 PM

    Any Idea why this would work only once for me?
    I have BOOTRST set appropriately but it’s acting like it’s not.
    In other words, I burn the bootloader, then I can download my application via USB serial. After that the Bootloader never runs. I’m using USE_ENTER_DELAY and USE_ENTER_UART, so I would expect it to wait 3 seconds or so, but instead, my application does a printf right away and it spits it out on the serial port immediately after reset.

    I manually set the bootloader lockbits to write protect, and reading out the contents of flash shows that the bootloader is still there.

  17. Thomas
    15 December 2013 at 4:23 AM

    Hi there,
    XBOOT works fine for me, the challenge I am facing is programming XBOOT into the controller.
    It does work with ATMEL Studio6 when I confirm the error message that pops up. However when I want to use AVRDUDE or atprogram from the studio as command line tool both report that the memory area I want to write to is beyond the 64K range of my Xmega64a3u.
    So currently I can only get XBOOT into the device with the studio6 GUI.
    Is there any trick to burn it in including fuses in one go via command line?
    Any help is appreciated, thanks and regards
    Thomas

    • 16 December 2013 at 9:17 AM

      Which version of AVRDUDE are you using? Possibly try a different version. Also, there may be a switch somewhere that tells AVRDUDE to be flashing into the boot space, rather than the program space. Wish I could be more help, it’s been a year or two since I’ve used an XMega so I’m not up to speed with this bootloader anymore.

  18. 8 September 2015 at 1:19 AM

    Hello guy am looking for someone to reprogram an electric meter with xmega32d4 chip hence making money.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: