{"id":2091,"date":"2016-11-06T20:01:58","date_gmt":"2016-11-07T04:01:58","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=2091"},"modified":"2016-11-06T20:01:58","modified_gmt":"2016-11-07T04:01:58","slug":"developing-projects-for-the-mbed-lpc812-board-with-visual-studio","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/arm\/mbed\/lpc812\/","title":{"rendered":"Developing projects for the Mbed LPC812 board with Visual Studio"},"content":{"rendered":"<p>This tutorial shows how to setup the LPC812 mved\/Xpresso board to develop projects with Visual Studio and VisualGDB.<\/p>\n<p>Before you begin, install VisualGDB 5.1 or later.<\/p>\n<ol>\n<li>Start Visual Studio and open the VisualGDB Embedded Project Wizard:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/01-prjname1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2092\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/01-prjname1.png\" alt=\"01-prjname\" width=\"813\" height=\"548\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/01-prjname1.png 813w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/01-prjname1-300x202.png 300w\" sizes=\"(max-width: 813px) 100vw, 813px\" \/><\/a><\/li>\n<li>Proceed with the default &#8220;Embedded binary&#8221; project type:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/02-prjtype1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2093\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/02-prjtype1.png\" alt=\"02-prjtype\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/02-prjtype1.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/02-prjtype1-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>On the next page click &#8220;Use ARM mbed&#8221; and select the LPC812 board from the list:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/03-mbed.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2094\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/03-mbed.png\" alt=\"03-mbed\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/03-mbed.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/03-mbed-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>On the Sample Selection page pick the LEDBlink sample and click &#8220;Next&#8221; to proceed:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/04-blink.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2095\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/04-blink.png\" alt=\"04-blink\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/04-blink.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/04-blink-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>Plug in your board. If you are using the latest OpenOCD package, it should detect it automatically. Click &#8220;Test OpenOCD&#8221; to verify that the debugging works. If the mbed driver is not installed on your computer, you will get an error shown below:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/05-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2098\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/05-debug.png\" alt=\"05-debug\" width=\"822\" height=\"643\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/05-debug.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/05-debug-300x235.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>If this happens, download and install the <a href=\"https:\/\/developer.mbed.org\/handbook\/Windows-serial-configuration\">mbed serial port driver<\/a>:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/06-driver.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2097\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/06-driver.png\" alt=\"06-driver\" width=\"332\" height=\"120\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/06-driver.png 332w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/06-driver-300x108.png 300w\" sizes=\"(max-width: 332px) 100vw, 332px\" \/><\/a><\/li>\n<li>Now the test should pass successfully. OpenOCD may report the &#8220;clearing lockup after double fault&#8221; error, but it should not affect debugging:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/07-success1.png\"> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2096\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/07-success1.png\" alt=\"07-success\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/07-success1.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/07-success1-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:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/08-build1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2099\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/08-build1.png\" alt=\"08-build\" width=\"954\" height=\"616\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/08-build1.png 954w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/08-build1-300x194.png 300w\" sizes=\"(max-width: 954px) 100vw, 954px\" \/><\/a><\/li>\n<li>Press F5 to start debugging. Note how the big blue LED starts blinking:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/board2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2100\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/board2.jpg\" alt=\"board\" width=\"800\" height=\"422\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/board2.jpg 800w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/board2-300x158.jpg 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/board2-390x205.jpg 390w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/li>\n<li>Set a breakpoint somewhere in the loop inside main(). Once it triggers, you will be able to debug your program as usual:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/09-breakpoint.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2101\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/09-breakpoint.png\" alt=\"09-breakpoint\" width=\"954\" height=\"657\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/09-breakpoint.png 954w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/09-breakpoint-300x207.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/09-breakpoint-130x90.png 130w\" sizes=\"(max-width: 954px) 100vw, 954px\" \/><\/a><\/li>\n<li>You can easily reference various mbed libraries via the Embedded Frameworks page of VisualGDB Project Properties:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/10-frameworks.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2102\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/10-frameworks.png\" alt=\"10-frameworks\" width=\"825\" height=\"587\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/10-frameworks.png 825w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/10-frameworks-300x213.png 300w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/a><\/li>\n<li>The project automatically includes the relevant source code from mbed, so you can use go-to-definition and Code Map to explore it. E.g. you can quickly check how the <strong>wait_ms()<\/strong> function works by finding the data it accesses and showing other functions that access the same data:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/11-codemap.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2103\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/11-codemap.png\" alt=\"11-codemap\" width=\"954\" height=\"657\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/11-codemap.png 954w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/11-codemap-300x207.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/10\/11-codemap-130x90.png 130w\" sizes=\"(max-width: 954px) 100vw, 954px\" \/><\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to setup the LPC812 mved\/Xpresso board to develop projects with Visual Studio and VisualGDB. Before you<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[89],"tags":[53,133,115],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/2091"}],"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=2091"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/2091\/revisions"}],"predecessor-version":[{"id":2104,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/2091\/revisions\/2104"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=2091"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=2091"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=2091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}