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 ?