Importing IAR Projects into Visual Studio with VisualGDB

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.

  1. Start Visual Studio and open the VisualGDB Embedded Project Wizard:01-newprj
  2. 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:02-import
  3. VisualGDB should automatically recognize the device type from the project and display it on the next page:
    03-device
  4. 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:04-debug
  5. 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:06-adddir
  6. The project should now build successfully:07-main
  7. Once the build succeeds, you should be able to debug the project. Simply set your breakpoints and press F5 to begin debugging it:
    08-bkpt

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.