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 messenger Application using KW40Z connectivity software [Demonstrating and executing the cloning of wireless messenger 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: 19 Aug 2016 1:13 PM Date Created
  • Views 1998 views
  • Likes 0 likes
  • Comments 1 comment
  • wireless_mcu
  • wireless-messenger
  • frdm-kw40z
Related
Recommended

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

bheemarao
bheemarao
19 Aug 2016

This document shows a brief demonstration on executing wireless messenger application using NXP Bluetooth FRDM-KW40Z wireless development board.

 

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 messenger project

 

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 messenger 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_messenger-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_messenger-cloned”

image

 

Step-2: Building the Binaries using IAR

Open IAR

image

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

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

image

The project window looks like as shown below:

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_messenger-cloned” project and build it as did earlier It builds with zero error and an executable *.bin is generated

image

image

 

Step-3 Executing the wireless messenger using the generated binaries

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

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

 

image

We can see inside the “Wireless_MessengerMenus.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_MessengerMenus.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_messenger-cloned.bin” file from debug folder and paste it into both the DAPLink foders as shown below:

image

And to the other board

image

Now open the Putty hyperterminal with below settings

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 opening putty terminal press reset button on both the boards you will see below message on both terminal

image

After flashing the board, the device is in idle mode (all 4 LEDs flashing).

Press enter to start on both boards you will see wireless messenger short cuts as shown below

image

Given in the above figure:

 

pressing ‘q’ will increase the channel number. When it reaches 26 the channel number will be set to 11.

pressing ‘w’ will decrease the channel number. If previous channel number is 11, the next channel will be 26

pressing ‘a’ and ‘s’ is similar to ‘q’ and ‘w’ but for setting the output power. The limits for this option are [0x03, 0x0F].

pressing ‘z’ will increase the number of retransmissions in case of a channel busy scenario. Keep in mind that a number greater than 0 for this option will enable automatic CCA before TX option.

pressing ‘x’ will decrease the number of retransmission in case of a channel busy status. If the number of retransmissions is decremented to 0, the feature will be disabled.

pressing ‘r’ will increment the number of retries in case of a No Ack situation. If the number of retries is greater than 0, the automatic ACK mechanism is enabled. This mechanism is bypassed in case of a broadcast transmission.

pressing ‘t’ will decrement the number of retries in case of a No Ack situation. If the number of retries reaches 0, the automatic ACK mechanism is disabled.

 

Configuration Menu

By pressing  ‘1’ you will be entered in configuration menu

The configuration menu is shown below . There are three options available:• Configure Short Pan ID: this option will allow the user to set the source/destination PAN address. The user must enter four hexadecimal digits resembling a 16-bit address. The value entered is case-insensitive. For example, to set a broadcast address for the PAN ID, the user can type both “0xFFFF” or “0xffff”.

 

• Configure Short Src ID: this option will allow the user to set the short address of the node. The option is similar to the one presented above.

 

• Configure Short Dst ID: this option will allow the user to set the destination address of the packets that will be sent from the console menu. The feature is similar to the Configure Short Pan ID option.

image

 

Security IV and key configuration

 

Press ‘p’ to go back to main menu and press ‘3’ to enter into Security IV and key configuration menu

This configuration menu appears only if the application is built with gSmacUseSecurity_c set to 1. This feature allows the user to configure the initial vector and encryption key. For two devices to communicate properly, security must be enabled on both of them and the initial vector and the key must be identical.

image

 

Wireless Messenger console menu

 

The console menu is used for sending and receiving messages. Outside this menu, the MKW40Z will not receive any packets OTA. Also, in this menu all configuration options are disabled.

 

In the console menu, the user can see packets intended for his MKW40Z platform or broadcast packets. Also when the user types a message and hits [ENTER] the application will include the message into a packet payload and send it using the addressing information configured previously. The application will notify the user about the status of the packet by writing a status message to the serial port. The status can be either a “Packet Sent” message or an error message in case the retry or retransmission mechanism is enabled and sending failed after the retry/retransmission counter reaches the configured value. For example if the CCA Fail Retries is set to two and the algorithm finds the channel idle after a second attempt, the user will receive a “Packet Sent” message in the TERM. If the channel is busy after a second retry the user will receive a “Packet Sending Failed. Reason. Channel Busy!”  notification.

 

To return to the main menu the user must press the escape key ([Esc]).

 

Press 2 and enter into messenger menu on both the boards and start chat:

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 the wireless messenger application on KW40Z (wireless MCU)... 

  • Sign in to reply
  • DAB
    DAB over 9 years ago

    Very 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