Developing code with Kinetis KSDK for the FRDM-K64F board

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.

  1. Start Visual Studio and open the VisualGDB Embedded Project wizard:01-prjname
  2. Proceed with the default “Create a new project -> Embedded binary” selection:02-bin
  3. Select the MK64FN1M0VLL12 device from the list. If it does not appear in the list, click “download support for more devices” and select the Freescale Kinetis (KSDK) BSP:03-device
  4. 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:04-sample
  5. The FRDM-K64F board includes a CMSIS-DAP programmer that can be turned into a Segger J-Link by downloading special firmware 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 cablek64f-sw1 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.
  6. Select Segger J-Link as the debug method and specify the path to the Segger software package. If you don’t have it installed, you can download it here:05-jlink
  7. Press Finish to generate the project. You can then build it by pressing Ctrl-Shift-B:06-build
  8. Press F5 to program your firmware and start debugging it. The large green LED in the corner of the board will start blinking:k64f
  9. 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: 07-breakpoint
  10. 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):08-frameworks