Go to file
Stefan Rueger c03f4a7925
Use const in PROGRAMMER function arguments where appropriate
In order to get meaningful const properties for the PROGRAMMER, AVRPART and
AVRMEM arguments, some code needed to be moved around, otherwise a network of
"tainted" assignments risked rendering nothing const:

 - Change void (*enable)(PROGRAMMER *pgm) to void (*enable)(PROGRAMMER *pgm,
   const AVRPART *p); this allows changes in the PROGRAMMER structure after
   the part is known. For example, use TPI, UPDI, PDI functions in that
   programmer appropriate to the part. This used to be done later in the
   process, eg, in the initialize() function, which "taints" all other
   programmer functions wrt const and sometimes requires other finessing with
   flags etc. Much clearer with the modified enable() interface.

 - Move TPI initpgm-type code from initialize() to enable() --- note that
   initpgm() does not have the info at the time when it is called whether or
   not TPI is required

 - buspirate.c: move pgm->flag to PDATA(pgm)->flag (so legitimate
   modification of the flag does not change PROGRAMMER structure)

 - Move AVRPART_INIT_SMC and AVRPART_WRITE bits from the flags field in
   AVRPART to jtagmkII.c's private data flags32 fiels as FLAGS32_INIT_SMC and
   FLAGS32_WRITE bits

 - Move the xbeeResetPin component to private data in stk500.c as this is
   needed by xbee when it saddles on the stk500 code (previously, the flags
   component of the part was re-dedicated to this)

 - Change the way the "chained" private data are used in jtag3.c whilst
   keeping the PROGRAMMER structure read-only otherwise

 - In stk500v2.c move the STK600 pgm update from stk500v2_initialize() to
   stk500v2_enable() so the former keeps the PROGRAMMER structure read-only
   (for const assertion).

 - In usbasp change the code from changing PROGRAMMER functions late to
   dispatching to TPI or regular SPI protocol functions at runtime; reason
   being the decision whether to use TPI protocol is done at run-time
   depending on the capability of the attached programmer

Also fixes Issue #1071, the treatment of default eecr value.
2022-08-17 16:05:28 +01:00
.github/workflows Fix syntax error in workflow build.yml file 2022-04-26 21:41:03 +02:00
atmel-docs Just to make sure this won't get lost over time, make a copy of 2015-11-02 21:13:28 +00:00
src Use const in PROGRAMMER function arguments where appropriate 2022-08-17 16:05:28 +01:00
tools Allow for overriding make tool from environment 2021-12-10 22:34:57 +00:00
.editorconfig Add GitHub build action for CMake project 2021-12-20 17:52:37 +01:00
.gitattributes Add .gitattributes and .gitignore, remove .cvsignore 2021-12-16 23:24:32 +01:00
.gitignore Add cscope.out to list of ignored files 2022-01-13 22:43:03 +01:00
AUTHORS Mention Hans Eirik Bull for his recent contributions 2022-02-01 23:26:20 +01:00
CMakeLists.txt CMakeLists.txt: fix build without C++ 2022-06-26 21:35:42 +02:00
COPYING Revert "Hint about possibly differing licensing terms." 2022-01-04 12:53:27 +01:00
INSTALL Update toplevel files. 2021-12-18 22:32:50 +01:00
NEWS Update NEWS 2022-08-15 00:56:38 +01:00
README.md Update documentation link to new URL 2022-04-10 11:28:39 -07:00
build.sh fix typo 2022-05-09 14:51:16 +02:00

README.md

AVRDUDE

Build Status

AVRDUDE - AVR Downloader Uploader - is a program for downloading and uploading the on-chip memories of Microchips AVR microcontrollers. It can program the Flash and EEPROM, and where supported by the programming protocol, it can program fuse and lock bits. AVRDUDE also supplies a direct instruction mode allowing one to issue any programming instruction to the AVR chip regardless of whether AVRDUDE implements that specific feature of a particular chip.

AVRDUDE was originally written in 2003 by Brian S. Dean. Since 2006, AVRDUDE has been maintained by Jörg Wunsch, with the help of various contributors.

The latest version of AVRDUDE is always available here:
https://github.com/avrdudes/avrdude

Documentation

Documentation for current and previous releases is on Github Pages.

Getting AVRDUDE for Windows

To get AVRDUDE for Windows, install the latest version from the Releases page.

Alternatively, you may build AVRDUDE yourself from source.

Getting AVRDUDE for Linux

To install AVRDUDE for Linux, install the package avrdude by running the following commands:

sudo apt-get install avrdude

Alternatively, you may build AVRDUDE yourself from source.

Getting AVRDUDE for MacOS

On MacOS, AVRDUDE can be installed through Mac Ports.

Alternatively, you may build AVRDUDE yourself from source.

Using AVRDUDE

AVRDUDE is a command-line application. Run the command avrdude without any arguments for a list of options.

A typical command to program your HEX file into your AVR microcontroller looks like this:

avrdude -c <programmer> -p <part> -U flash:w:<file>:i

For instance, to program an Arduino Uno connected to the serial port COM1 with a HEX file called blink.hex, you would run the following command:

avrdude -c arduino -P COM1 -b 115200 -p atmega328p -D -U flash:w:objs/blink.hex:i

There are many different programmers and options that may be required for the programming to succeed.

For more information, refer to the AVRDUDE documentation.