{"id":70,"date":"2014-02-04T17:39:31","date_gmt":"2014-02-04T17:39:31","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=70"},"modified":"2017-10-17T16:07:07","modified_gmt":"2017-10-17T23:07:07","slug":"beaglebone","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/beaglebone\/","title":{"rendered":"Creating a C++ Beaglebone app with Visual Studio"},"content":{"rendered":"<p>This tutorial shows how to create a simple C++ project for the <a href=\"http:\/\/beagleboard.org\/Products\/BeagleBone%2520Black\"> Beaglebone Black <\/a>board using Visual Studio and <a href=\"\/download\/\">VisualGDB 4.1<\/a> or later.<\/p>\n<ol>\n<li>Althrough the Beaglebone Black board contains a pre-loaded Linux image in its internal memory, it&#8217;s recommended to use an external micro-SD card and program it with the latest image from the <a href=\"http:\/\/beagleboard.org\/latest-images\">Beaglebone site<\/a> (e.g. using <a href=\"http:\/\/winflashtool.sysprogs.com\/\">WinFLASHTool<\/a>):<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2014\/02\/flash.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1105\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2014\/02\/flash.png\" alt=\"flash\" width=\"640\" height=\"481\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2014\/02\/flash.png 640w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2014\/02\/flash-300x225.png 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a>Warning! If you are using Debian Stretch or later, you will need to rename the <strong>bbb-uEnv.txt<\/strong> file in the SD card to <strong>uEnv.txt<\/strong>.\u00a0 See <a href=\"https:\/\/visualgdb.com\/tutorials\/beaglebone\/stretch\/\">this tutorial<\/a> for a detailed explanation.<\/li>\n<li>Connect your Beaglebone Black board to a power source (e.g. via USB) and network. The LEDs will start blinking indicating the system activity:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/02-beagleboard.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/02-beagleboard.png\" alt=\"02-beagleboard\" width=\"700\" height=\"372\" \/><\/a><\/li>\n<li>Open Visual Studio and begin creating new project with VisualGDB-&gt;Linux Project Wizard:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/03-project.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/03-project.png\" alt=\"03-project\" width=\"700\" height=\"394\" \/><\/a><\/li>\n<li>As we are creating the simplest possible application, leave defaults on the first page and click &#8220;Next&#8221;:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/04-app.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/04-app.png\" alt=\"04-app\" width=\"700\" height=\"628\" \/><\/a><\/li>\n<li>On the next page select &#8220;Create a new SSH connection&#8221; and enter the hostname of your Beaglebone board. By default Anstrom images use the &#8220;root&#8221; user with an empty password and Debian images use the &#8220;debian&#8221; user with &#8220;debian&#8221; or &#8220;temppwd&#8221; password:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/05-root.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/05-root.png\" alt=\"05-root\" width=\"542\" height=\"407\" \/><\/a><\/li>\n<li>In this example we will setup our project so that it will be compiled directly on the Beaglebone board. It is slower than using cross-compiler, but simpler to achieve:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/06-conn.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/06-conn.png\" alt=\"06-conn\" width=\"700\" height=\"628\" \/><\/a><\/li>\n<li>When you press &#8220;Next&#8221; VisualGDB will ensure that your Beaglebone board contains all the necessary tools to build your project:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/07-test.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/07-test.png\" alt=\"07-test\" width=\"484\" height=\"374\" \/><\/a><\/li>\n<li>At this point we don&#8217;t want to change the source disposition settings, so simply press &#8220;Finish&#8221; on the last page:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/08-source.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/08-source.png\" alt=\"08-source\" width=\"700\" height=\"628\" \/><\/a><\/li>\n<li>VisualGDB will generate a Visual Studio project for you. Build it and see how the source files are transferred to the Beaglebone board and built there using GCC:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/09-build.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/09-build.png\" alt=\"09-build\" width=\"698\" height=\"614\" \/><\/a><\/li>\n<li>Set a breakpoint in main() and press F5 to begin debugging. Once your breakpoint is hit, step over so that the &#8220;Hello, World&#8221; line is displayed in the output window and hover the mouse over <strong>sz<\/strong> to see its value:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/10-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/beaglebone\/10-debug.png\" alt=\"10-debug\" width=\"698\" height=\"614\" \/><\/a><\/li>\n<li>If building projects on Beaglebone is too slow for you, follow <a href=\"http:\/\/visualgdb.com\/tutorials\/beaglebone\/crosscompiler\/\">this tutorial <\/a>to setup cross-compilation.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to create a simple C++ project for the Beaglebone Black board using Visual Studio and VisualGDB<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[34,33],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/70"}],"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=70"}],"version-history":[{"count":3,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/70\/revisions"}],"predecessor-version":[{"id":3417,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/70\/revisions\/3417"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}