{"id":4519,"date":"2019-01-03T17:04:43","date_gmt":"2019-01-04T01:04:43","guid":{"rendered":"https:\/\/visualgdb.com\/w\/?p=4519"},"modified":"2019-01-03T17:04:43","modified_gmt":"2019-01-04T01:04:43","slug":"developing-projects-for-the-i-mx-rt-devices-with-visual-studio","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/arm\/imxrt\/","title":{"rendered":"Developing Projects for the i.MX RT Devices with Visual Studio"},"content":{"rendered":"<p>This tutorial shows how to create a basic project targeting the i.MX RT device using Visual Studio and VisualGDB. Before you begin, install VisualGDB 5.4 Beta 2 or later. We will create a basic &#8220;Blinking LED&#8221; project for the IMXRT1050-EVB board and will show how to debug it using Segger J-Link and the on-board CMSIS-DAP-compatible interface.<\/p>\n<ol>\n<li>The i.MX RT devices do not come with a regular stand-alone SDK. Instead, you need to generate an SDK for your board online. Open the <a href=\"https:\/\/mcuxpresso.nxp.com\/en\/select\">MCUXpresso online SDK builder<\/a>, select your board and click &#8220;Build MCUXpresso SDK&#8221;:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/01-sdk.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4520\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/01-sdk.png\" alt=\"\" width=\"1429\" height=\"876\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/01-sdk.png 1429w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/01-sdk-300x184.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/01-sdk-768x471.png 768w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/01-sdk-1024x628.png 1024w\" sizes=\"(max-width: 1429px) 100vw, 1429px\" \/><\/a><\/li>\n<li>Confirm your OS\/toolchain settings (GCC ARM Embedded) and click &#8220;Download SDK&#8221;:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/02-getsdk.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4521\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/02-getsdk.png\" alt=\"\" width=\"1429\" height=\"877\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/02-getsdk.png 1429w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/02-getsdk-300x184.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/02-getsdk-768x471.png 768w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/02-getsdk-1024x628.png 1024w\" sizes=\"(max-width: 1429px) 100vw, 1429px\" \/><\/a><\/li>\n<li>Extract the downloaded SDK anywhere on your computer and open the VisualGDB Embedded Project Wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/03-newprj.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4522\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/03-newprj.png\" alt=\"\" width=\"941\" height=\"653\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/03-newprj.png 941w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/03-newprj-300x208.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/03-newprj-768x533.png 768w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/03-newprj-392x272.png 392w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/03-newprj-130x90.png 130w\" sizes=\"(max-width: 941px) 100vw, 941px\" \/><\/a><\/li>\n<li>On the first page of the wizard select &#8220;Create a new project with MSBuild&#8221;:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/04-binary.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4523\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/04-binary.png\" alt=\"\" width=\"886\" height=\"693\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/04-binary.png 886w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/04-binary-300x235.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/04-binary-768x601.png 768w\" sizes=\"(max-width: 886px) 100vw, 886px\" \/><\/a><\/li>\n<li>On the second page of the wizard click &#8220;Import an MCUXpresso SDK&#8221;:<br \/>\n<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/05-import.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4524\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/05-import.png\" alt=\"\" width=\"886\" height=\"693\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/05-import.png 886w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/05-import-300x235.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/05-import-768x601.png 768w\" sizes=\"(max-width: 886px) 100vw, 886px\" \/><\/a><\/li>\n<li>Point VisualGDB to the folder where you have extracted the generated SDK:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/06-sdkpath.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4525\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/06-sdkpath.png\" alt=\"\" width=\"835\" height=\"536\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/06-sdkpath.png 835w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/06-sdkpath-300x193.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/06-sdkpath-768x493.png 768w\" sizes=\"(max-width: 835px) 100vw, 835px\" \/><\/a><\/li>\n<li>VisualGDB will import the SDK and display the i.MX RT devices in the device list. Select your device and click &#8220;Next&#8221;:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/07-device.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4526\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/07-device.png\" alt=\"\" width=\"886\" height=\"693\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/07-device.png 886w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/07-device-300x235.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/07-device-768x601.png 768w\" sizes=\"(max-width: 886px) 100vw, 886px\" \/><\/a><\/li>\n<li>As the SDK was imported automatically, it won&#8217;t contain any VisualGDB-supplied example projects. Click &#8220;KSDK Samples&#8221; to view the vendor-supplied samples instead. In this tutorial we will use use the &#8220;igpio_led_output&#8221; example:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/08-examples.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4527\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/08-examples.png\" alt=\"\" width=\"886\" height=\"693\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/08-examples.png 886w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/08-examples-300x235.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/08-examples-768x601.png 768w\" sizes=\"(max-width: 886px) 100vw, 886px\" \/><\/a><\/li>\n<li>The last page of the wizard allows configuring the debug interface. The easiest way to debug the i.MX RT devices would be using an external Segger J-Link device. It comes with out-of-the-box support for on-board FLASH memory programming and is much faster than the on-board CMSIS-DAP interface. Connect J-Link to the 20-pin JTAG connector and plug both J-Link and the board into the USB ports:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/jtag-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4535\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/jtag-1.jpg\" alt=\"\" width=\"1200\" height=\"980\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/jtag-1.jpg 1200w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/jtag-1-300x245.jpg 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/jtag-1-768x627.jpg 768w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/jtag-1-1024x836.jpg 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/li>\n<li>Select &#8220;Segger J-Link&#8221; on the Debug Method page and click &#8220;Finish&#8221; to generate the project:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/09-jlink.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4528\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/09-jlink.png\" alt=\"\" width=\"886\" height=\"693\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/09-jlink.png 886w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/09-jlink-300x235.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/09-jlink-768x601.png 768w\" sizes=\"(max-width: 886px) 100vw, 886px\" \/><\/a><\/li>\n<li>Now you can build the project by pressing Ctrl-Shift-B:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/10-build.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4529\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/10-build.png\" alt=\"\" width=\"1097\" height=\"786\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/10-build.png 1097w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/10-build-300x215.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/10-build-768x550.png 768w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/10-build-1024x734.png 1024w\" sizes=\"(max-width: 1097px) 100vw, 1097px\" \/><\/a><\/li>\n<li>Press F5 to begin debugging. Verify that the on-board LED is blinking:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/led.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4536\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/led.jpg\" alt=\"\" width=\"800\" height=\"528\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/led.jpg 800w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/led-300x198.jpg 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/led-768x507.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/li>\n<li>Set a breakpoint near the <strong>GPIO_PortToggle()<\/strong> call and wait for it to trigger:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/11-bkpt.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4530\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/11-bkpt.png\" alt=\"\" width=\"1097\" height=\"786\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/11-bkpt.png 1097w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/11-bkpt-300x215.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/11-bkpt-768x550.png 768w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/11-bkpt-1024x734.png 1024w\" sizes=\"(max-width: 1097px) 100vw, 1097px\" \/><\/a><\/li>\n<li>You can use the regular debugging techniques to debug your program. As the imported project includes all the necessary code from the SDK, you can use the CodeJumps popups to explore relations between different parts of the program itself and the i.MX RT SDK:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/jumps.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4537\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/jumps.png\" alt=\"\" width=\"1097\" height=\"786\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/jumps.png 1097w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/jumps-300x215.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/jumps-768x550.png 768w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/jumps-1024x734.png 1024w\" sizes=\"(max-width: 1097px) 100vw, 1097px\" \/><\/a><\/li>\n<li>Now we will show how to use the on-board CMSIS-DAP interface instead of Segger J-Link. Note that CMSIS-DAP is relatively slow and as of January 2019, the OpenOCD tool used to debug the board with it cannot program the on-board FLASH memory unless you create a <a href=\"https:\/\/visualgdb.com\/tutorials\/arm\/stm32\/flash\/\">FLASH programming plugin<\/a>. In this tutorial we will switch the program to run entirely from SRAM in order to demonstrate CMSIS-DAP-based debugging. Open the MSBuild Settings page of VisualGDB Project Properties and locate the linker script:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/12-script-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4531\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/12-script-1.png\" alt=\"\" width=\"1007\" height=\"608\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/12-script-1.png 1007w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/12-script-1-300x181.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/12-script-1-768x464.png 768w\" sizes=\"(max-width: 1007px) 100vw, 1007px\" \/><\/a><\/li>\n<li>Change the linker script to the &#8220;xxxx_ram.ld&#8221; version:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/13-ram.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4532\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/13-ram.png\" alt=\"\" width=\"1007\" height=\"608\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/13-ram.png 1007w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/13-ram-300x181.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/13-ram-768x464.png 768w\" sizes=\"(max-width: 1007px) 100vw, 1007px\" \/><\/a><\/li>\n<li>Download this <a href=\"https:\/\/raw.githubusercontent.com\/sysprogs\/tutorials\/master\/visualgdb\/ARM\/boards\/imxrt\/IMXRTDemo\/imxrt1050.cfg\">OpenOCD configuration script<\/a> to your project directory. Then Go to the &#8220;Debug Settings&#8221; page, select &#8220;Debug Methods&#8221; instead of &#8220;USB Devices&#8221;, pick OpenOCD, choose CMSIS-DAP as the JTAG\/SWD programmer and edit the OpenOCD command line to use the configuration file from the project directory:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/14-scripts-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4538\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/14-scripts-1.png\" alt=\"\" width=\"1007\" height=\"608\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/14-scripts-1.png 1007w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/14-scripts-1-300x181.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/01\/14-scripts-1-768x464.png 768w\" sizes=\"(max-width: 1007px) 100vw, 1007px\" \/><\/a>Now you will be able to debug your program using the on-board CMSIS-DAP interface. If you would like to program the on-board FLASH memory using OpenOCD instead of the J-Link software, you can create a FLASH programming plugin similar to the one described in <a href=\"https:\/\/visualgdb.com\/tutorials\/arm\/stm32\/flash\/\">this tutorial<\/a>.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to create a basic project targeting the i.MX RT device using Visual Studio and VisualGDB. Before<\/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,178],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/4519"}],"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=4519"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/4519\/revisions"}],"predecessor-version":[{"id":4539,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/4519\/revisions\/4539"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=4519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=4519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=4519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}