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 Running Wireless UART application using Bluetooth®︎ Low Energy with FRDM-KW41Z
  • 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: 9 Nov 2016 12:59 PM Date Created
  • Views 1153 views
  • Likes 1 like
  • Comments 0 comments
  • kinetis w series
  • ble + 15.4
  • frdm-kw41z
  • wireless mcu (arm cortex-m0+ based)
  • wireless uart using ble
Related
Recommended

Running Wireless UART application using Bluetooth®︎ Low Energy with FRDM-KW41Z

bheemarao
bheemarao
9 Nov 2016

This blog describes the BluetoothRegistered Low Energy Stack enablement for the Freescale Freedom development platform with the Kinetis KW41Z dual wireless mode system-on-chip (SoC). The Software Development Package provides a Bluetooth Low Energy v4.2-compliant host stack and controller implementation with a set of GATT-based profiles and services implemented on top. MKW41Z Connectivity Software covers: BLE, Thread, GENFSK, IEEE802.15.4 and SMAC.

 

The main target platform is the  FRDM-KW41ZFRDM-KW41Z Freedom platform based on the KW41Z wireless dual-mode SoC which incorporates an ARM Cortex-M0 core which can be configured to operate at various frequencies up to 48 MHz It has 512 KB of Flash and 128 KB of SRAM The platform features a composite USB device called OpenSDA which serves as debugger interface and as a USB-to-serial converter via a virtual COM port application

 

The Wireless UART application implements both the GATT client and server for the custom Wireless UART profile and services.

• Wireless UART Service (UUID: 01ff0100-ba5e-f4ee-5ca1-eb1e5e4b1ce0)

• Battery Service v1.0

• Device Information Service v1.1

The Wireless UART service is a custom service that implements a custom writable ASCII Char characteristic (UUID: 01ff0101-ba5e-f4ee-5ca1-eb1e5e4b1ce0) that holds the character written by the peer device.

The application behaves at first as a GAP central node. It enters GAP Limited Discovery Procedure and searches for other Wireless UART devices to connect. If the node fails to find any peripherals within seconds, it changes its role to a GAP peripheral. It enters GAP General Discoverable Mode and waits for a GAP central node to connect.

 

The application is built to work with another  FRDM-KW41ZFRDM-KW41Z platform running the same example or with the Wireless UART from the Kinetis BLE Toolbox application We will be testing with two  FRDM-KW41ZFRDM-KW41Z board here in next part of my blog i will demonstrate using one KW41Z board Kinetis BLE Toolbox

 

Preliminaries:

 

1. Download 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 HERE to download the KW41Z Connectivity Software appropriate for your computer's operating system.

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

C:\NXP\MKW41Z_ConnSw_1.0.2

 

2. Install Your Toolchain:

NXP offers a complimentary toolchain called Kinetis Design Studio (KDS)

https://nxp.flexnetoperations.com/control/frse/download?element=7490587

The KW41Z Connectivity Software includes support for other tools such as IAR

(https://www.iar.com/iar-embedded-workbench/freescale/)

 

Steps involved:

1) Cloning a project: run the Project Cloner application

2) Building the Binaries using KDS

3) Executing the project using generated binaries

 

Cloning a project

 

I will be using Wireless UART application here for demonstration:

Navigate to the KW41Z Connectivity Software installation folder and run the Project Cloner application (C:\nxp\MKW41Z_ConnSw_1.0.2\tools\wireless\ProjectCloner).

image

Select the below options for project cloner

 

After the Codebase path has been selected correctly, the Project Cloner will display all the Connectivity Software example applications.

Next select the example application to be cloned (Clone example app), and the desired configuration (Clone Configuration).

 

By default both IAR and KDS projects are shown in the Clone configuration dropdown menu. I have selected for KDS tool chain

 

IMP Note: you need to do a clean build of a project BEFORE you clone it to create the debug folder and files like MKW41Z512xxx4_connectivity.ld in the original

image

I have changed the destination root path to “C:\Users\brao\Desktop\KW41-clonned project” and given the cloned project name as “Bluetooth-wireless uart cloned”

 

Now click on Clone Project

image

You can see the clonning successfully in log window: You can see the cloned project in folder

“C:\Users\brao\Desktop\KW41-clonned project\Bluetooth-wireless uart clonned\boards\frdmkw41z\wireless_examples\bluetooth\wireless_uart”

image

Step-2: Building the Binaries using KDS

Open the KDS tool and import the cloned project as shown below

Import the project into Workspace: File -> Import -> General -> Existing Projects into Workspace

image

Browse for the cloned project path:

“C:\Users\brao\Desktop\KW41-clonned project\Bluetooth-wireless uart cloned”

image

The KDS project window looks as shown below:

image

Build the Wireless uart project

 

Right Click on project folder and select Build Project as shown below:

Once it gets build you can see the status as Build Finished in console window

image

Step-3: Executing the project using generated binaries

 

Click the “Debug” button to flash the executable onto the board

 

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

Note: Please make sure that you install the latest J-Link driver and associate it with KDS. To do this, download the driver from https://www.segger.com/jlink-software.html and install it.

Connect your board-1  FRDM-KW41ZFRDM-KW41Z to your system and proceed to Debug configuration settings

image

The projects are configured to use “J-Link / J-Trace” as the default debugger. Please make sure that your board’s OpenSDA chip contains a J-Link firmware or that the debugger selection corresponds to the physical interface used to interface to the board.

Open a putty or tera term hyperterminal application and open a session to your  FRDM-KW41ZFRDM-KW41Z COM port(in my case com port connected is to com44

 

Configure the terminal with these settings:

115200 baud rate

No parity

8 data bits

1 stop bit

Start the application by clicking the "Resume" button:

image

You can see the execution of this board, the start Screen is blank after Resume is pressed

image

image

Now click on stop button as shown below:

image

Now connect the board-2 KW41Z from different usb port, and you can see the two board com ports as shown below:

image

Now connect the board-2 and perform the same operation of executing the debugging activity so that the program is flashed to the second board (board-2).

The board-2 is connected to com76 port in this case

Select the second J-Link board which represents the board-2 connected as active debugging session for the tool:

image

Open a hyperterminal with com76 port settings now you will be having 2 terminals open with wireless uart program executing on it.

image

Press the SW4 button on the first board to start scanning for devices.

Do the same on the second board.

After 3 seconds, the first board enters GAP General Discoverable Mode and the second board connects.

As soon as the LED3 turns solid on both devices, the user can start writing in one of the consoles.

 

The text appears on the other terminal, as shown in the figure below.

image

 

The Video output execution is shown in below video

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Happy Executing Wireless UART using BLE method on KW41Z (wireless MCU)... image 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