23/12/12 Tutorial: Enlightning the Freedom KL25Z Board | MCU on Eclipse 1/17 mcuoneclipse.com/2012/09/07/tutorial-enlighting-the-freedom-kl25z-board/ Tutorial: Enlightning the Freedom KL25Z Board Posted on September 7, 2012 8 Votes The schematics for the Freedom board is now available on the element14 Freedom Board site (you need to log into the element14 community first) as FRDM-KL25Z Schematics (SPF-27556_D).pdf (314.7 K)). So time to write a tutorial how to use the LED on that board. In “FreeRTOS with GCC, Cortex-M0+ and Kinetis KL25Z Freedom Board” and “A Shell for the KL25Z Freedom Board” I have used that board with an RTOS: FreeRTOS. But it is really easy to use that board without an RTOS (‘bare metal’) too. In this tutorial I’m providing step by step instructions to use the RGB LED on the Freedom KL25Z board with Processor Expert and the open source LED component. I’m using CodeWarrior which has the ARM gcc build tools integrated for the Kinetis family. This tutorial features the Freedom KL25Z board with the version 10.3 of CodeWarrior, but is applicable with minor changes for any other Kinetis board and as well for CodeWarrior for MCU10.2. Note: This post shows screenshots of the upcoming CodeWarrior for MCU 10.3 which is not publicly available yet, but will be soon. Additional Processor Expert Component Installation In this tutorial I’m using additional open source Processor Expert components which are not part of the CodeWarrior Eclipse standard distribution: LED: Universal LED driver Wait: Universal waiting functions Both *.PEupd files can be downloaded from the above links. To import them into CodeWarrior, I use the menu Processor Expert > Import Package: Then I browse to the *.PEupd files and select them to import. Hint: it is possible to import multiple components in a single step with selecting multiple files to import. After importing the components, it might be necessary to refresh the components list. To make sure all Processor Expert Views are loaded, I use the menu Processor Expert > Show Views: After importing, the LED and Wait component should show up in the Alphabetical tab of the Component Library view: Importing Processor Expert Package — Show Processor Expert Views — • • • • • • • • • • • • • • • • • •
17
Embed
Tutorial_ Enlightning the Freedom KL25Z Board _ MCU on Eclipse
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
23/12/12 Tutorial: Enlightning the Freedom KL25Z Board | MCU on Eclipse
The schematics for the Freedom board is now available on the element14 Freedom Board site (you need to log into the element14 community first) as
FRDM-KL25Z Schematics (SPF-27556_D).pdf (314.7 K)). So time to write a tutorial how to use the LED on that board.
In “FreeRTOS with GCC, Cortex-M0+ and Kinetis KL25Z Freedom Board” and “A Shell for the KL25Z Freedom Board” I have used that board with an RTOS:
FreeRTOS. But it is really easy to use that board without an RTOS (‘bare metal’) too. In this tutorial I’m providing step by step instructions to use the RGB
LED on the Freedom KL25Z board with Processor Expert and the open source LED component.
I’m using CodeWarrior which has the ARM gcc build tools integrated for the Kinetis family. This tutorial features the Freedom KL25Z board with the version
10.3 of CodeWarrior, but is applicable with minor changes for any other Kinetis board and as well for CodeWarrior for MCU10.2.
Note: This post shows screenshots of the upcoming CodeWarrior for MCU 10.3 which is not publicly available yet, but will be soon.
Note: Now in MCU10.3 the project view and the Processor Expert Components view are clearly separate.
LED
To add the LED component, I select it and use the ‘Add to project’ context menu:
Hint: instead of using the context menu, I can double click on the component to add it.
I do this 3 times, one for red, blue and green color. As I have missing settings, they show up with an error marker in the Components view:
I’m changing the settings in the Component Inspector for the three LED’s:
1. Changing the Component name: this is an arbitrary name, and is used for the generated driver source files (.c and .h file). I name it LEDR, LEDG and
LEDB for the three colors
2. I specify a Field Name: this is an arbitrary name, and same name I used in the LDD (Logical Device Driver name)
3. As according to the schematics the cathode of the LED is connected to the microcontroller pin, I specify ‘no’ for this property
According to the FRDM-KL25Z Schematics (SPF-27556_D).pdf, the RGB LED is connected to following pins:
Red: PTB18
Green: PTB19
Blue: PTD1
The LED’s need to be linked to the a GPIO_LDD component. For this I click into GPIO LDD property and use the drop down box to add a new component
for it:
This will create a new shared component:
As two of the LED’s are on the Port B (PTB18 and PTB19), I configure it as such. I specify the port (PTB) and press on the plus sign to add bit fields:
Hint: An easy way to add code and function calls to components is to use drag & drop.
Build
I build the project with the menu Project > Build Project or using the ‘hammer’ icon:
At this point there should be no problems, so the Problems view should just show empty:
Debug
To download and debug, I press the debug toolbar icon. An annoying thing in Eclipse is I first need to *select* the project first to select the right debug
configuration:
So I select the project, then hover over the icon to make sure my project is selected. Otherwise I use the small drop down of the debug toolbar icon to
30 THOUGHTS ON “TUTORIAL: ENLIGHTNING THE FREEDOM KL25Z BOARD”
Pingback: S-Record Generation with gcc for ARM/Kinetis | MCU on Eclipse
Pingback: OpenSDA on the Freedom KL25Z Board | MCU on Eclipse
Pingback: Tutorial: Accelerating the KL25Z Freedom Board | MCU on Eclipse
Pingback: Tutorial: Freedom with FreeRTOS and Kinetis-L | MCU on Eclipse
Pingback: Tutorial: Touching the Freedom KL25Z Board | MCU on Eclipse
Pingback: Tutorial: USB CDC with the KL25Z Freedom Board | MCU on Eclipse
Share this:
Like this: Be the first to like this.
This will start the debugger, and I can use the toolbar items in the Debug view to step through my code:
Source Code
The project I have created in above steps can be downloaded from this link.
Summary
The steps presented here are really generic, and work for many boards and microcontrollers, especially for the Kinetis family. All what I need to know is the
information to which pin the LED’s are connected. With this it is very easy to create a bare board (without RTOS) application blinking LED’s.
Happy enlightning
This entry was posted in Boards, Embedded Components, Kinetis, KL25Z Freedom Board, Processor Expert, Tips & Tricks and tagged Building,
Debugging, Embedded Component, KL25Z Freedom Board, Processor Expert, Tips&Tricks by Erich Styger. Bookmark the permalink
Pingback: Copy my CodeWarrior Project | MCU on Eclipse
Pingback: Tutorial: Bits and Pins with Kinetis and the FRDM-KL25Z Board | MCU on Eclipse
Pingback: Arduino Data-Logger Shield with the FRDM-KL25Z Board | MCU on Eclipse
Royce
on December 2, 2012 at 17:14 said:
Hello,
I’m trying out my FRDM-KL25Z, and selected this tutorial as my 1st project.
However, you have stopped short of explaining the debugging procedure.
There are several settings upon clicking the debug button,…when does one select a particular setting ? What are the right settings for this project?
Some issues:
1. In your photo, hovering over the debug button shows the tip: ‘Debug Freedom_LED_FLASH_OpenSDA. When I do the same (with the project
selected) I just get ‘Debug’ as the tool-tip.
2. When I try to debug anyway, I get an error message with a ‘No device available’ message.
However my board is connected, and I could drag other binaries to the board and run them.
3. After I do a build /build all, should I get some executable like bin/srec/s19 etc (not sure which one is the default)? But I can’t see any. When and
where are the produced ?
Sorry if my questions are ‘noobish’ but I have only used 8 bit MCUs & All this is new to me.
Thank You.
Royce
on December 2, 2012 at 18:04 said:
Well, I got point (2) sorted out from this thread: