This is the haftmann#software fork of ElmChan's avrpp:
Programming tool for AVR 8-bit microcontroller
using ElmChan's controller-less parallel programming board.
See also: https://www.mikrocontroller.net/articles/AVR_HV-Programmer
A parallel port is needed. PCI or PCIexpress cards do the job.
USB-ParallelPrinter adapters won't work yet.
This my fork has following advantages:
* Can read avr-gcc .elf files, no need for avr-objcopy or .hex files
* No need for fuse.txt file, fuse description is now built-in
* Can read multiple sections out of .elf or .hex file(s) for
flash, eeprom, fuse, lock, and signature
* Can compare given signature with chip ID and preselect programming interface
* Added TPI programming interface for 6-pin AVR controllers
* AVR-dependent fuse bit decoder with highlighted non-factory bits
* Minimalistic command line for flash update (filename only)
and for complete programming including fuses (-ff filename)
* Handles EEPROM write with EESAVE fuse set (=0):
- Skip writing EEPROM for flash update,
- Erase EESAVE fuse before chip erase for complete programming
* Simple chip cloning: "avrpp -r >hexfilename" for readout of flash, EEPROM,
fuses and signature, "avrpp -ff hexfilename" for programming
* Available as 32-bit and 64-bit executable, for Linux and Windows,
no dependency to non-standard runtime libraries,
minimum system requirement should be Windows 95
* Communicates to parallel port either using giveio.sys (faster, default)
or inpout32.dll/inpoutx64.dll (more portable).
Hint: Use my working giveio64 driver on Win64 platforms.
On linux, communication goes over ioperm() call
* Windows: If output is redirected (to an IDE output window
like Programmer's Notepad or Notepad++ with NppExec plugin),
queries are substituted by MessageBox() calls to be answerable
To put all needed sections into one .elf file,
one avr-gcc source file should contain statements as follows:
[[c or c++ file]]
#include <avr/fuse.h>
#include <avr/signature.h>
#include <avr/eeprom.h>
FUSES={
0b11000001, // some comment
0b01010100, // comment
0b11111111 //
};
EEMEM footype foodata;
When you think about distributing .elf files instead of .hex files,
don't forget to avr-strip symbols out of the .elf file to make it smaller:
[[makefile]]
$(PROJECT).elf: $(OBJECTS)
avr-gcc -s -o $@ $^
# $@ = target, $^ = all dependants, $< = first dependant
BUILDING FROM SOURCE
Linux: On a 64-bit x86 system, I run make.
This will generate both a 64 bit and 32 bit executable.
Both are executable by default on a 64-bit Linux.
Libraries for generating 32-bit executables must be installed.
I have no native 32-bit Linux in use.
As there is currently no standardized way to use the GPIO header
of a Raspberry PI for a parallel port, I have not adapted the source
for this architecture yet.
Windows: For the 32-bit executable, I use plain old Visual Studio 6.
This will generate a dependency to (32-bit) msvcrt.dll which is
preinstalled in any Windows version.
Using newer versions of compiler will create dependencies to
a possibly non-present run-time library such as msvcrt80.dll,
and its redistribution is much larger than avrpp.exe.
Linking msvcrt statically will inflate avrpp.exe by 32 KByte.
I failed to link against Windows DDK 2003 msvcrt.lib, sorry.
For the 64-bit executable, I use Visual Studio 2008, and link to
Windows DDK 2003' msvcrt.lib which generates dependency to 64-bit
msvcrt.dll which is preinstalled on any Windows.
As above, doing not so will generate either dependency to
"versionized" runtime library such as msvcrt110.dll,
or static linkage will inflate avrpp by 40 KByte.
TODO
* compare-and-update mode (list differences, then apply changes only)
* ISP support
* debugWire support
http://www.ruemohr.org/docs/debugwire.html
* tiny disassembler
* use .note.gnu.avr.deviceinfo section as alternative to .signature
to check for right (or yet unknown) AVR device in socket
Henrik Haftmann, +4937127555500, henrik.haftmann@gmail.com
Detected encoding: ASCII (7 bit) | 2
|