AnsweredAssumed Answered

Getting started with the TWR-K65f180M

Question asked by David Dugan on Jul 15, 2016
Latest reply on Jul 17, 2016 by David Dugan

While I waited for my TWR-K65f180M to arrive in the mail, I read A LOT of documentation online.  I was happy to see how much information was available out there, but at the same time it was a large amount of information to process.   KDS, SDK, KSDK, openSDA, K20, KSDK 1.2, KSDK 2.0, Eclipse Updates, JTAG, J-Link, Segger... These are all terms you are going to run into, and if you are new to Kinetis Microprocessors, they may send you into a bit of a tailspin.

 

I hope that what I am about to document helps at least one person get to the point where they can load and debug a program on a Kinetis, using Kinetis Design Studio (KDS) 3, and the onboard K20 debugger.  I did a bit of flailing around when installing KDS, which resulted in what I think was a lot of unnecessary work. I think I have boiled it down to the necessary steps, I am considering this post an open document, and will edit it whenever I or someone else finds a problem.

 

First thing you need to do is download Kinetis Design Studio:

https://nxp.flexnetoperations.com/control/frse/download?element=7490587

 

Then create and downlaod a software development kit (SDK) for your specific board:

Welcome to Kinetis Expert | Kinetis Expert

 

The SDK has all the example projects, sample code, and the drivers KDS needs to build projects for your board.  Pay attention to the details in the picture below.  If you plan on using KDS you need the have it selected in the "Supported Toolchains" drop down menu.

 

buildSDKforTWR65.JPG:

 

When you install KDS it creates a Freescale and NXP directory (in C: for my computer), I unzipped my the downloaded SDK to the "NXP" directory, but I assume you can put it anywhere you want.

 

Next open KDS, go to the help menu, and select "Check For Updates", install any updates that come up.

 

Plug the provided USB into the OpenSDA USB port. Some LEDs should light up and the default program should light up LED 6 and 7 when you move the board around.

 

The TWR-K65 has a debugger built into it, that debugger comes with firmware installed on it.  I don't know if I did something wrong at first, but I could figure out how to load and debug a project on the TWR-K65, so I started installing different firmware to my debugger, which was a mistake.  I was able to debug a project with KDS and the TWR-K65 by loading the attached "DEBUG-FRDM-K64F_Pemicro_v108a_for_OpenSDA_v2.0.bin" file to the board.

 

To do this:

     1 - Unplug the board from your computer.

     2 - Hold down the reset button.

     3 - Plug the board back in while holding the reset button, you can let go after the LEDs start blinking.

     4 - You will notice a "BOOTLOADER" USB device show up in windows explorer.

     5 - Drag the DEBUG-FRDM-K64F_Pemicro_v108a_for_OpenSDA_v2.0.bin file onto the bootloader.

     6 - After the file is copied to the bootoloader, unplug the board, and then plug it back in.

     7 - To be safe, restart KDS.

 

debuggerFirmware.JPG

 

 

To open a sample project for your board:

     1 - File -> Import

     2 - Project of Projects -> Existing Project Sets

     3 - Navigate to the SDK 2.0 folder that you downloaded

     4 - Select your board's directory and open the demo_apps directory.

     5 - Open the "Hello World" directory, then kds, and select the ".wsd" file.

 

Once the project has opened:

     1 - Run Menu -> Debug Configuration

     2 - Under the "GDB PEMicro Interface Debugging" option, select debug pne option.

     3 - Select the "Debugger" tab, and configure it like the photo below. debugOptions.JPG

 

     4 - Press "Close"

     5 - Press the hammer button to build the project, then the debug button and KDS will launch debug mode.

     6 - Now open a terminal emulator (I use Tera Term) and connect to the TWR-k65 com port using the settings below.            (COM11 is my board's COM port on my computer). comsettings.JPG

 

     7 - Once you have established a serial connection to the board, go back to KDS and press the debug play button.

 

debugPlay.JPG

 

When you go back to your terminal emulator program you should see hello world printed to the screen.

 

Happy tinkering!

Original Attachment has been moved to: DEBUG-FRDM-K64F_Pemicro_v108a_for_OpenSDA_v2.0.zip

Outcomes