How to start the Atmel Studio Arduino simulator

by Visual Micro 5. June 2013 07:44

Visual Micro has a new facility due soon to make this process easier.

In the meantime this document describes how you can run the Atmel Studio simulator with an Arduino project.

NOTE: in 1406+ version of Visual Micro step 1) can be ignored because the compiler copies the output files to the local sketch debug/release folder

1) Switch Tools>Options>Visual Micro>Compiler>Always Show Build Path

2) Build your Arduino project, copy the path that appears in the output window to the windows clipboard (without the file:// prefix)

3) In a new instance of Atmel Studio, click "File>Open Object File For Debugging".

4) When prompted paste the build path and "name of your sketch.elf" into the "Specify Object F To Debug" field (example: c:\user\appdata\vmicro\sketch1\board\sketch1.elf). Give the sim project a name and click OK

4) When Atmel opens the new sim project click "No Tool" on the tool bar and select "Simulator" from the "Debugger/Programmer" drop down list.

5) Start debugging (Debug>Start debugging and break),  the sim will run with your Arduino program

That's it!

nb: Some avr processors are not yet supported by the Atmel Studio Sim