{"id":223,"date":"2015-07-20T19:55:51","date_gmt":"2015-07-21T02:55:51","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=223"},"modified":"2015-07-20T20:10:20","modified_gmt":"2015-07-21T03:10:20","slug":"using-visualgdb-with-the-official-arm-toolchain","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/arm\/gnuarm\/","title":{"rendered":"Using VisualGDB with the Official ARM Toolchain"},"content":{"rendered":"<p>This tutorial shows how to use VisualGDB to build and debug embedded firmware for ARM devices using the <a href=\"https:\/\/launchpad.net\/gcc-arm-embedded\">GCC ARM toolchain <\/a>maintained by ARM.<\/p>\n<p>Before you begin, install VisualGDB 5.0+ and download the ARM toolchain from <a href=\"https:\/\/launchpad.net\/gcc-arm-embedded\">https:\/\/launchpad.net\/gcc-arm-embedded<\/a><\/p>\n<ol>\n<li>Install the GNU ARM toolchain to a directory that does not contain spaces:<br \/>\n<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/gnuarmdir.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-226 aligncenter\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/gnuarmdir.png\" alt=\"gnuarmdir\" width=\"513\" height=\"399\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/gnuarmdir.png 513w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/gnuarmdir-300x233.png 300w\" sizes=\"(max-width: 513px) 100vw, 513px\" \/><\/a><\/li>\n<li>Enable the &#8220;Add Registry Information&#8221; checkbox on the last page of the toolchain installer:<br \/>\n<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/gnuarm1.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-225 aligncenter\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/gnuarm1.png\" alt=\"gnuarm\" width=\"513\" height=\"399\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/gnuarm1.png 513w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/gnuarm1-300x233.png 300w\" sizes=\"(max-width: 513px) 100vw, 513px\" \/><\/a><\/li>\n<li>Launch Visual Studio and start creating a new project via File-&gt;New Project-&gt;VisualGDB-&gt;Embedded Project Wizard:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/prj.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-227\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/prj.png\" alt=\"prj\" width=\"800\" height=\"569\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/prj.png 800w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/prj-300x213.png 300w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/li>\n<li>Proceed with the default settings on the first page of the wizard:<br \/>\n<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/def.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-228 aligncenter\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/def.png\" alt=\"def\" width=\"702\" height=\"571\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/def.png 702w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/def-300x244.png 300w\" sizes=\"(max-width: 702px) 100vw, 702px\" \/><\/a><\/li>\n<li>VisualGDB should automatically detect the toolchain location and show it in the toolchain list as &#8220;GNUARM&#8221;. Select it and then choose your device:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/device.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-229 aligncenter\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/device.png\" alt=\"device\" width=\"702\" height=\"623\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/device.png 702w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/device-300x266.png 300w\" sizes=\"(max-width: 702px) 100vw, 702px\" \/><\/a>If the toolchain location is not detected, check the <strong>HKLM\\SOFTWARE\\Wow6432Node\\ARM\\GNU Tools for ARM Embedded Processors\\InstallFolder<\/strong> value in the registry. The GNU ARM toolchain installer should set it to the toolchain location.<\/li>\n<li>Select the sample you want to use for your project. The simplest one is LEDBlink:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/sample.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-230\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/sample.png\" alt=\"sample\" width=\"702\" height=\"648\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/sample.png 702w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/sample-300x277.png 300w\" sizes=\"(max-width: 702px) 100vw, 702px\" \/><\/a><\/li>\n<li>Select the debug method you want to use. You can read <a href=\"http:\/\/visualgdb.com\/documentation\/debugmethods\">here <\/a>about various debug methods supported by VisualGDB.<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-232\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/debug.png\" alt=\"debug\" width=\"702\" height=\"648\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/debug.png 702w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/debug-300x277.png 300w\" sizes=\"(max-width: 702px) 100vw, 702px\" \/><\/a><\/li>\n<li>Press &#8220;Finish&#8221; to create the project. Build it by pressing Ctrl-Shift-B:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/build.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-233\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/build.png\" alt=\"build\" width=\"699\" height=\"585\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/build.png 699w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/build-300x251.png 300w\" sizes=\"(max-width: 699px) 100vw, 699px\" \/><\/a><\/li>\n<li>You can start debugging the project like any other Visual Studio project by pressing F5:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/debug1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-234\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/debug1.png\" alt=\"debug\" width=\"699\" height=\"586\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/debug1.png 699w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/debug1-300x252.png 300w\" sizes=\"(max-width: 699px) 100vw, 699px\" \/><\/a><\/li>\n<li>You can change various toolchain settings by right-clicking on the project in Solution Explorer, selecting &#8220;VisualGDB Project Properties&#8221; and changing the settings on the first page. E.g. you can switch the C library from newlib to newlib-nano and disable syscall support to reduce the size of your image:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-235\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/settings.png\" alt=\"settings\" width=\"708\" height=\"743\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/settings.png 708w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/settings-286x300.png 286w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><\/a><\/li>\n<li>If you build your project now, you will see that its size has decreased substantially after we switched to the lightweight newlib-nano library:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/smaller.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-236\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/smaller.png\" alt=\"smaller\" width=\"699\" height=\"587\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/smaller.png 699w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/07\/smaller-300x252.png 300w\" sizes=\"(max-width: 699px) 100vw, 699px\" \/><\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to use VisualGDB to build and debug embedded firmware for ARM devices using the GCC ARM<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[53,93,61],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/223"}],"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=223"}],"version-history":[{"count":2,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/223\/revisions"}],"predecessor-version":[{"id":238,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/223\/revisions\/238"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}