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 Executing Wireless UART Application using KW40Z connectivity software [Demonstrating and executing the cloning of wireless uart project using FRDM-KW40Z 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: 11 Jul 2016 6:54 AM Date Created
  • Views 672 views
  • Likes 0 likes
  • Comments 3 comments
  • kinetis w series
  • ble + 15.4
  • ble/802.15.4 integrated transceiver
  • wireless uart
  • wireless mcu (arm cortex-m0+ based)
  • frdm-kw40z
Related
Recommended

Executing Wireless UART Application using KW40Z connectivity software [Demonstrating and executing the cloning of wireless uart project using FRDM-KW40Z NXP Freedom Development Platform]

bheemarao
bheemarao
11 Jul 2016

This document shows a brief demonstration on executing wireless uart application using NXP Bluetooth Low Energy Software for the KW40Z wireless microcontroller platforms.

 

To proceed further the below are the prerequisites:

1.   The freedom hardware board i.e FRDM-KW40Z-2 No’s as shipped in a box

2.   IAR Tool to compile/build the example of wireless uart project

 

The Wireless UART application implements both the GATT client and server for the custom Wireless UART profile and service:  Wireless UART Service (UUID: 01ff0100-ba5e-f4ee-5ca1-eb1e5e4b1ce0)

Battery Service v1.0 and 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.

 

Steps involved:

1) Cloning a project: run the Project Cloner application (ConnSw\tools\project_cloner\project_cloner.exe)

2) Building the Binaries using IAR

3) Executing the project using generated binaries

 

Step -1: Cloning a project

Navigate to the below path

“C:\Freescale\KW40Z_Connectivity_Software_1.0.1\ConnSw\tools\project_cloner”

  And run the project cloner application

image

Now we need to select the path for “codebase path” as shown below

image

We need to select “C:\Freescale\KW40Z_Connectivity_Software_1.0.1\ConnSw” as its path

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

image

Under cloned app name provide name of your choice i have given it as “smac_wireless_uart-cloned” and other options as shown below:

And select the destination folder where the project needs to be saved

 

I am saving this project under a folder “C:\Users\brao\Desktop\cloned conn project”

image

After cloning you can see the data logging of cloning process

image

You can see the cloned project in folder

“C:\Users\brao\Desktop\cloned conn project\smac_wireless_uart-cloned”

 

image

 

Step-2: Building the Binaries using IAR

Open IAR Tool

image

Open the cloned IAR workspace “smac_wireless_uart-cloned.eww” from below location

“C:\Users\brao\Desktop\cloned conn project\smac_wireless_uart-cloned”

image

The KSDK platform libraries are RTOS dependent, so appropriate libraries must be built for the selected RTOS. For any connectivity application, the following Kinetis SDK libraries must be built with the IAR Embedded Workbench for ARMRegistered in order to enable the complete board support and RTOS kernel support:

 

Select the KSDK platform (bare-metal) library project and Build the KSDK platform library project.

image

It builds with zero error

Next Select the “smac_wireless_uart-cloned” project and build it as did earlier It builds with zero error and an executable *.out is generated

 

Step-3 Executing the wireless uart using the generated binaries

We need two  FRDM-KW40ZFRDM-KW40Z boards to execute this project The binaries are located in the below folder

“C:\Users\brao\Desktop\cloned conn project\smac_wireless_uart-cloned\debug”

image

We can see inside the “Wireless_UartApp.c” the uart baud rate has been set to 115200

Serial_SetBaudRate (mAppSer, gUARTBaudRate115200_c);   //Set 115200 as default baud

 

You can browse for the other api’s and code flow inside the “Wireless_UartApp.c” file as shown below:

image

 

If any changes to be made as per your requirement you have to do it here and rebuild again to get the exe file

Now connect both the boards when connected we can see it in explorer as shown

image

Now copy the generated “smac_wireless_uart-cloned.bin” file from debug folder and paste it into both the DAPLink foders as shown below:

image

And to the other board's DAPLink

image

Now open the Putty hyperterminal:

You can see both the boards in device manager listed under ports (COM & LPT)

image

COM53 board-1 settings:

image

COM54 board-2 settings:

image

After flashing the board, the device is in idle mode (all 4 LEDs flashing). To start scanning, press the SW4 button. When in GAP Limited Discovery Procedure of GAP General Discoverable Mode, LED1 is flashing. When the node connects to a peer device, LED1 turns solid. To disconnect the node, hold the SW4 button pressed for 2-3 seconds. The node then re-enters GAP Limited Discovery Procedure.

 

The application is built to work with a similar application on a different device.

The start screen is blank after the board is reset.

 

Press the SW4 button on the first board to start scanning for devices. Do the same on the second board. After 5 seconds, the first board enters GAP General Discoverable Mode and the second board connects.

 

As soon as the LED1 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

Happy Executing the wireless uart application on KW40Z (wireless MCU)...  image image image

  • Sign in to reply
  • Former Member
    Former Member over 9 years ago in reply to bheemarao

    bheemarao,

     

    Correct, I just wanted to make the clarification that the SMAC version of the Wireless UART is not Bluetooth Low Energy. In other words, SMAC Wireless UART uses the 802.15.4 radio part of the KW40Z and NOT BLE.

     

    Moreover, other option to play with the Wireless UART BLE version, you can also download the Kinetis BLE Toolbox mobile(Android/iOS) application to be able to exchange data between a smartphone and the FRDM-KW40Z.

     

    Thanks...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • bheemarao
    bheemarao over 9 years ago in reply to Former Member

    Hi Miguel,

     

    Yes as you said there are two "wireless_uart" examples one from SMAC "C:\Freescale\KW40Z_Connectivity_Software_1.0.1\ConnSw\examples\smac\Wireless_Uart\frdmkw40z\FreeRTOS\build\iar"

    and another is from BLE

    "C:\Freescale\KW40Z_Connectivity_Software_1.0.1\ConnSw\examples\bluetooth\wireless_uart_demo\frdmkw40z\FreeRTOS\build\iar"

     

    Cloning can be done to either of the wireless_uart projects.

    (refer to the document "MKW40ZSMACDAUG" available from "C:\Freescale\KW40Z_Connectivity_Software_1.0.1\ConnSw\doc"

    Chapter 2: MKW40Z Wireless UART Application)

     

    I have used the SMAC wireless UART demo project,

    instead of cloning you can directly access the corresponding binary file from location:

    "C:\Freescale\KW40Z_Connectivity_Software_1.0.1\ConnSw\tools\binaries"

     

    image

    Best Regards

    Bheema Rao

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 9 years ago

    Hello bheemarao,

     

    It is great guidance to be able to use FRDM-KW40Z. Nevertheless, I guess there was a confusion about the Wireless UART project you are showing to clone. There are two kind of Wireless UART examples in the KW40Z Connectivity Software. One is related to SMAC, which is a lightweight protocol based on 802.15.4 standard. The second one is related to BLE, which I guess it is the one you wanted to explain in this thread. All, instruction are correct, they would be the same just that the example project you need to select is the one related to BLE which is named "bluetooth_wireless_uart_demo". Hence, the next figure shows what should be selected to clone a BLE Wireless UART Project.

    image

     

    Thanks and best regards,

    Miguel

    • 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