complex simavr simulation fails

Skip to first unread message


Dec 28, 2016, 10:02:02 AM12/28/16
to simavr
I am using simavr to simulate grbl (CNC Controller) on atmega328p. I load grbl.hex with a modified examples/board_simduino code.
There are different versions of the firmware. 0.8 works fine and I can process long gcode files and get nice vcd-Waveform files.
0.9 and above can be loaded and processing a few lines of gcode works also, but then the simulation stops.
All firmware versions are "battle proof" and drive a lot of 3d printers and milling machines so there has to be a difference to the 0.8 firmware,
some hidden atmega feature that is not supported by simavr. grbl makes heavy use of timers and interrupts but that also holds for the 0.8 firmware.
I am ready to investigate deeper into the subject. As the gcode parser seems to work for a few lines my next step will be to attach a debugger or use println-statements 
to find out what parts are executed and where execution stops. 
Any hints on this ?


Dec 28, 2016, 10:49:09 AM12/28/16
to simavr
Likely to be some sort of UART trauma.

You should use grbl.elf not the .hex, and then launch simavr with the
debugger support, and connect to it via avr-gdb, that'll tell you
exactly where it's stopping...

FYI I use simavr extensively with Marlin (sort of of bastard child of
grbl) and it works fine...

> --
> You received this message because you are subscribed to the Google Groups
> "simavr" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
> For more options, visit


Dec 29, 2016, 4:04:16 AM12/29/16
to simavr
I will try elf and avr-gdb. I have to find out how to generate the elf-binary and load it. will look into the simavr examples.
I also tried your reprap simulator before christmas and got it compiled from the github sources and got it started after some LD_LIBRARY_PATH tweaks but I was not able to load the marlin firmware.
Will give you some more detailed feedback.


Jan 12, 2017, 11:09:04 AM1/12/17
to simavr
Just succeeded to do some complex simulation with grbl-xyuv (based on grbl-0.8). Will try again with grbl-1.1 with your latest USART patches.
Reply all
Reply to author
0 new messages