AVR-MDF
Microcontroller Development Framework — build, flash, fuses & debug ATmega / ATtiny / ATxmega projects with GNU avr-gcc + avr-libc or Microchip XC8 ( Highlights
Requirements
Installation
ToolchainsEvery project carries its own Picking a toolchain folder
The pickers list every auto-detected candidate with its source, persist the resolved executable, and end with a version toast + full view refresh; an unmatched folder gets an honest "checked everything — use anyway?" fallback. GNU avr-gcc (default)
Microchip XC8 (
|
| View | What it gives you |
|---|---|
| Project & Commands | Create / Import project, live config status, board & sources overview, Actions (Build / Flash / Clean / Disassembly), Device (Fuse Editor… / Chip Erase / EEPROM upload & download) and Port Settings |
| Memory | usage bars with threshold tick + Δ, symbols, build-history chart, live updates after every build |
| Serial Monitor | port/baud dropdowns, Start/⏹ Stop, timestamps & autoscroll, EOL, send line, rx/tx counters |
| Development Tools | avr-gcc + XC8 catalogues with live found-counts and the toolchain pickers |
| AVR-Libc Reference | every avr-libc module / function (or the XC8 catalogue) — right-click → insert the #include |
Every view is a draggable tab; AVR: Return Views to the Sidebar brings them home. Keybindings: Ctrl+Alt+B/F/C build/flash/clean, Ctrl+Alt+M monitor, Ctrl+Alt+D debug, Ctrl+Alt+T switch toolchain.
Project layout
my-project/
├─ avr-project.json # the project file (visual editor: ✎ in the tree)
├─ src/ # .c/.cpp/.S sources (recursively; .S gets cpp)
├─ include/ lib/ components/ # optional (components = source libraries)
└─ build/ # obj/**, comp/**, firmware.elf/.hex/.bin/.eep/.map
Minimal avr-project.json:
{
"name": "blink",
"board": "uno",
"sources": ["src"],
"build": { "output_dir": "build", "output_name": "firmware" }
}
Build options: optimization (default -Os), c_flags/cxx_flags/asm_flags/link_flags, lto, gc_sections (on), relax (on), hooks pre_build / post_link / post_build / pre_upload / post_upload (a string, or an array for several commands per stage). Upload: programmer (avrdude -c), port, baud, eeprom, tool+args (custom with full ${…} expansion), fuses (starting values for the Fuse Editor). Variables: ${workspaceFolder}, ${board.mcu}, ${board.fcpu}, ${outputHex}, ${config:avr.comPort}, ${env:NAME}… — unresolved ones stay literal.
Fuses
AVR: Open Fuse Editor… — bit-level editing with per-bit descriptions (SPIEN / RSTDISBL / DWEN warnings included), CKSEL clock tables, presets (internal 1/8 MHz, external crystal, Optiboot, BOD…), Read from chip / Write to chip via avrdude with a confirmation listing the exact bytes. Verified layouts: ATmega328P/328/168(P), 2560/1280, tiny25/45/85, tiny24/44/84, tiny2313/4313, mega16/32, mega8. Everything else falls back to raw hex mode with a datasheet warning.
Debugging
Simulator-first on simavr with avr-gdb in MI mode — one flow, no native modules:
- Press F5 (works without launch.json): starts
simavr -g -m <mcu> -f <freq> firmware.elf, connects avr-gdb to:1234, stops onmain(). - Breakpoints, stepping, hover variables, Locals/Registers, watches, memory via the Hex Editor, raw gdb commands in the Debug Console (
info registers,x/16x 0x100,disassemble…). - Hardware: the
gdbbackend attaches to any GDB-RSP server — setgdbServerCmd(e.g.avarice --jtag /dev/ttyUSB0 :4242) and the extension launches/stops it for you.
Debugging is avr-gcc-only — on an XC8 project F5 offers to switch the toolchain first.
avrdude
- Recipes in AVR: Select Programmer (stored in the project's
upload.programmer) -U flash:w:firmware.hex:aby default — the ELF is accepted too when the hex is missing (explicit:e, avrdude 7+)- EEPROM: upload any image you pick (
.hex/.eep/.bin, auto-detected format) / download dumps tobuild/eeprom-dump-<date>.hex(toast with the byte count + Open) avr.avrdude.verbose(-v),avr.avrdude.verifyoff →-V,avr.avrdude.eraseBeforeFlash→-e,avr.avrdude.extraArgsfor global extras
Coming from another IDE?
AVR: Import Project from Other IDE… — pick the format (Arduino sketch .ino / PlatformIO platformio.ini / Makefile / Code::Blocks .cbp / Eclipse CDT .cproject), pick the file, review the draft (name, MCU, sources, flags, upload + honest notes on anything that could not be migrated), and it writes avr-project.json in place, adds the folder to the workspace, syncs tasks/launch/IntelliSense and opens the Project Editor.
Settings
| Setting | Default | Description |
|---|---|---|
avr.toolchainPath |
"" |
avr-gcc bin folder / prefix / executable; empty = auto-detect |
avr.xc8.path |
"" |
Microchip XC8 location (bin folder or xc8-cc executable); empty = auto-detect |
avr.xc8.optimization |
default |
XC8 optimization level (-O): default/0/1/2/3 |
avr.xc8.cStandard |
c99 |
XC8 C standard (-std=): c90/c99 |
avr.xc8.warnings |
true |
pass -Wall to xc8-cc |
avr.xc8.extraArgs |
"" |
extra xc8-cc arguments (e.g. --opt=+asm,+speed) |
avr.avrdudePath |
"" |
avrdude override |
avr.simavrPath |
"" |
simavr override |
avr.gdbPath |
"" |
avr-gdb override |
avr.boardsDir |
"" |
extra board JSON folder (priority: project .avr/boards → this → global → built-in) |
avr.externalSdkPath |
"" |
external SDK folder — scanned for lib/*.a + components/<subfolder>/ (avr-gcc pipeline); relative when inside the project, absolute when outside |
avr.comPort |
"" |
serial port |
avr.programmer |
"" |
default avrdude programmer (project upload.programmer wins) |
avr.shellPath |
"" |
Windows shell override |
avr.reuseTerminal |
true |
reuse the AVR terminal |
avr.saveSettingsToWorkspace |
true |
save port etc. to workspace settings |
avr.autoHexBin |
true |
also produce .bin + .eep after build |
avr.postBuildAction |
none |
flash = flash right after a successful build |
avr.buildMode |
release |
debug adds -Og -g + DEBUG (DWARF for simavr/GDB) |
avr.avrdude.verbose |
false |
pass -v to avrdude |
avr.avrdude.verify |
true |
verify flash after writing (off adds -V) |
avr.avrdude.eraseBeforeFlash |
false |
explicit chip erase (-e) before writing |
avr.avrdude.extraArgs |
"" |
global extra avrdude arguments |
avr.debug.stopOnEntry |
true |
run to main() on F5 |
avr.debug.simPath |
"" |
explicit simavr |
avr.debug.gdbPath |
"" |
explicit avr-gdb |
avr.debug.clockFromBoard |
true |
feed the board's f_cpu to simavr (-f) |
avr.debug.mcu |
"" |
override the simulator MCU |
avr.debug.syncLaunchJson |
true |
merge the debug records into launch.json |
avr.intellisense.autoConfig |
true |
configure IntelliSense when missing |
avr.autoGenerateTasks |
true |
merge the three AVR tasks into tasks.json |
avr.monitorBaud |
115200 |
default Serial Monitor baud |
avr.monitorEol |
lf |
send-line terminator |
avr.monitorTimestamps |
false |
prefix received lines with a timestamp |
avr.monitorAutoOpen |
true |
open the Serial Monitor after flash |
avr.memory.thresholdWarning |
85 |
area turns yellow at this % |
avr.memory.historyLimit |
50 |
builds kept in the memory report history |
Supported shells: PowerShell, cmd, bash, sh, zsh, fish, dash, ksh, csh, tcsh, WSL — commands run in the AVR terminal with per-shell exit-code markers; long lines are split at token boundaries under the shell's line limit; compiler failures are replayed hidden to capture stderr for the Problems panel.
License
MIT © Dzantemir