element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Freedom development platform
  • Products
  • Dev Tools
  • Freedom development platform
  • More
  • Cancel
Freedom development platform
Blog Kinetis Design Studio 3.0 Kinetis SDK 1.2 Processor-Expert using FRDM-KL43Z: UART communication with a console on the host through OpenSDA
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Freedom development platform to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: bheemarao
  • Date Created: 11 Aug 2015 12:54 PM Date Created
  • Views 803 views
  • Likes 1 like
  • Comments 1 comment
  • kds3.0
  • kds+ksdk
  • ksdk1.2.0
  • debug_console
  • kl43z
Related
Recommended

Kinetis Design Studio 3.0 Kinetis SDK 1.2 Processor-Expert using FRDM-KL43Z: UART communication with a console on the host through OpenSDA

bheemarao
bheemarao
11 Aug 2015

Here is a Project created using new KDS version 3.0 and Kinetis software development kit 1.2 on processor expert platform. This project explores function of debug_console component interfaces to OpenSDA uart port of the KL43Z freedom board

 

Requirements

To run successfully this exercise, you need first to download following packages (link enclosed):

- IDE toolchain Kinetis Design Studio (KDS) min v3.0
- microcontroller Library
Kinetis Software Development Kit (KSDK) min 1.2
-
FRDM-KL43Z materials (schematics, Quick Start Package and Sample Code Package)
- latest
P&E Micro windows drivers and SDA Applications

[http://www.pemicro.com/downloads/main_downloads_temp/201507291203137773819/Pemicro_OpenSDA_Debug_MSD_Update_Apps_2015_03_12.zip ]


Before connecting your FRDM-KL43Z for the first time to the USB port of your computer, install the P&E Micro windows driver to ensure a correct detection of the board.

Install first the IDE toolchain KDS and when the installation ended successfully, install the MCU Library KSDK keeping the proposed installation path c:\freescale\kds or ksdk unchanged.

Launch KDS and define your workspace path, then select Help, Install New Software, Add, Archive, C:\Freescale\KSDK_1.2.0\tools\eclipse_update, select KSDK_1.2.0_Eclipse_Update.zip and press Open, OK, select KSDK Eclipse Update, press Next, Accept the Licence Agreement and press Finish. The KSDK libraries are now directly available in the IDE toolchain.


The automated code generator Processor Expert is already included in the IDE Toolchain (available separately as Processor Expert Driver Suite for other IDE toolchains).


Tutorial instructions

I have created a project by name “KL43Z-UART example” using same steps as earlier

image

image

image

image

image

Now the project looks like as shown below

image

Now i am going to add the component debug_console from component library

image

Change the settings of the debug_console:

We know from the schematic that UART pins are been connected to PTA1 and PTA2 of the controller


image

Double click on the selected debug component “fsl_debug_console “ and select the baud rate of 19200 as shown below:

image

Now select the uart pins for these settings:

image

Click on the generate button as shown below:

image

Now write the below lines of codes inside the main file to access the debug uart functions:

image

The code is given below:


char *name, Y, choice;
int age;
 Y=1;

while(Y==1){

 debug_printf("\nenter your name\r\n");
if(debug_scanf("%s",&name)!=0);

 debug_printf("\nenter your age\r\n");
if(debug_scanf("%i",&age)!=0);

 debug_printf("\nYour name is : %s\r\n",&name);
 debug_printf(" Your age is : %i\r\n",age);

 debug_printf("\n Do you want to continue, enter 'n' to come out any other char to continue \r\n");
if(debug_scanf("%s",&choice)!=0);

if (choice == 'n'){
 debug_printf(" exiting out of loop\r\n");
 Y= 0;
break;
 }
}


This code will print the printf() statements and scans the user input data’s and print on the terminal output

Now compile/build the project by clicking the generate button as shown below:


image

The project compiles with with no error, we will proceed further in execution the project:

image

Click on debug configuration and select the proper OpenSDA usb port from debugger tab as shown below:

image

image

Before clicking on the resume button make sure to open the hyper terminal of your choice with baud rate of 19200, 8N1

image

I have opened putty with the said settings:

image

Below is my output seen on the hyper terminal window:

image


I have enclosed the project folder and executable for quick evaluation


Happy working on Console windows image image image

 

 


Attachments:
KL43Z-UART example.rar
KL43Z-UART example-srec.rar
  • Sign in to reply
  • DAB
    DAB over 10 years ago

    Nice detailed post.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube