{"id":3659,"date":"2018-02-06T19:41:10","date_gmt":"2018-02-07T03:41:10","guid":{"rendered":"https:\/\/visualgdb.com\/w\/?p=3659"},"modified":"2019-10-24T15:48:33","modified_gmt":"2019-10-24T22:48:33","slug":"importing-iar-projects-into-visual-studio-with-visualgdb","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/arm\/import\/iar\/","title":{"rendered":"Importing IAR Projects into Visual Studio with VisualGDB"},"content":{"rendered":"<p>This tutorial shows how to import IAR projects into Visual Studio using the VisualGDB\u00a0project importing plugin. We will\u00a0import a sample project from the STM32 software package and show the necessary manual adjustments.\u00a0Before you begin, install VisualGDB 5.5 or later.<\/p>\n<ol>\n<li>Start Visual Studio and open the VisualGDB Embedded Project Wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/01-newprj.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3660\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/01-newprj.png\" alt=\"01-newprj\" width=\"941\" height=\"653\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/01-newprj.png 941w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/01-newprj-300x208.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/01-newprj-392x272.png 392w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/01-newprj-130x90.png 130w\" sizes=\"(max-width: 941px) 100vw, 941px\" \/><\/a><\/li>\n<li>On the first page of the wizard select <strong>Automatically import a project in a different format<\/strong> -&gt;\u00a0<strong>Import an existing IAR Project<\/strong>, then enter the location of the .ewp file you want to import:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/02-import-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5323\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/02-import-1.png\" alt=\"\" width=\"886\" height=\"693\" \/><\/a>If you are planning to convert the IAR-based project to the GCC compiler, select <strong>GCC Compiler<\/strong> under the IAR option. If you are planning to keep using the IAR compiler with VisualGDB, select the <strong>IAR Compiler<\/strong> instead and make sure you can create and build a basic IAR project as shown <a href=\"https:\/\/visualgdb.com\/tutorials\/arm\/import\/iar\/\">here<\/a>.<\/li>\n<li>On the next page of the wizard, ensure you have selected the compiler (IAR or GCC) that matches your choice on the first page:<br \/>\n<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/03-compiler.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5324\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/03-compiler.png\" alt=\"\" width=\"886\" height=\"693\" \/><\/a><\/li>\n<li>VisualGDB\u00a0should automatically recognize the device type from the project and limit the device list to only include compatible devices:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/device.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5326\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/device.png\" alt=\"\" width=\"886\" height=\"693\" \/><\/a><\/li>\n<li>Select your debug method on the Debug Method page. VisualGDB can automatically detect and configure\u00a0debug settings for most common debug interfaces, so simply connect it via USB and select it in the &#8220;Debug using&#8221; field:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/05\/06-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5313\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/05\/06-debug.png\" alt=\"\" width=\"886\" height=\"693\" \/><\/a><\/li>\n<li>Press &#8220;Finish&#8221; to generate the project. If you are using the IAR compiler, you should be able to build the project now. Note that if the project is using advanced build settings (e.g. specifies individual optimization settings), they may not be imported automatically and you would then need to specify them via the VS Project Properties.<\/li>\n<li>If you are using GCC, the project may not build initially due to missing header directories or preprocessor macros. If this happens,\u00a0VisualGDB will try to locate the missing\u00a0headers and automatically add\u00a0the corresponding directories to the project properties. Click &#8220;Add now&#8221; to automatically fix the project properties:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/06-adddir.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3664\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/06-adddir.png\" alt=\"06-adddir\" width=\"1147\" height=\"759\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/06-adddir.png 1147w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/06-adddir-300x199.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/06-adddir-1024x678.png 1024w\" sizes=\"(max-width: 1147px) 100vw, 1147px\" \/><\/a><\/li>\n<li>The project should now build successfully:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/07-main.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3665\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/07-main.png\" alt=\"07-main\" width=\"1147\" height=\"758\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/07-main.png 1147w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/07-main-300x198.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/07-main-1024x677.png 1024w\" sizes=\"(max-width: 1147px) 100vw, 1147px\" \/><\/a><\/li>\n<li>Once the build succeeds, you should be able to debug the project.\u00a0Simply set your breakpoints and press F5 to begin debugging it:<br \/>\n<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/08-bkpt.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3666\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/08-bkpt.png\" alt=\"08-bkpt\" width=\"1147\" height=\"758\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/08-bkpt.png 1147w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/08-bkpt-300x198.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/02\/08-bkpt-1024x677.png 1024w\" sizes=\"(max-width: 1147px) 100vw, 1147px\" \/><\/a><\/li>\n<\/ol>\n<p>The\u00a0IAR project importing plugin will try to automatically detect IAR-specific paths\u00a0in the project settings and\u00a0replace them with the corresponding GCC paths.\u00a0You can tweak this logic by downloading the <a href=\"https:\/\/github.com\/sysprogs\/BSPTools\/tree\/master\/ProjectImporters\/IARProjectImporter\">IAR importing\u00a0plugin sources,<\/a>\u00a0modifying\u00a0them and replacing the IARProjectImporter.dll file in the\u00a0VisualGDB\u00a0directory with the modified version.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to import IAR projects into Visual Studio using the VisualGDB\u00a0project importing plugin. We will\u00a0import a sample<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[53,157,41,61],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/3659"}],"collection":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/comments?post=3659"}],"version-history":[{"count":6,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/3659\/revisions"}],"predecessor-version":[{"id":5328,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/3659\/revisions\/5328"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=3659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=3659"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=3659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}