|
PiPower
ac0ff3c (Mon Feb 11 21:44:30 2019 -0500)
|
Note that when building in this directory, various state timers are redefined to have shorter periods. The code built for simulation should not be deployed onto an actual device.
make in the sim directory. This will build a version of pipower with debugging symbols enabled.simavr: simavr -m attiny85 -f 1000000 pipower.elf -t -g
simavr with avr-gdb: $ avr-gdb -se pipower.elf (gdb) target remote :1234 (gdb) load (gdb) b loop Breakpoint 1 at 0xaa: file ../pipower.c, line 115. (gdb) c Continuing. Breakpoint 1, loop () at ../pipower.c:115 115 now = millis();
make clean all TRACE=1 in the sim directory. This will include simavr.c, which sets metadata describing trace data we wish to collect with simavr.Use avr-gdb to run simulate.gdb:
avr-gdb -x simulate.gdb
(You could of course just start a manual debugging session, as in the earlier example.)
This will generate gtkwave_trace.vcd, which you can view in gtkwave by running:
gtkwave gtkwave_trace.vcd
You can view an existing trace by running gtkwave against the included save file:
gtkwave pipower.gtkw
1.8.11