{"id":1192,"date":"2015-11-18T17:24:46","date_gmt":"2015-11-19T01:24:46","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=1192"},"modified":"2016-05-29T15:04:50","modified_gmt":"2016-05-29T22:04:50","slug":"developing-code-with-kinetis-ksdk-for-the-frdm-k64f-board","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/arm\/kinetis\/frdm-k64f\/","title":{"rendered":"Developing code with Kinetis KSDK for the FRDM-K64F board"},"content":{"rendered":"<p>This tutorial shows how to build and debug a basic program for the Freescale FRDM-K64F board using Visual Studio. Before you begin, install VisualGDB 5.0 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\/2015\/11\/01-prjname.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1193\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/01-prjname.png\" alt=\"01-prjname\" width=\"786\" height=\"502\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/01-prjname.png 786w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/01-prjname-300x192.png 300w\" sizes=\"(max-width: 786px) 100vw, 786px\" \/><\/a><\/li>\n<li>Proceed with the default &#8220;Create a new project -&gt; Embedded binary&#8221; selection:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/02-bin1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1194\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/02-bin1.png\" alt=\"02-bin\" width=\"688\" height=\"565\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/02-bin1.png 688w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/02-bin1-300x246.png 300w\" sizes=\"(max-width: 688px) 100vw, 688px\" \/><\/a><\/li>\n<li>Select the <strong>MK64FN1M0VLL12<\/strong> device from the list. If it does not appear in the list, click &#8220;download support for more devices&#8221; and select the Freescale Kinetis (KSDK) BSP:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/03-device1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1195\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/03-device1.png\" alt=\"03-device\" width=\"688\" height=\"565\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/03-device1.png 688w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/03-device1-300x246.png 300w\" sizes=\"(max-width: 688px) 100vw, 688px\" \/><\/a><\/li>\n<li>On the next page of the wizard select a project template you want to use. In this tutorial we will create a minimal project without any RTOS. Specify PTE and pin 26 to blink the green LED on the board:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/04-sample1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1196\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/04-sample1.png\" alt=\"04-sample\" width=\"688\" height=\"565\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/04-sample1.png 688w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/04-sample1-300x246.png 300w\" sizes=\"(max-width: 688px) 100vw, 688px\" \/><\/a><\/li>\n<li>The FRDM-K64F board includes a CMSIS-DAP programmer that can be turned into a Segger J-Link by downloading <a href=\"https:\/\/www.segger.com\/opensda.html\">special firmware<\/a> from the Segger website. If you have not downloaded the segger firmware into your FRDM-K64F yet, download it from the Segger website, unpack it, then hold the SW1 button on your board and replug the USB cable<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/k64f-sw1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1951\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/k64f-sw1.jpg\" alt=\"k64f-sw1\" width=\"700\" height=\"398\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/k64f-sw1.jpg 700w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/k64f-sw1-300x171.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a> The board will get connected as a USB storage device and simply copying the Segger firmware file into it will automatically install it on the board.<\/li>\n<li>Select Segger J-Link as the debug method and specify the path to the Segger software package. If you don&#8217;t have it installed, you can download it <a href=\"https:\/\/www.segger.com\/jlink-software.html\">here<\/a>:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/05-jlink.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1197\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/05-jlink.png\" alt=\"05-jlink\" width=\"688\" height=\"565\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/05-jlink.png 688w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/05-jlink-300x246.png 300w\" sizes=\"(max-width: 688px) 100vw, 688px\" \/><\/a><\/li>\n<li>Press Finish to generate the project. You can then build it by pressing Ctrl-Shift-B:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/06-build1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1198\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/06-build1.png\" alt=\"06-build\" width=\"799\" height=\"592\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/06-build1.png 799w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/06-build1-300x222.png 300w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><\/a><\/li>\n<li>Press F5 to program your firmware and start debugging it. The large green LED in the corner of the board will start blinking:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/k64f.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1201\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/k64f.jpg\" alt=\"k64f\" width=\"700\" height=\"398\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/k64f.jpg 700w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/k64f-300x171.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><\/li>\n<li>Set a breakpoint inside the main() function. The breakpoint will trigger and you will be able to trigger and you will be able to step through the code:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/07-breakpoint.png\"> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1199\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/07-breakpoint.png\" alt=\"07-breakpoint\" width=\"799\" height=\"591\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/07-breakpoint.png 799w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/07-breakpoint-300x222.png 300w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><\/a><\/li>\n<li>Press Shift-F5 to stop debugging. You can open VisualGDB Project Properties and go to the Embedded Frameworks page to reference various components of the KSDK in your application (e.g. FreeRTOS or uCOS):<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/08-frameworks.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1200\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/08-frameworks.png\" alt=\"08-frameworks\" width=\"717\" height=\"621\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/08-frameworks.png 717w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2015\/11\/08-frameworks-300x260.png 300w\" sizes=\"(max-width: 717px) 100vw, 717px\" \/><\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to build and debug a basic program for the Freescale FRDM-K64F board using Visual Studio. Before<\/p>\n","protected":false},"author":1,"featured_media":1204,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[89],"tags":[53,57,64],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/1192"}],"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=1192"}],"version-history":[{"count":5,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/1192\/revisions"}],"predecessor-version":[{"id":1952,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/1192\/revisions\/1952"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media\/1204"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=1192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=1192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=1192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}