using_avrprog(3)
β¨ NAME β¨
using_avrprog β Using the avrdude program
π okay first, a lil note π
This section was contributed by Brian Dean [ bsd@bsdhome.com ].
so the avrdude program was previously called avrprog. they changed the name to avoid confusion with the avrprog program that Atmel ships with AvrStudio. two things, one name, absolute chaos, we do not stan π
π¦ so what even is avrdude
avrdude is a program that is used to update or read the flash and EEPROM memories of Atmel AVR microcontrollers on FreeBSD Unix. it supports the Atmel serial programming protocol using the PC's parallel port and can upload either a raw binary file or an Intel Hex format file. it can also be used in an interactive mode to individually update EEPROM cells, fuse bits, and/or lock bits (if their access is supported by the Atmel serial programming protocol.)
the main flash instruction memory of the AVR can also be programmed in interactive mode, however this is not very useful because one can only turn bits off. the only way to turn flash bits on is to erase the entire memory (using avrdude's -e option). no cap, that's just how it is π
π¦ installing her (FreeBSD ports, iconic)
avrdude is part of the FreeBSD ports system. to install it, simply do the following:
# cd /usr/ports/devel/avrdude
# make install
π₯ burning a .hex file, main character behavior
once installed, avrdude can program processors using the contents of the .hex file specified on the command line. in this example, the file main.hex is burned into the flash memory:
# avrdude -p 2313 -e -m flash -i main.hex
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x1e9101
avrdude: erasing chip
avrdude: done.
avrdude: reading input file "main.hex"
avrdude: input file main.hex auto detected as Intel Hex
avrdude: writing flash:
1749 0x00
avrdude: 1750 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: reading on-chip flash data:
1749 0x00
avrdude: verifying ...
avrdude: 1750 bytes of flash verified
avrdude done. Thank you.
like??? the whole thing verified, we love a clean run π
so let's decode what we just asked for:
- the
-p 2313option lets avrdude know that we are operating on an AT90S2313 chip. this option specifies the device id and is matched up with the device of the same id in avrdude's configuration file (/usr/local/etc/avrdude.conf). - to list valid parts, specify the
-voption π - the
-eoption instructs avrdude to perform a chip-erase before programming; this is almost always necessary before programming the flash. - the
-m flashoption indicates that we want to upload data into the flash memory, while-i main.hexspecifies the name of the input file.
π EEPROM girlies
the EEPROM is uploaded in the same way, the only difference is that you would use -m eeprom instead of -m flash. same vibe, different memory, periodt β¨
π§ interactive mode (aka the chatroom)
to use interactive mode, use the -t option:
# avrdude -p 2313 -t
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x1e9101
avrdude>
the '?' command displays a list of valid commands:
avrdude> ?
>>> ?
Valid commands:
dump : dump memory : dump <memtype> <addr> <N-Bytes>
read : alias for dump
write : write memory : write <memtype> <addr> <b1> <b2> ... <bN>
erase : perform a chip erase
sig : display device signature bytes
part : display the current part information
send : send a raw command : send <b1> <b2> <b3> <b4>
help : help
? : help
quit : quit
use the 'part' command to display valid memory types for use with the
avrdude>
bestie the sentence just ends there in the original, i'm not gonna gaslight you into thinking i finished it π what i can tell you ispartis the move for peeking at valid memory types, andquitis right there when you're done π«Ά
and that's the whole page, fr fr. this was using_avrprog(3) from the avr-libc manual β Version 2.1.0, dated Sat Jan 29 2022. go flash something cute, and remember: erase before you write, or the bits will simply not turn on πΈπ
π¦ where this page comes from
- fedora 43: avr-libc 2.2.1-3.fc43 Β· BSD-3-Clause
- fedora 44: avr-libc 2.2.1-5.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: avr-libc 2.1.0-bp160.1.33 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms