{"id":718,"date":"2015-08-31T22:17:24","date_gmt":"2015-09-01T05:17:24","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=718"},"modified":"2015-08-31T22:18:08","modified_gmt":"2015-09-01T05:18:08","slug":"develop-c-programs-for-the-intel-edison-module-with-visual-studio","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/linux\/edison\/","title":{"rendered":"Developing C++ Programs for the Intel Edison Module with Visual Studio"},"content":{"rendered":"<p>This tutorial shows how to use VisualGDB to develop C\/C++ programs for Intel Edison using Visual Studio and the Intel Edison SDK. Before you begin, install <a href=\"http:\/\/visualgdb.com\/download\/\">VisualGDB<\/a> 5.0 or later.<\/p>\n<ol>\n<li>Download the Intel Edison SDK Installer and run it. Ensure you select Eclipse under Development Environment as this will install the compiler and other files necessary to build and debug the code on Windows:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/01-edison.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-719\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/01-edison.png\" alt=\"01-edison\" width=\"710\" height=\"510\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/01-edison.png 710w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/01-edison-300x215.png 300w\" sizes=\"(max-width: 710px) 100vw, 710px\" \/><\/a><\/li>\n<li>Connect your Edison module to the computer using both USB connectors:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/board2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-732\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/board2.jpg\" alt=\"board\" width=\"700\" height=\"197\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/board2.jpg 700w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/board2-300x84.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><\/li>\n<li>Locate the Edison virtual COM port in the Device Manager and open it in a terminal program such as <a href=\"http:\/\/smartty.sysprogs.com\/\">SmarTTY<\/a>. If you have not configured your Edison module yet, tun the &#8220;configure_edison&#8221; command. Otherwise run the &#8220;wpa_cli status&#8221; command to see the IP address of the device:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/02-ip1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-721\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/02-ip1.png\" alt=\"02-ip\" width=\"688\" height=\"385\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/02-ip1.png 688w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/02-ip1-300x168.png 300w\" sizes=\"(max-width: 688px) 100vw, 688px\" \/><\/a><\/li>\n<li>Start Visual Studio. Select File-&gt;New-&gt;Project and choose the VisualGDB Linux Project Wizard:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/03-edisondemo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-722\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/03-edisondemo.png\" alt=\"03-edisondemo\" width=\"800\" height=\"450\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/03-edisondemo.png 800w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/03-edisondemo-300x169.png 300w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/li>\n<li>Proceed with the default &#8220;Create new project&#8221; selection:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/04-newprj.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-723\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/04-newprj.png\" alt=\"04-newprj\" width=\"696\" height=\"628\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/04-newprj.png 696w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/04-newprj-300x271.png 300w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/a><\/li>\n<li>Select &#8220;build the project locally&#8221; and then choose &#8220;Specify toolchain manually&#8221; in the cross-toolchain selector:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/05-locate.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-724\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/05-locate.png\" alt=\"05-locate\" width=\"696\" height=\"628\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/05-locate.png 696w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/05-locate-300x271.png 300w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/a><\/li>\n<li>Find the gdb binary in the Intel SDK directory. The default location for it is as follows:\n<pre class=\"\">C:\\Intel\\iotdk-ide-win\\devkit-x86\\sysroots\\x86_64-pokysdk-mingw32\\usr\\bin\\i586-poky-linux\\i586-poky-linux-gdb.exe<\/pre>\n<p><a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/06-gdb.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-725\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/06-gdb.png\" alt=\"06-gdb\" width=\"858\" height=\"531\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/06-gdb.png 858w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/06-gdb-300x186.png 300w\" sizes=\"(max-width: 858px) 100vw, 858px\" \/><\/a><\/li>\n<li>Select &#8220;Create a new SSH connection&#8221; in the &#8220;Deployment computer&#8221; and provide the settings for your Edison module:<br \/>\n<table>\n<tbody>\n<tr>\n<td>Host Name<\/td>\n<td>(IP address shown in the output of &#8220;wpa_cli status&#8221;)<\/td>\n<\/tr>\n<tr>\n<td>User Name<\/td>\n<td>root<\/td>\n<\/tr>\n<tr>\n<td>Password<\/td>\n<td>(the password specified when running &#8220;configure_edison&#8221;)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/07-ssh.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-726\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/07-ssh.png\" alt=\"07-ssh\" width=\"553\" height=\"415\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/07-ssh.png 553w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/07-ssh-300x225.png 300w\" sizes=\"(max-width: 553px) 100vw, 553px\" \/><\/a><\/li>\n<li>Press &#8220;Finish&#8221; to generate your project. As the toolchain included with the Edison SDK is not configured with a correct sysroot path, the initial toolchain testing will fail. We will fix this once the project is created, so choose &#8220;Ignore&#8221; for now:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/08-fail.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-727\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/08-fail.png\" alt=\"08-fail\" width=\"650\" height=\"450\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/08-fail.png 650w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/08-fail-300x208.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/08-fail-392x272.png 392w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/08-fail-130x90.png 130w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/li>\n<li>VisualGDB will also detect that some of the environment variables do not match between the interactive SSH mode (used to start a shell like bash) and command SSH mode (used to run commands like GDB). Select &#8220;ignore&#8221; for the PS1 variable and &#8220;Fix value&#8221; for the others:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/09-env.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-728\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/09-env.png\" alt=\"09-env\" width=\"640\" height=\"480\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/09-env.png 640w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/09-env-300x225.png 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/li>\n<li>Once the project is generated, right-click on it in Solution Explorer and select &#8220;VisualGDB Project Properties&#8221;. Then go to the Makefile Settings page and add the following line to Common Flags:\n<pre class=\"\">--sysroot=C:\\Intel\\iotdk-ide-win\\devkit-x86\\sysroots\\i586-poky-linux<\/pre>\n<p>Replace the C:\\Intel with the directory where you have installed your Edison SDK:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/10-sysroot.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-729\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/10-sysroot.png\" alt=\"10-sysroot\" width=\"934\" height=\"743\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/10-sysroot.png 934w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/10-sysroot-300x239.png 300w\" sizes=\"(max-width: 934px) 100vw, 934px\" \/><\/a><\/li>\n<li>When you press OK, VisualGDB will re-test the toolchain and configure IntelliSense based on the detected settings. Code completion and navigation will now work as usual. If you are using the Clang-based IntelliSense engine, you will also be able to use Code Map and other advanced features: <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/11-sense.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-730\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/11-sense.png\" alt=\"11-sense\" width=\"699\" height=\"720\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/11-sense.png 699w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/11-sense-291x300.png 291w\" sizes=\"(max-width: 699px) 100vw, 699px\" \/><\/a><\/li>\n<li>Set a breakpoint and press F5 to build your project and start debugging it. VisualGDB will automatically deploy it and show the output in the gdbserver window:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/12-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-731\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/12-debug.png\" alt=\"12-debug\" width=\"699\" height=\"720\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/12-debug.png 699w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/08\/12-debug-291x300.png 291w\" sizes=\"(max-width: 699px) 100vw, 699px\" \/><\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to use VisualGDB to develop C\/C++ programs for Intel Edison using Visual Studio and the Intel<\/p>\n","protected":false},"author":1,"featured_media":736,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[72,104,33],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/718"}],"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=718"}],"version-history":[{"count":3,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/718\/revisions"}],"predecessor-version":[{"id":735,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/718\/revisions\/735"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media\/736"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}