This tutorial shows how to import IAR projects into Visual Studio using the VisualGDB project importing plugin. We will import a sample project from the STM32 software package and show the necessary manual adjustments. Before you begin, install VisualGDB 5.3 or later.
- Start Visual Studio and open the VisualGDB Embedded Project Wizard:
- On the first page of the wizard select Automatically import a project in a different format -> Import an existing IAR Project, then enter the location of the .ewp file you want to import:
- VisualGDB should automatically recognize the device type from the project and display it on the next page:
- Select your debug method on the Debug Method page. VisualGDB can automatically detect and configure debug settings for most common debug interfaces, so simply connect it via USB and select it in the “Debug using” field:
- Press “Finish” to generate the project. As IAR and GCC use different header directories, the project may not build initially due to missing header directories or preprocessor macros. If this happens, VisualGDB will try to locate the missing headers and automatically add the corresponding directories to the project properties. Click “Add now” to automatically fix the project properties:
- The project should now build successfully:
- Once the build succeeds, you should be able to debug the project. Simply set your breakpoints and press F5 to begin debugging it:
The IAR project importing plugin will try to automatically detect IAR-specific paths in the project settings and replace them with the corresponding GCC paths. You can tweak this logic by downloading the IAR importing plugin sources, modifying them and replacing the IARProjectImporter.dll file in the VisualGDB directory with the modified version.