{"id":2596,"date":"2017-05-05T18:32:26","date_gmt":"2017-05-06T01:32:26","guid":{"rendered":"https:\/\/visualgdb.com\/w\/?p=2596"},"modified":"2017-05-05T18:32:26","modified_gmt":"2017-05-06T01:32:26","slug":"developing-mbed-based-projects-for-lpc1549-lpcxpresso","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/arm\/mbed\/lpc1549\/","title":{"rendered":"Developing mbed-based projects for LPC1549 LPCXpresso"},"content":{"rendered":"<p>This tutorial shows how to create a basic project using the <a href=\"https:\/\/www.mbed.com\/en\/\">mbed <\/a>framework for the LPCXpresso for LPC1549 board using Visual Studio and VisualGDB.<\/p>\n<p>The LPC1549 LPCXpresso board comes with an on-board LPC-Link debugger that can be used to debug the on-board firmware.<\/p>\n<p>In order to debug the board from VisualGDB, we will download and install a special firmware from Segger that makes it compatible with Segger J-Link software and VisualGDB.<\/p>\n<ol>\n<li>Before you begin, download and install <a href=\"http:\/\/www.nxp.com\/products\/microcontrollers-and-processors\/arm-processors\/lpc-cortex-m-mcus\/software-tools\/lpc-microcontroller-utilities\/lpcscrypt-v1.8.0:LPCSCRYPT\">LPCScrypt software<\/a> from the NXP site.<\/li>\n<li>Connect your LPCXpresso board to the USB port as shown below:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/board.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2597\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/board.jpg\" alt=\"board\" width=\"700\" height=\"386\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/board.jpg 700w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/board-300x165.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><\/li>\n<li>Open Device Manager and ensure the LPC device has the drivers installed. If not, install the drivers from the LPCScrypt\\Drivers folder.<\/li>\n<li>Run the LPCScrypt\\scripts\\program_JLINK.cmd script file and ensure it programs the J-Link firmware successfully:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/script.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2598\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/script.png\" alt=\"script\" width=\"700\" height=\"415\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/script.png 700w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/script-300x178.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a>If LPCScrypt does not detect your board, disconnect it from the USB, close the &#8220;DFU Link&#8221; jumper between the 2 USB ports and connect the USB again.<\/li>\n<li>Unplug and replug the board to USB. Double-check that it now appears as &#8220;Segger J-Link&#8221; in the Device Manager:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/jlink.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2599\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/jlink.png\" alt=\"jlink\" width=\"781\" height=\"572\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/jlink.png 781w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/jlink-300x220.png 300w\" sizes=\"(max-width: 781px) 100vw, 781px\" \/><\/a><\/li>\n<li>Start Visual Studio and open VisualGDB Embedded Project Wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/01-prjname.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2600\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/01-prjname.png\" alt=\"01-prjname\" width=\"941\" height=\"653\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/01-prjname.png 941w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/01-prjname-300x208.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/01-prjname-392x272.png 392w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/01-prjname-130x90.png 130w\" sizes=\"(max-width: 941px) 100vw, 941px\" \/><\/a><\/li>\n<li>Proceed with the default &#8220;Embedded Binary -&gt; MSBuild&#8221; settings:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/02-msb.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2601\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/02-msb.png\" alt=\"02-msb\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/02-msb.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/02-msb-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>Select &#8220;Use ARM mbed&#8221; and pick LPC1549 from the list. Ensure you check the &#8220;Provide default stubs for system calls&#8221; checkbox:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/03-device1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2602\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/03-device1.png\" alt=\"03-device\" width=\"822\" height=\"671\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/03-device1.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/03-device1-300x245.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>Proceed with the default LEDBlink sample on the Sample Selection page: <a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/04-sample1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2603\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/04-sample1.png\" alt=\"04-sample\" width=\"822\" height=\"671\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/04-sample1.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/04-sample1-300x245.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>On the last page of the wizard select &#8220;Segger J-Link&#8221; and proceed with the default settings:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/05-debug1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2604\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/05-debug1.png\" alt=\"05-debug\" width=\"822\" height=\"671\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/05-debug1.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/05-debug1-300x245.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>Press &#8220;Finish&#8221; to create your project. Build it with Ctrl-Shift-B:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/06-build.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2605\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/06-build.png\" alt=\"06-build\" width=\"1041\" height=\"643\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/06-build.png 1041w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/06-build-300x185.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/06-build-1024x632.png 1024w\" sizes=\"(max-width: 1041px) 100vw, 1041px\" \/><\/a><\/li>\n<li>Press F5 to start debugging your project. Once you see that the on-board LED is blinking, set a breakpoint somewhere in the main loop and ensure that you can step through the code: <a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/07-breakpoint.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2606\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/07-breakpoint.png\" alt=\"07-breakpoint\" width=\"1041\" height=\"643\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/07-breakpoint.png 1041w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/07-breakpoint-300x185.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/07-breakpoint-1024x632.png 1024w\" sizes=\"(max-width: 1041px) 100vw, 1041px\" \/><\/a><\/li>\n<li>You can use the Embedded Frameworks page of VisualGDB Project Properties to reference and configure various components of the mbed framework (e.g. RTOS or USB support):<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/08-frameworks.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2607\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/08-frameworks.png\" alt=\"08-frameworks\" width=\"1009\" height=\"735\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/08-frameworks.png 1009w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/05\/08-frameworks-300x219.png 300w\" sizes=\"(max-width: 1009px) 100vw, 1009px\" \/><\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to create a basic project using the mbed framework for the LPCXpresso for LPC1549 board using<\/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":[58,115],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/2596"}],"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=2596"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/2596\/revisions"}],"predecessor-version":[{"id":2608,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/2596\/revisions\/2608"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=2596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=2596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=2596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}