DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Getting Blinky With the Kinetis SDK and Processor Expert

Now something for the DIYers out there, learn how to make your own blinking LED app with the help of the Kinetis SDK (v. 1.3) and Processor Expert.

Erich Styger user avatar by
Erich Styger
·
Oct. 17, 16 · Tutorial
Like (3)
Save
Tweet
Share
2.52K Views

Join the DZone community and get the full member experience.

Join For Free

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:

  • Eclipse-based Kinetis Design Studio V3.2.0: http://www.nxp.com/kds. Or use your preferred IDE with Processor Expert.
  • Kinetis SDK V1.3 for your target board: Get it from http://kex.nxp.com/.
  • Make sure you install the SDK update into Eclipse (menu Help > Install New Software and then point to the .zip file in <SDK installation path>\tools\eclipse_update).
  • McuOnEclipse Processor Expert components from SourceForge, and see “McuOnEclipse Releases on SourceForge” to learn how to install it.

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.

Createa  New Project

Create new project with File > New > Processor Expert Project (Kinetis SDK 1.x works the same, in case you're wondering):

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

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

Adding fsl_gpio

Add the LED component:

added-led-component

Adding the LED

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

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

Then, add some blinky code like this:

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

Blinky code

And then build/compile the project:

building

Press debug:

start-debugging

And finally, debug it on your board:

debugging

Stepping through the code now should make the LED blink:

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 make the blinky for that board took me less than three minutes from project creation to debugging the blinking LED code on the target.

The project is available on GitHub.

Happy blinking!

Software development kit

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 2023 Software Testing Trends: A Look Ahead at the Industry's Future
  • How to Develop a Portrait Retouching Function
  • Visual Network Mapping Your K8s Clusters To Assess Performance
  • An Introduction to Data Mesh

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: