Version 0.80beta2 (20060527)

This commit is contained in:
Olaf Rempel 2006-05-27 12:52:20 +02:00
parent dcee58ebd2
commit 31b7584b2f
2 changed files with 189 additions and 185 deletions

4
main.c
View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* AVRPROG compatible boot-loader * AVRPROG compatible boot-loader
* Version : 0.80beta (May 2006) * Version : 0.80beta2 (May 2006)
* Compiler : avr-gcc 3.4.6 / avr-libc 1.4.4 * Compiler : avr-gcc 3.4.6 / avr-libc 1.4.4
* size : depends on features and startup ( minmal features < 512 words) * size : depends on features and startup ( minmal features < 512 words)
* by : Martin Thomas, Kaiserslautern, Germany * by : Martin Thomas, Kaiserslautern, Germany
@ -45,7 +45,7 @@
// programmers-notepad tabsize 4 // programmers-notepad tabsize 4
#define VERSION_HIGH '0' #define VERSION_HIGH '0'
#define VERSION_LOW '7' #define VERSION_LOW '8'
/* MCU frequency */ /* MCU frequency */
#define F_CPU 7372800 #define F_CPU 7372800

View File

@ -1,183 +1,187 @@
====================================================== ======================================================
ATMEL AVR UART Bootloader for AVR-GCC/avr-libc ATMEL AVR UART Bootloader for AVR-GCC/avr-libc
based on the AVR Butterfly bootloader code based on the AVR Butterfly bootloader code
by Martin Thomas, Kaiserslautern, Germany by Martin Thomas, Kaiserslautern, Germany
mthomas@rhrk.uni-kl.de mthomas@rhrk.uni-kl.de
eversmith@heizung-thomas.de eversmith@heizung-thomas.de
http://www.siwawi.arubi.uni-kl.de/avr_projects http://www.siwawi.arubi.uni-kl.de/avr_projects
Addtional code and improvements provided by Addtional code and improvements provided by
Uwe Bonnes, Bjoern Riemer and Olaf Rempel. Uwe Bonnes, Bjoern Riemer and Olaf Rempel.
====================================================== ======================================================
Programming-Software (on the "PC-Side"): Programming-Software (on the "PC-Side"):
* AVRProg (included in AVRStudio) available at www.atmel.com. * AVRProg (included in AVRStudio) available at www.atmel.com.
MS-Windows only. AVRProg can be used as stand-alone application. MS-Windows only. AVRProg can be used as stand-alone application.
(avrprog.exe) (avrprog.exe)
* avrdude available at http://savannah.nongnu.org/projects/avrdude/ * avrdude available at http://savannah.nongnu.org/projects/avrdude/
"Multiplattform" "Multiplattform"
21. May. 2006 - Version 0.8beta 27. May 2006 - Version 0.8beta2
Version contributed by Olaf Rempel. He has done a lot of modifications. More improvements contributed by Olaf Rempel.
-> "cleaner code", smaller binaries.
21. May 2006 - Version 0.8beta
09. Feb. 2006 - Version 0.75
Version contributed by Olaf Rempel. He has done a lot of modifications.
* additional STARTUP_WAIT support contributed by Bjoern Riemer -> "cleaner code", smaller binaries.
18. Aug. 2005 - Version 0.74 09. Feb. 2006 - Version 0.75
* AT90CAN128 support contributed by Uwe Bonnes * additional STARTUP_WAIT support contributed by Bjoern Riemer
* Makefile modifications contributed by Uwe Bonnes
18. Aug. 2005 - Version 0.74
23. Feb. 2005 - Version 0.7
* AT90CAN128 support contributed by Uwe Bonnes
* (Version 0.6 has never been available on the web-page) * Makefile modifications contributed by Uwe Bonnes
* ATmega128 support
* code cleanup 23. Feb. 2005 - Version 0.7
* Tested with ATmega8, ATmega32 and ATmega128
* (Version 0.6 has never been available on the web-page)
7. Apr. 2004 - Version 0.5 * ATmega128 support
* code cleanup
* added different startup-methods * Tested with ATmega8, ATmega32 and ATmega128
* compatible with ATmega8 now
* included makefile adopted to ATmega8 now 7. Apr. 2004 - Version 0.5
(ATmega16 options still available)
* fixed jump to application which did not work * added different startup-methods
reliably before * compatible with ATmega8 now
* tested with ATmega8 * included makefile adopted to ATmega8 now
* minimal options and startup-code result in (ATmega16 options still available)
bootloader-size < 512 words * fixed jump to application which did not work
reliably before
6. Apr. 2004 - Version 0.4 * tested with ATmega8
* minimal options and startup-code result in
* Buffered read of chars from UART during programming bootloader-size < 512 words
since eeprom-write is too slow for unbuffered
operation. So EEPROM-upload does work now. 6. Apr. 2004 - Version 0.4
* Added BOOTICE-mode to flash JTAGICE-compatible
hardware (ATmega16@7,3Mhz) (if you know about BOOTICE, * Buffered read of chars from UART during programming
you may unterstand why this has been added, if not since eeprom-write is too slow for unbuffered
just keep the option disabled) operation. So EEPROM-upload does work now.
* small changes in (my)boot.h (lock-bit-mask) found * Added BOOTICE-mode to flash JTAGICE-compatible
out during the development of the STK-500-compatible hardware (ATmega16@7,3Mhz) (if you know about BOOTICE,
bootloader. But setting lock-bits still does not you may unterstand why this has been added, if not
work with this bootloader. just keep the option disabled)
* read of the low-fuse byte works (high byte still TODO) * small changes in (my)boot.h (lock-bit-mask) found
* read of the lock-byte works (write still TODO) out during the development of the STK-500-compatible
bootloader. But setting lock-bits still does not
27. Mar 2004 - Version 0.3 work with this bootloader.
* read of the low-fuse byte works (high byte still TODO)
Felt that as much functions from avr-libc's boot.h * read of the lock-byte works (write still TODO)
as possible should be used without modifications.
Latest CVS-version of boot.h is included. 27. Mar 2004 - Version 0.3
Only the read-routine is still "self-made" based
on ATMELs assembler-code. Felt that as much functions from avr-libc's boot.h
EEPROM write on Mega16 does not work (and did not as possible should be used without modifications.
work with V0.2 too). May be caused by my old Mega16 Latest CVS-version of boot.h is included.
chip. Needs testing. Flash read/write and EEPROM Only the read-routine is still "self-made" based
read works. Still only tested with ATmega16. on ATMELs assembler-code.
This version may not work with the ATmega169 any EEPROM write on Mega16 does not work (and did not
more. work with V0.2 too). May be caused by my old Mega16
chip. Needs testing. Flash read/write and EEPROM
24. Mar 2004 - Version 0.2 read works. Still only tested with ATmega16.
This version may not work with the ATmega169 any
During the development of a data-logger application more.
with the AVR-Butterfly there was a need to make
some changes in the bootloader. The same problem 24. Mar 2004 - Version 0.2
again: no IAR compiler. The same way to solve the
problem: a port of the code to avr-gcc/avr-libc. During the development of a data-logger application
So this code is based on the ATMEL Butterfly with the AVR-Butterfly there was a need to make
bootloader source code Rev 0.2 for IAR. some changes in the bootloader. The same problem
again: no IAR compiler. The same way to solve the
The bootloader-port for the Butterfly which mimics problem: a port of the code to avr-gcc/avr-libc.
the complete functionality of the original So this code is based on the ATMEL Butterfly
BF-bootloader is availabe at: bootloader source code Rev 0.2 for IAR.
www.siwawi.arubi.uni-kl.de/avr_projects
The bootloader-port for the Butterfly which mimics
Atmel used a separate "lib" written in "pure" the complete functionality of the original
assembly to access the low-level functions BF-bootloader is availabe at:
for flash read/write. Well, so far I www.siwawi.arubi.uni-kl.de/avr_projects
don't know how to use "mixed language sources"
with the avr-gcc toolchain, so the low-level Atmel used a separate "lib" written in "pure"
routines have been implemented as inline assembler. assembly to access the low-level functions
The avr-libc boot.h module written by Eric for flash read/write. Well, so far I
Weddington served as a template Three of the four don't know how to use "mixed language sources"
low-level routines found in lowlevel.c come from with the avr-gcc toolchain, so the low-level
boot.h with minimal changes. The read routine has routines have been implemented as inline assembler.
been developed based on the ATMEL assembler code. The avr-libc boot.h module written by Eric
Weddington served as a template Three of the four
Ignore the fuse and lock-bit readout. Read and Set is low-level routines found in lowlevel.c come from
not enabled (TODO). boot.h with minimal changes. The read routine has
been developed based on the ATMEL assembler code.
--------------- Installation ----------------- Ignore the fuse and lock-bit readout. Read and Set is
not enabled (TODO).
- Change the MCU type in the makefile (so far
ATmega16 has been tested, ATmega169, ATmega8
and ATmega32 should be o.k. too. --------------- Installation -----------------
- Change the boot(loader)-size in Makefile, this - Change the MCU type in the makefile (so far
bootloader is larger than 512 words (1024 bytes), ATmega16 has been tested, ATmega169, ATmega8
so select at least _B1024! and ATmega32 should be o.k. too.
- Change the XTAL in Makefile to the clock-frequency - Change the boot(loader)-size in Makefile, this
of your board (keep BAUDRATE at 19200). See bootloader is larger than 512 words (1024 bytes),
the datasheet for frequencies with minimum so select at least _B1024!
error at 19200bps and select Crystal/Oscillator
to get minimum errors. - Change the XTAL in Makefile to the clock-frequency
of your board (keep BAUDRATE at 19200). See
- Change the start-condition in Makefile. Default the datasheet for frequencies with minimum
is: enter bootloader if Pin A7 is connected to error at 19200bps and select Crystal/Oscillator
GND during reset/startup to get minimum errors.
- Please use at least avr-gcc 3.3.1/avr-libc 1.0 - Change the start-condition in Makefile. Default
or WINAVR Sept. 2003 or later to compile and link is: enter bootloader if Pin A7 is connected to
the bootloader. GND during reset/startup
- upload the hex-File to the AVR (STK500, STK200, SP12 - Please use at least avr-gcc 3.3.1/avr-libc 1.0
etc.) or WINAVR Sept. 2003 or later to compile and link
the bootloader.
- program the "Boot Flash section size" (BOOTSZ fuses)
according to the boot-size selected in main.c - upload the hex-File to the AVR (STK500, STK200, SP12
i.e. BOOTSZ=00 for boot-size 1024 words on ATmega16 etc.)
- enable the BOOT Reset Vector (BOOTTRST=0) - program the "Boot Flash section size" (BOOTSZ fuses)
according to the boot-size selected in main.c
- Set the lock bits to protect the bootloader from i.e. BOOTSZ=00 for boot-size 1024 words on ATmega16
SPM-writes (Boot Loader Protection Mode 2 in STK500-
plugin) - enable the BOOT Reset Vector (BOOTTRST=0)
- Connect the AVR UART Pins via level-shifter/inverter - Set the lock bits to protect the bootloader from
(i.e. MAX232) to you PCs Com-Port. SPM-writes (Boot Loader Protection Mode 2 in STK500-
plugin)
- Reset the AVR while fullfilling the bootloader start-
condition. Which means connect PA7 to GND in the default - Connect the AVR UART Pins via level-shifter/inverter
config during reste/power-cycle. Keep the connection (i.e. MAX232) to you PCs Com-Port.
or hold the key down until you see the AVRPROG dialog!
- Reset the AVR while fullfilling the bootloader start-
- Start AVRPROG (AVRStuido/Tools or stand-alone) - condition. Which means connect PA7 to GND in the default
keep PA7 grounded! (avrdude is supported too, check config during reste/power-cycle. Keep the connection
the avrdude manual for command-line options). or hold the key down until you see the AVRPROG dialog!
- AVRPROG will detect the bootloader, you may release - Start AVRPROG (AVRStuido/Tools or stand-alone) -
PA7 now keep PA7 grounded! (avrdude is supported too, check
the avrdude manual for command-line options).
- see AVRStuido online-help for more information how
to use AVRPROG - AVRPROG will detect the bootloader, you may release
PA7 now
- make sure to EXIT from AVRPROG (button) to start
your main-application (or toogle power/reset) - see AVRStuido online-help for more information how
to use AVRPROG
good luck, feedback welcome.
Martin - make sure to EXIT from AVRPROG (button) to start
your main-application (or toogle power/reset)
good luck, feedback welcome.
Martin