Tutorial: Blinky with Kinetis SDK V1.3 and Processor Expert

This tutorial goes through the steps how to create a blinking LED application, using Kinetis SDK and Processor Expert, using the TWR-KL43Z48M board from Freescale (now NXP):

twr-kl43z48m

twr-kl43z48m

Preconditions

I’m using the following in this tutorial:

I’m using the TWR-KL43Z48M board in this tutorial. You can use any other board, make sure you have the schematics and you should be ready to go :-).

Create New Project

Create new project with File > New > Processor Expert Project (Kinetis SDK 1.x works the same, btw):

create-new-project

create-new-project

Provide a project name, select your board/device, then point to the SDK folder and enable Processor Expert:

sdk-selection

sdk-selection

Components

This creates a standard project with some default components:

project-created

project-created

Adding Components

Consult the schematics and board configuration where you have the LEDs. On my TWR-KL43Z the green LED is on PTA12.

To work with GPIO pins, I add the fsl_gpio component for the SDK V1.3 to the project:

added-fsl_gpio

added-fsl_gpio

Add the LED component:

added-led-component

added-led-component

SDK

This adds a few referenced components. Right now it shows an error, because the LED component it needs to be configured to use the SDK. Specify the SDK to be used (1.3 in our case):

sdk-to-be-used

sdk-to-be-used

Tell the LED component to use the SDK variant (SDK_BitIO):

sdk_bitio

sdk_bitio

As I’m using the LED on PTA12, I configure it as such (GPIOx, pin number) and give it a symbol name (LED_GREEN in my case):

configured-pin

configured-pin

Building and Debugging

That’s it! Generate code:

generate-code

generate-code

Then add some blinky code like this:

  for(;;) {
    LED1_On();
    LED1_Off();
  }
blinky-code

blinky-code

And then build/compile the project:

building

building

Press debug:

start-debugging

start-debugging

Finally debug it on your board:

debugging

debugging

Stepping through the code now should blink the LED:

blinky, blinky!

blinky, blinky!

Summary

The fastest way to bring up a board like the TWR-KL43Z used in this tutorial is still with Processor Expert: to have the blinky for that board took me less than 3 minutes from the project creation to debugging the blinking LED code on the target.

The project is available on GitHub: https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/KDS/TWR-KL43Z48M/TWR-KL43Z_Blinky_SDK_V1.3

Happy Blinking 🙂

Links

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.