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 Getting started with demo-apps and executing ecompass application for FRDM-KW41Z NXP Freedom Development Platform
  • 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: 21 Nov 2016 1:32 PM Date Created
  • Views 680 views
  • Likes 0 likes
  • Comments 0 comments
  • ecompass demo_apps
  • frdm-kw41z
Related
Recommended

Getting started with demo-apps and executing ecompass application for FRDM-KW41Z NXP Freedom Development Platform

bheemarao
bheemarao
21 Nov 2016

This document shows how to execute the demo-apps for  FRDM-KW41ZFRDM-KW41Z that comes along with connectivity software package

To proceed further the below are the prerequisites:

 

1. KDS3.2.0 installed on your computer

(You can download latest version of KDS from Here or direct download from below link:)

https://nxp.flexnetoperations.com/control/frse/product?entitlementId=123663777&lineNum=1&authContactId=73533311&authPartyId=61860331

 

2. KW41Z Connectivity Software

The KW41Z Connectivity Software package integrates the Kinetis Software Development Kit v2.0 and all the wireless connectivity stacks required to develop your solution using IEEE 802.15.4 and/or Bluetooth Low Energy.

Click below to download the KW41Z Connectivity Software appropriate for your computer's operating system.

http://www.nxp.com/webapp/Download?colCode=KW41Z-CONNECTIVITY-SOFTWARE&appType=license&location=null&Parent_nodeId=1470861923476723569569&Parent_pageType=product

After installation you can find Connectivity Example Codes at below folder location:

C:\NXP\MKW41Z_ConnSw_1.0.2

 

Steps involved:

1)   Importing the project into workspace

2)   Build and Run an example application

 

Importing the project into workspace

 

Open Kinetis Design Studio Version: 3.2.0 it prompts the user to select a workspace location. KDS IDE is built on top of Eclipse, which uses workspace to store information about its current configuration; you can choose your own location.

 

image

Select "File -> Import" from the KDS IDE menu. In the window that appears, expand the "Project of Projects" folder and select "Existing Projects Sets". Then, click the "Next" button.

image

As we have installed the KW41 connectivity software at below location: point the browse option to this location or copy the path and paste it as shown in picture

“C:\nxp\MKW41Z_ConnSw_1.0.2\boards\frdmkw41z\demo_apps\ecompass\kds”

 

image

After pointing to the correct directory, your "Import Working Sets and Projects" window should look like the figure below. Click the "Finish" button.

image

The workspace will look like figure shown below:

image

You can browse to source folder “ecompass.c” where our main program is present

 

The E-Compass demo application demonstrates the use of the FXOS8700 sensor. The tilt-compensated algorithm calculates all three angles (pitch, roll, and yaw or compass heading).

image

 

I2C communication is done using pin muxing method here

 

SCL port is assigned to port-C-2 as shown below:

     #define I2C_RELEASE_SCL_GPIO GPIOC

     #define I2C_RELEASE_SCL_PIN 2U

 

SDA port is assigned to Port-C-3 as shown below:

     #define I2C_RELEASE_SDA_GPIO GPIOC

     #define I2C_RELEASE_SDA_PIN 3U

 

I2C Port pin config is done as below:

PORT_SetPinConfig(I2C_RELEASE_SCL_PORT, I2C_RELEASE_SCL_PIN, &i2c_pin_config);

PORT_SetPinConfig(I2C_RELEASE_SDA_PORT, I2C_RELEASE_SDA_PIN, &i2c_pin_config);

 

Magnetometer calibration is done using static void Magnetometer_Calibrate(void)

sensor data is received using Sensor_ReadData(&g_Ax_Raw, &g_Ay_Raw, &g_Az_Raw, &g_Mx_Raw, &g_My_Raw, &g_Mz_Raw);

 

FXOS sensor is initialised and data is read using below functions

FXOS_Init(&g_fxosHandle);

    /* Get sensor range */

FXOS_ReadReg(&g_fxosHandle, XYZ_DATA_CFG_REG, &g_sensorRange, 1);

 

Debugging (Build and Run an example application)

 

There are two project configurations (build targets) supported for each KSDK project:

• Debug – Compiler optimization is set to low, and debug information is generated for the executable. This target should be selected for development and debug.

• Release – Compiler optimization is set to high, and debug information is not generated. This target should be

selected for final application deployment.

 

Choose the appropriate build target, "Debug" or "Release", by clicking the downward facing arrow next to the hammer icon, as shown below. For this example, select the "Debug" target.

image

Run an example application

Now connect the KW41Z board to your machine USB port and click on hammer button to build the project to check whether the project is compiling and building without errors

You can see the result in console window as shown below:

image

Now we will proceed to execute this project by clicking on debug configuration as shown:

Make sure to connect the development platform to your PC via USB cable between the OpenSDA USB and the PC USB connector.

image

Make the selection as shown

image

The application is downloaded to the target and automatically run to main(): You will see the execution window as shown below:

image

Now open a serial hyper terminal window to test this application:

 

My board is connected to com44 port as shown in device manager:

 

image

I am having putty serial terminal application with me, open with below set up configuration:

image

Now go back to the KDS execution window and

Start the application by clicking the "Resume" button

image

The ecompass application is now running:

image

image

image

Happy working with Demo apps (ecompass) using KW41Z image image

  • Sign in to reply
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