Using Simulator in a Debugging Session

When a debugging session with the simulator is started a simulator model of the selected device is loaded and programmed with the user's application. After the application is loaded into the application memory a Power-On Reset (POR) is applied to the model. Hence, the simulator will start at the reset vector, with the POR reset flag set. If the user used "Start Debugging/Continue (F5)" to start the debug session the simulator model would now be running and start execute the application. If the user used "Start Debugging and Break (Alt+F5)" the simulator would start running until it reached the start of the main() function and then do a break.

When in debugging mode the simulator has full support for all debugging features in Atmel Studio, including all views and unlimited number of breakpoints.

The Reset button in Atmel Studio applies a POR to the simulator. The content of flash and eeprom are not lost during POR. When doing a reset in Atmel Studio the execution will normally break at the start of the main() function. By switching to disassembly view before performing the reset the execution will halt at the reset vector. If watchdog is programmed to generate a reset, it can be caught by means of setting a breakpoint at the reset vector and let the simulator run.

There is no way to attach to a running simulator, or detach/disconnect from it and keep it running in the background. Like in the programming dialog, the simulated device ceases to exist when the user stops debugging. This is a restriction that may be lifted in future versions of Atmel Studio.

Because the simulator is a software model it is not limited by the OCD system on the device, and has certain capabilities that the hardware tools do not share: