{"id":3199,"date":"2017-09-07T17:35:40","date_gmt":"2017-09-08T00:35:40","guid":{"rendered":"https:\/\/visualgdb.com\/w\/?p=3199"},"modified":"2017-10-10T16:13:50","modified_gmt":"2017-10-10T23:13:50","slug":"importing-mbed-cli-projects-using-project-importer-sdk","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/arm\/import_sdk\/","title":{"rendered":"Importing mbed-cli Projects using Project Importer SDK"},"content":{"rendered":"<p>This tutorial shows how to automatically import 3rd-party projects in custom formats into VisualGDB. We will use mbed-cli to create a project using the <a href=\"https:\/\/www.mbed.com\/\">ARM mbed<\/a> framework, export it to a Makefile and then show how to use a VisualGDB importer plugin to extract the build settings from the Makefile and let VisualGDB create a project based on them.<\/p>\n<p>Before you begin, install VisualGDB 5.3 or later.<\/p>\n<ol>\n<li>Install Python 2.7 (not 3.x) and Git. Open a command prompt and ensure both Python and Git are on the PATH variable:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/01-git.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3200\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/01-git.png\" alt=\"01-git\" width=\"979\" height=\"275\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/01-git.png 979w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/01-git-300x84.png 300w\" sizes=\"(max-width: 979px) 100vw, 979px\" \/><\/a><\/li>\n<li>Clone the mbed-cli git repository, build and install mbed-cli:\n<pre class=\"\">git clone https:\/\/github.com\/ARMmbed\/mbed-cli.git\r\ncd mbed-cli\r\npython setup.py install<\/pre>\n<p><a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/03-install.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3201\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/03-install.png\" alt=\"03-install\" width=\"979\" height=\"379\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/03-install.png 979w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/03-install-300x116.png 300w\" sizes=\"(max-width: 979px) 100vw, 979px\" \/><\/a><\/li>\n<li>Add the &lt;python&gt;\\scripts directory to PATH and ensure mbed.exe is can be located:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/04-mbed.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3202\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/04-mbed.png\" alt=\"04-mbed\" width=\"979\" height=\"379\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/04-mbed.png 979w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/04-mbed-300x116.png 300w\" sizes=\"(max-width: 979px) 100vw, 979px\" \/><\/a><\/li>\n<li>Now we will import the mbed-os-example-blinky project using mbed-cli. Run the following command:\n<pre class=\"\">mbed import mbed-os-example-blinky<\/pre>\n<p><a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/import.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3224\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/import.png\" alt=\"import\" width=\"979\" height=\"379\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/import.png 979w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/import-300x116.png 300w\" sizes=\"(max-width: 979px) 100vw, 979px\" \/><\/a><\/li>\n<li>Go to the <strong>mbed-os-example-blinky<\/strong> directory and export the project to a Makefile:\n<pre class=\"\">mbed export -i GCC_ARM -m &lt;target name&gt;<\/pre>\n<p><a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/05-export.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3204\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/05-export.png\" alt=\"05-export\" width=\"979\" height=\"379\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/05-export.png 979w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/05-export-300x116.png 300w\" sizes=\"(max-width: 979px) 100vw, 979px\" \/><\/a><\/li>\n<li>The export command should create a Makefile in the project directory. Locate it and open it in a text editor:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/05a-makefile.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3203\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/05a-makefile.png\" alt=\"05a-makefile\" width=\"1313\" height=\"802\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/05a-makefile.png 1313w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/05a-makefile-300x183.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/05a-makefile-1024x625.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a>The Makefile should contain a list of object files, include directories and compilation flags listed in a common format. The project importer will use basic regular expressions to extract those values and pass them to VisualGDB so that VisualGDB can create a new project based on that information.<\/li>\n<li>Clone the Sysprogs BSPTools repository:\n<pre class=\"\">https:\/\/github.com\/sysprogs\/BSPTools<\/pre>\n<p><a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/06-clonetools.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3205\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/06-clonetools.png\" alt=\"06-clonetools\" width=\"979\" height=\"346\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/06-clonetools.png 979w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/06-clonetools-300x106.png 300w\" sizes=\"(max-width: 979px) 100vw, 979px\" \/><\/a><\/li>\n<li>Locate and open the<strong> ProjectImporters\\MbedProjectImporter\\MbedProjectImporter.sln<\/strong> file, then build it:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/07-buildimporter.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3206\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/07-buildimporter.png\" alt=\"07-buildimporter\" width=\"1313\" height=\"802\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/07-buildimporter.png 1313w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/07-buildimporter-300x183.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/07-buildimporter-1024x625.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a><\/li>\n<li>The MbedProjectImporter.dll is a VisualGDB plugin that parses mbed-generated Makefiles and returns structured information to VisualGDB. We will first show how to install and use it and then give an overview of its internals. Copy the built .dll file to <strong>C:\\Program Files (x86)\\Sysprogs\\VisualGDB\\ProjectImporters<\/strong>: <a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/08-copyimporter.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3207\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/08-copyimporter.png\" alt=\"08-copyimporter\" width=\"1125\" height=\"593\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/08-copyimporter.png 1125w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/08-copyimporter-300x158.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/08-copyimporter-1024x540.png 1024w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/08-copyimporter-390x205.png 390w\" sizes=\"(max-width: 1125px) 100vw, 1125px\" \/><\/a><\/li>\n<li>Start another instance of Visual Studio and open VisualGDB Embedded Project Wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/09-import.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3208\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/09-import.png\" alt=\"09-import\" width=\"941\" height=\"635\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/09-import.png 941w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/09-import-300x202.png 300w\" sizes=\"(max-width: 941px) 100vw, 941px\" \/><\/a><\/li>\n<li>Select <strong>Automatically import a project in a different format<\/strong> -&gt; <strong>Import a Makefile generated by mbed<\/strong>:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/10-makefile.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3209\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/10-makefile.png\" alt=\"10-makefile\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/10-makefile.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/10-makefile-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>On the next page select the device matching your target. <strong>Do not select &#8220;Use ARM mbed&#8221; as it would reference another copy of mbed sources that are shipped with VisualGDB.<\/strong><a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/11-device.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3210\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/11-device.png\" alt=\"11-device\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/11-device.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/11-device-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a>If you are targetting a device that is not supported by VisualGDB, select &#8220;Specify flags manually&#8221; and leave all fields empty. All relevant build flags will be automatically imported from the mbed Makefile, so selecting the device here is only needed for automatic debugger configuration and memory size display in Memory Explorer.<\/li>\n<li>On the next page configure your debug settings. VisualGDB will recognize most of the popular USB programmers and install the drivers automatically:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/12-stlink.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3211\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/12-stlink.png\" alt=\"12-stlink\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/12-stlink.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/12-stlink-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>Press &#8220;Finish&#8221; to generate the project. Build it with Ctrl-Shift-B. If the build fails at the O_BINARY line, simply comment it out:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/13-binary.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3212\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/13-binary.png\" alt=\"13-binary\" width=\"1313\" height=\"802\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/13-binary.png 1313w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/13-binary-300x183.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/13-binary-1024x625.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a><\/li>\n<li>If you have selected the device in the VisualGDB project wizard, you may get a conflict between the mbed startup file and VisualGDB startup file. This will lead to error messages like &#8220;multiple definition of &#8230;&#8221;:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/14-multidef.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3213\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/14-multidef.png\" alt=\"14-multidef\" width=\"1313\" height=\"802\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/14-multidef.png 1313w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/14-multidef-300x183.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/14-multidef-1024x625.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a><\/li>\n<li>Locate the VisualGDB startup file and exclude it from build:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/exclude.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3225\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/exclude.png\" alt=\"exclude\" width=\"1313\" height=\"802\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/exclude.png 1313w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/exclude-300x183.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/exclude-1024x625.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a><\/li>\n<li>Now the project should build successfully. Set a breakpoint on the wait() line and press F5 to start debugging:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/16-build.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3215\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/16-build.png\" alt=\"16-build\" width=\"1313\" height=\"802\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/16-build.png 1313w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/16-build-300x183.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/16-build-1024x625.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a><\/li>\n<li>Once the breakpoint hits, ensure you can debug the project:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/17-run.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3216\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/17-run.png\" alt=\"17-run\" width=\"1313\" height=\"802\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/17-run.png 1313w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/17-run-300x183.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/17-run-1024x625.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a><\/li>\n<li>VisualGDB has automatically converted the settings from the Makefile to regular Visual C++ project settings. You can use the regular Visual Studio GUI to edit them:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/18-flags.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3217\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/18-flags.png\" alt=\"18-flags\" width=\"1313\" height=\"802\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/18-flags.png 1313w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/18-flags-300x183.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/18-flags-1024x625.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a><\/li>\n<li>If you get IntelliSense errors related to unknown core, set the ARM instruction set and CPU type manually via the ARM Settings page of Visual Studio Project Properties:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/19-armsettings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3218\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/19-armsettings.png\" alt=\"19-armsettings\" width=\"822\" height=\"558\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/19-armsettings.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/19-armsettings-300x204.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>Another source of errors could be linker scripts. For some mbed targets the linker scripts expect the build system to preprocess them before running the linker. As of v5.3, VisualGDB does not support this, so you would need to manually modify the linker script expanding any preprocessor-related statements.<\/li>\n<li>Now we will give a quick overview of the importer plugin internals. Close the solution and modify the Makefile (e.g. add an empty line). Once you reopen the solution, VisualGDB will suggest updating the project accordingly:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/20-modified.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3219\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/20-modified.png\" alt=\"20-modified\" width=\"1313\" height=\"802\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/20-modified.png 1313w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/20-modified-300x183.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/20-modified-1024x625.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a><\/li>\n<li>Switch to another instance of Visual Studio that has the importer project open and attach it to the instance running VisualGDB:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/21-attach.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3220\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/21-attach.png\" alt=\"21-attach\" width=\"1313\" height=\"802\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/21-attach.png 1313w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/21-attach-300x183.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/21-attach-1024x625.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a><\/li>\n<li>Set a breakpoint in the ImportProject() method and press &#8220;Yes&#8221; in the project updating prompt. Then set a breakpoint in the line returning an instance of ImportedExternalProject and let the importer run: <a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/22-files.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3221\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/22-files.png\" alt=\"22-files\" width=\"1313\" height=\"802\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/22-files.png 1313w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/22-files-300x183.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/22-files-1024x625.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a><\/li>\n<li>The importer plugin returns 2 major types of information about the project: virtual directories for Solution Explorer and build flags (e.g. include directories). The virtual directory object is defined as follows:\n<pre class=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public class ImportedFile\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public string FullPath;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public bool IsHeader;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public string ObjectFilePath;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public List&lt;FileConfiguration&gt; Configurations;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public class VirtualDirectory\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public string Name;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public List&lt;VirtualDirectory&gt; Subdirectories;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public List&lt;ImportedFile&gt; Files;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/pre>\n<p>Virtual directories don&#8217;t have to follow the physical directory layout and will correspond to the virtual nodes in Solution Explorer.<\/li>\n<li>Build flags are defined in structure shown below:\n<pre class=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public class InvariantBuildSettings\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public string[] IncludeDirectories;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public string[] PreprocessorMacros;\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public string CStandard;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public string CXXStandard;\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public string[] ExtraCFLAGS;\u00a0\u00a0\u00a0 \/\/Will also be added to CXXFLAGS\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public bool GeneratePreprocessorOutput;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public string[] LibraryDirectories;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public string[] LibraryNames;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public string[] AdditionalLinkerInputs;\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public string LinkerScript;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public bool IsDebugConfiguration;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public string[] ExtraLDFLAGS;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/pre>\n<p>Normally each imported project should return a single configuration containing an instance of the InvariantBuildSettings object describing the build settings (all paths should be absolute; VisualGDB will automatically convert them to relative as needed):<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/23-settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3222\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/23-settings.png\" alt=\"23-settings\" width=\"1313\" height=\"802\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/23-settings.png 1313w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/23-settings-300x183.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/23-settings-1024x625.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a><\/li>\n<li>If you want to create a new importer, create a C# class library project, reference the BSPEngine.dll file and add a public class implementing the IExternalProjectImporter interface. As soon as your place your library into the &#8220;ProjectImporters&#8221; subdirectory under VisualGDB installation directory, VisualGDB will recognize it and will show it on the first page of the VisualGDB Embedded Project Wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/24-props.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3223\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/24-props.png\" alt=\"24-props\" width=\"1313\" height=\"802\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/24-props.png 1313w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/24-props-300x183.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/24-props-1024x625.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a><\/li>\n<li>For some targets (like LPC NXP devices) the files imported from mbed may conflict with the files from the regular SDK. If you encounter strange build errors, try removing the &lt;AdditionalIncludeDirectories&gt; definition in the &lt;mcu&gt;.props file in the project directory and remove all .c and .cpp files inside the &#8220;Device-specific files&#8221; folder in Solution Explorer. if you are using a Custom edition or higher, you can also convert your project to a stand-alone one and remove the MCU-specific include directories and additional sources via VisualGDB Project Properties:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/standalone.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3290\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/standalone.png\" alt=\"standalone\" width=\"1040\" height=\"818\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/standalone.png 1040w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/standalone-300x236.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/09\/standalone-1024x805.png 1024w\" sizes=\"(max-width: 1040px) 100vw, 1040px\" \/><\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to automatically import 3rd-party projects in custom formats into VisualGDB. We will use mbed-cli to create<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[114],"tags":[53,133,41,115,110],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/3199"}],"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=3199"}],"version-history":[{"count":4,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/3199\/revisions"}],"predecessor-version":[{"id":3291,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/3199\/revisions\/3291"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=3199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=3199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=3199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}