Install the Amel Studio IDE
Please install Visual Micro from within the Atmel Studio 7 IDE using "Tools>Extensions and Updates>Available Downloads>All"
A free Arduino extension for Atmel Studio. Arduino compatible build and Atmel Studio debugging. A paid version is available at low cost with many additional features.
Atmel Studio with Visual Micro offers Arduino compatible project build alongside hardware and simulated debuggers. Visual Micro ensures project codes stays cross-platform Arduino compatible and also allows the Atmel platform specific tools to be used when required.
Visual Micro in Atmel Studio works the same as it does in Visual Studio (apart from shared projects and editing of libraries) but also combines Atmel programming, debugging and simulators.
Using Atmel Studio Device Programming With Arduino Builds
Visual Micro, in Atmel Studio 7, provides an additional Arduino programmer called "Atmel Studio Device Programming".
Selecting this option will use the standard Atmel project configuration settings (instead of Arduino programmers or bootloader).
Advanded Mode (.ino sources ignored, build from real source code not a temp folder, still applies all other arduino build rules for core and libraries) - Switch on menu command "vMicro>Debugger>Atmel Studio" to use the Atmel Studio Avr Simulator or Hardware Debuggers (ie: Jtag/Swd/Segger) instead of the Visual Micro Software debugger. Add a project_name.cpp to override all .ino files. Click "vMicro>Toggle Hidden Files" to more easily see and debug Arduino core and library source code.
** PLEASE NOTE **
- Debug builds produce larger outputs. Switch the tool bar from Debug to Release if output size must be as small as possible (same as Arduino IDE).
- Atmel Studio 7 contains some "Arduino" functions unlreated to Visual Micro (such as 'Import Sketch'. These functions can be useful but convert Arduino project code to single platform .cpp projects that are unique to Atmel. Converted projects will fall outside of the Arduino compatible cross-platform eco system . This confuses some users who mistakenly believe they are using Visual Micro features and have subsequently given poor reviews in the Atmel Gallery (or emailed complaints). New user how to tell if you are using a Visual Micro project? Visual Micro uses .ino files in projects, Atmel does not. The Arduino IDE will compile projects created or edited with Visual Micro (if you adhere to the published Arduino.cc folder structure) which is not the case for native Atmel projects.
- Problem: Atmel Studio 7 automatically adds source code to new projects. The code must be deleted for an Arduino project to compile correctly. The code is a main.cpp in the project folder and a directory below the project called Device_startup. Solution: Re-instated in versions of Visual Micro after 1st dec 2016, a prompt will appear after compilation requesting the files be deleted. In previous versions only a message was displayed in the compiler output. It is difficult to know how to handle this problem. Some advanced users might want to have a main.cpp and will be annoyed by the prompt. However other novice users have been leaving poor reviews since the prompt was removed.
- Installing from within the IDE via "Tools>Extensions and Updates>Online" is recommended. (Some users will not be able to install from outside of the IDE as a result of an oversight by Microsoft when releasing the Visual Studio shell upon which Atmel Studio is based)
- Switching on "vMicro>Debugger>Atmel Studio Debugger" allows Atmel ICE and other hardware debuggers to be used in combination with a standard Arduino upload. Please follow the guide in the output window after a build to ensure a project_name.cpp is used as an alternatve to .ino files but ensure an empty or dummy project_name.ino remains in the project. The project_name.ino is ignored by the compiler when a .cpp is used but Visual Micro will assume a standard non-arduino atmel project without the .ino.
- To upload and/or debug Arduino using Atmel Studio hardware tools (intead of usb) please set your Arduino "programmer" to the special entry called "Atmel Studio Device Programming" the is also a tick box below the menu called "Always use programmer for upload" that must be ticked/checked . When Device Programming is selected it is possible to right click the Project Name (in the solution explorer) and then click "Properties". This will open the Atmel Studio Project Properties which contains a Tab called "Tool". Set the correct Tool for your project!
- Switch off optimization in your code or in the visual micro project properties. Add 8) to the top of your code
- #pragma GCC optimize ("O0")
- "Click tools>show hidden files" so the Arduino core and libraries have source code shortcuts in your project. Click the menu again to remove the short cuts of delete them yourself (they are correctly ignored by the compiler anyway).
- We have an active forum. Please report issues or ask questions. You will be answered. Thank you.
Simple Mode (builds all sources and applies arduino build rules to .ino files, builds in a temp folder - not recommended for hardware debugging)
Local project Board.txt allows override of most Arduino build properties (advanced users + requires full version)
tip: To assist with creation of board.txt, the vMicro>Compiler menu provides facility to show build properties and verbose output
++ Easy access to the underlying Arduino source codes using menu command "vMicro>Toggle Hidden Files"
Debugging Arduino in Atmel Studio with J-Link
In order to use J-Link with Atmel Studio, usually it is not necessary to separately install the J-Link software and documentation package. Anyhow, we recommend to make sure that the latest version of the J-Link software is installed and the DLL in Atmel Studio is updated to the latest version. Atmel Studio comes with a lot sample projects for various eval boards.
The following steps explain how to configure a project to be used with J-Link. You can also see this information on the segger.com website
- Open the project to configure
- Click Project | Properties from the main menu
- Click the Tool tab and select J-Link
- Make sure that the appropriate target interface (JTAG / SWD / ...) is selected
- Make sure that a proper target interface speed is selected (4 MHz works for almost all Cortex-M based targets and leads to good performance)
- Click Build | Build Solution from the main menu
- In order to start a debug session, click Start Debugging and Break.
- Now the project is ready to be debugged with J-Link / J-Trace.