bootloaderwinAVR
所属分类:处理器开发
开发工具:C/C++
文件大小:53KB
下载次数:56
上传日期:2007-03-13 10:20:22
上 传 者:
xuepeng3000
说明: ATMEL公司的AVR系列,MEGA128的BOOTLODER源代码,WINAVR编译.可以更加了解单片机的BOOTLODER的工作流程.
(company ATMEL AVR Series, the MEGA128 BOOTLODER source code, WINAVR compiler. SCM can better understand the BOOTLODER workflow.)
文件列表:
254734\avrprog_boot_v0_81\makefile (14000, 2006-11-22)
254734\avrprog_boot_v0_81\chipdef.h (764, 2006-05-26)
254734\avrprog_boot_v0_81\mega128.h (1172, 2006-05-27)
254734\avrprog_boot_v0_81\mega128can.h (1270, 2006-05-27)
254734\avrprog_boot_v0_81\mega16.h (793, 2006-05-27)
254734\avrprog_boot_v0_81\mega169.h (706, 2006-05-26)
254734\avrprog_boot_v0_81\mega32.h (793, 2006-05-27)
254734\avrprog_boot_v0_81\mega8.h (790, 2006-05-27)
254734\avrprog_boot_v0_81\main.c (13434, 2006-11-22)
254734\avrprog_boot_v0_81\main.o (8252, 2006-11-22)
254734\avrprog_boot_v0_81\mainx_hex.aps (1808, 2006-11-22)
254734\avrprog_boot_v0_81\main_hex.aps (1806, 2006-11-22)
254734\avrprog_boot_v0_81\.dep\main.o.d (1265, 2006-11-22)
254734\avrprog_boot_v0_81\main.eep (34, 2006-11-22)
254734\avrprog_boot_v0_81\main.elf (10035, 2006-11-22)
254734\avrprog_boot_v0_81\main.hex (2227, 2006-11-22)
254734\avrprog_boot_v0_81\mainx.hex (2218, 2006-11-22)
254734\avrprog_boot_v0_81\main.lss (25977, 2006-11-22)
254734\avrprog_boot_v0_81\main.lst (47695, 2006-11-22)
254734\avrprog_boot_v0_81\main.map (11739, 2006-11-22)
254734\avrprog_boot_v0_81\avrprog_boot.pnproj (487, 2006-05-27)
254734\avrprog_boot_v0_81\avrprog_boot.pnps (65, 2006-05-27)
254734\avrprog_boot_v0_81\main.sym (1336, 2006-11-22)
254734\avrprog_boot_v0_81\ldscripts_no_vector\avr1.x (4470, 2006-05-26)
254734\avrprog_boot_v0_81\ldscripts_no_vector\avr2.x (4476, 2006-05-26)
254734\avrprog_boot_v0_81\ldscripts_no_vector\avr3.x (4478, 2006-05-26)
254734\avrprog_boot_v0_81\ldscripts_no_vector\avr4.x (4484, 2006-05-27)
254734\avrprog_boot_v0_81\ldscripts_no_vector\avr5.x (4578, 2006-05-27)
254734\avrprog_boot_v0_81\ldscripts_no_vector (0, 2011-02-18)
254734\avrprog_boot_v0_81\.dep (0, 2011-02-18)
254734\avrprog_boot_v0_81 (0, 2011-02-18)
254734 (0, 2011-02-18)
======================================================
ATMEL AVR UART Bootloader for AVR-GCC/avr-libc
by Martin Thomas, Kaiserslautern, Germany
mthomas@rhrk.uni-kl.de
eversmith@heizung-thomas.de
http://www.siwawi.arubi.uni-kl.de/avr_projects
** Addtional code and improvements contributed **
** by Uwe Bonnes, Bjoern Riemer and Olaf Rempel. **
Eearly versions of this bootloader-code have been
based on the AVR Butterfly bootloader-source REV02
which has been available from atmel.com.
======================================================
Programming-Software (on the "PC-Side"):
* AVRProg (included in AVRStudio) available at www.atmel.com.
MS-Windows only. AVRProg can be used as stand-alone application.
(avrprog.exe)
* avrdude available at http://savannah.nongnu.org/projects/avrdude/
"Multiplattform"
* Installation instructions at the end of this file.
2. Oct. 2006 - Version 0.81
* Bernhard Roth reported a mistake in the UART-configuration
for double-speed. Thanks for the report.
Change in main.c:
UART_STATUS = UART_DOUBLE; -> UART_STATUS = (1<"ATmega32" and boot-code is 0x73->"ATmega32 BOOT".
When using avrdude the bootloader's device-code must match
the device-code in the avrdude.conf. Check the avrdude-
code to see if both codes (AVR910 and AVR109) are supported.
-- I have got some e-mails from users which have been
confused by this. Hopefully this explanation is good enough.
* This bootloader lets the watchdog do a reset when the
user selects "Exit programmer" (i.e. in AVRProg) after an
update. Make sure to disable or reset the watchdog early in
you application.
27. May 2006 - Version 0.8beta2
* More very well done improvements contributed by Olaf Rempel.
* Olaf Rempel also modified the STARTUP_WAIT method.
21. May 2006 - Version 0.8beta
* Version contributed by Olaf Rempel. He has done a lot of modifications.
-> "cleaner code", smaller binaries.
09. Feb. 2006 - Version 0.75
* additional STARTUP_WAIT support contributed by Bjoern Riemer
18. Aug. 2005 - Version 0.74
* AT90CAN128 support contributed by Uwe Bonnes
* Makefile modifications contributed by Uwe Bonnes
23. Feb. 2005 - Version 0.7
* (Version 0.6 has never been available on the web-page)
* ATmega128 support
* code cleanup
* This version has been tested with ATmega8, ATmega32 and
ATmega128
7. Apr. 2004 - Version 0.5
* added different startup-methods
* compatible with ATmega8 now
* included makefile adapted to ATmega8 now
(ATmega16 options still available)
* fixed jump to application which did not work
reliably before
* tested with ATmega8
* minimal options and startup-code result in
bootloader-size < 512 words
6. Apr. 2004 - Version 0.4
* Buffered read of chars from UART during programming
since eeprom-write is too slow for unbuffered
operation. So EEPROM-upload does work now.
* Added BOOTICE-mode to flash JTAGICE-compatible
hardware (ATmega16@7,3Mhz) (if you know about BOOTICE,
you may unterstand why this has been added, if not
just keep the option disabled)
* small changes in (my)boot.h (lock-bit-mask) found
out during the development of the STK-500-compatible
bootloader. But setting lock-bits still does not
work with this bootloader.
* read of the low-fuse byte works (high byte still TODO)
* read of the lock-byte works (write still TODO)
27. Mar 2004 - Version 0.3
Felt that as much functions from avr-libc's boot.h
as possible should be used without modifications.
Latest CVS-version of boot.h is included.
Only the read-routine is still "self-made" based
on ATMELs assembler-code.
EEPROM write on Mega16 does not work (and did not
work with V0.2 too). May be caused by my old Mega16
chip. Needs testing. Flash read/write and EEPROM
read works. Still only tested with ATmega16.
This version may not work with the ATmega169 any
more.
24. Mar 2004 - Version 0.2
During the development of a data-logger application
with the AVR-Butterfly there was a need to make
some changes in the bootloader. The same problem
again: no IAR compiler. The same way to solve the
problem: a port of the code to avr-gcc/avr-libc.
So this code is based on the ATMEL Butterfly
bootloader source code Rev 0.2 for IAR.
The bootloader-port for the Butterfly which mimics
the complete functionality of the original
BF-bootloader is availabe at:
www.siwawi.arubi.uni-kl.de/avr_projects
Atmel used a separate "lib" written in "pure"
assembly to access the low-level functions
for flash read/write. Well, so far I
don't know how to use "mixed language sources"
with the avr-gcc toolchain, so the low-level
routines have been implemented as inline assembler.
The avr-libc boot.h module written by Eric
Weddington served as a template Three of the four
low-level routines found in lowlevel.c come from
boot.h with minimal changes. The read routine has
been developed based on the ATMEL assembler code.
Ignore the fuse and lock-bit readout. Read and Set is
not enabled (TODO).
--------------- Installation -----------------
- Change the MCU type in the makefile.
- Change the boot(loader)-size in Makefile. The needed
space depends on the features selected in main.c
- Set baudrate in main.c, a doublespeed configuration-option
is available too.
- Change the F_CPU in main.c to the clock-frequency
of your board. See the datasheet for frequencies
with minimum error at the selected baudrate.
- Select the start-condition in main.c.
- Please use at least avr-gcc 3.3.1/avr-libc 1.0
or WINAVR Sept. 2003 or later to compile and link
this bootloader.
- Upload the hex-File to the AVR (STK500, STK200, SP12
evertool, AVR910 etc.)
- Program the "Boot Flash section size" (BOOTSZ fuses)
according to the boot-size selected in the makefile
i.e. BOOTSZ=00 for boot-size 1024 words on ATmega16
- enable the BOOT Reset Vector fuse (BOOTTRST=0)
- Set the lock bits to protect the bootloader from
SPM-writes (Boot Loader Protection Mode 2 in STK500-
plugin) so that it can not overwrite itself.
- Connect the AVR UART Pins via level-shifter/inverter
(i.e. MAX232) to your PCs COM-Port.
- Reset the AVR while fullfilling the bootloader start-
condition. (Default: selected pin connected to GND).
The condition must be "true" until you see the
AVRPROG dialog or avrdude connects.
- Start AVRPROG (AVRStuido/Tools or stand-alone)
avrdude is supported too, check the avrdude manual
for command-line options.
- AVRPROG or avrdude should detect the bootloader.
- see AVRStudio online-help for more information how
to use AVRPROG
- make sure to EXIT from AVRPROG (button) to start
your main-application or toogle power/reset.
Feedback welcome, Good luck.
Martin
近期下载者:
相关文件:
收藏者: