Skip to content

Droplet Bootloader

john-klingner edited this page Nov 25, 2013 · 1 revision

XBOOT

There is a separate Wiki for the bootloader, maintained by Alex Forencich at http://alexforencich.com/wiki/en/xboot/

To change the LED pin that the bootloader uses as it loads a program, this is done in the 'config.h' file in the xboot directory of the project file.

note: DONT screw around in the config.h file, as changes made here don't seem to hold very well through the compile "'make'" process. Instead change them directly in the xboot.h file!! This will apply to changing the LED pin, the UART pin, and the anything else pin.

Currently, the bootloader expects a BAUD of 115200.

Calling 'make' at the command line inside the xboot directory will creates two new files called 'xboot.hex' and 'xboot-boot.hex'. One of these is the bootloader hex file.

Outstanding Questions

  • What is the maximum bootloader size accepted?
  • How do I interpret the size information provided by winAVR (see compile output below)?
  • What is the 'xboot-boot.hex' file in the xboot directory?

A: If you have an XMEGA and want to save some time and just program the boot section, type “make xboot-boot.hex” and then write the new file xboot-boot.hex to the boot section directly with avrdude. The makefile includes built-in support for avrdude, so all you need to do is modify the avrdude parameters in the .conf.mk file for the programmer you have and type “make program”.

note: I found that they are in fact separate code! In xboot.hex, I had the blue light turned off (i.e. stopped it from floating), but when I wrote xboot-boot.hex to the chip, the blue light was back on! So obviously, my fix did not get saved into xboot-boot.hex, even though a new version of it was generated

  • Does the bootloader do anything with the fuses? Including non-permanent modifications (e.g. disable them, then re-enable them)
  • How does the programmer know where to put the bootloader in memory, and then how does the programmer know where to put the new programs after a bootloader is placed?
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Size before:
xboot.elf  :
section       size       addr
.text       0x1048    0x20000
.bss         0x201   0x802000
.stab       0x38a0        0x0
.stabstr    0xba95        0x0
Total      0x1057e




Creating load file for Flash: xboot.hex
avr-objcopy -O ihex -R .eeprom xboot.elf xboot.hex

Creating load file for boot section: xboot-boot.hex
avr-objcopy -O ihex --change-addresses -0x020000 xboot.hex xboot-boot.hex

Size after:
xboot.elf  :
section       size       addr
.text       0x1048    0x20000
.bss         0x201   0x802000
.stab       0x38a0        0x0
.stabstr    0xba95        0x0
Total      0x1057e



Errors: none

Clone this wiki locally