DOKK / manpages / debian 12 / simavr / simavr.1.en
SIMAVR(1) User Commands SIMAVR(1)

simavr - lean and mean AVR simulator

simavr [OPTION]... [FILE]

Execute AVR firmware, produce VCD waveform files and/or run a debugging session. Specify simulation parameters directly in the emulated code using .elf section or by passing command line arguments.

For more complex virtual circuitry prototyping and simulation see AVR simulator development examples and documentation.

FILE is an elf or ihex formatted executable firmware, assuming filename extension .hex for ihex files.

List all supported AVR cores and exit
Run simulation on CORE
Set core speed in HZ
Run full scale decoder trace
Add traces for IRQ vector
Listen for gdb connection on port 1234
Load next .hex file as flash
Load next .hex file as eeprom
Read input signals from a .vcd file
Raise verbosity level (can be passed more than once)
Display usage message and exit

AVR GDB DEBUGGING

Run the AVR firmware simulation:

simavr -g -m atmega328p -f 16000000 firmware.elf

start avr-gdb and optionally enable tui for better source code readability:


avr-gdb
(gdb) tui enable

load the elf formatted firmware and connect to the running simulation:


(gdb) file firmware.elf
(gdb) target remote :1234

set a break point and go ahead, debug:


(gdb) break main
(gdb) continue
(gdb) next
(gdb) next

This manual page was written by Milan Kupcevic <milan@debian.org> for the Debian project. Permission is granted to copy, redistribute and/or modify this document under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

gtkwave(1), gdb(1)

April 2018 AVR simulator