Here in this document we shall explore the KW40Z connectivity software package and flow through the process of cloning the Bluetooth example projects i.e reusing the existing projects and modifying it as per requirement which saves design and coding cycle of the project.
Steps involved:
- Install KW40Z_Connectivity_Software_1.0.1.exe
- Cloning a project: run the Project Cloner application (ConnSw\tools\project_cloner\project_cloner.exe)
- Building the Binaries using IAR tool
Step -1: Install KW40Z_Connectivity_Software
The KW40Z Connectivity Software package integrates the Kinetis Software Development Kit v1.3 and all the wireless connectivity stacks required to develop your solution using IEEE 802.15.4 and/or Bluetooth Low Energy. Download the software Enablement package and tools required to build and run the connectivity solutions for KW40Z / KW30Z / KW20Z.
Download and install “KW40Z_Connectivity_Software_1.0.0” software from the link [http://www.nxp.com/webapp/Download?colCode=KW40Z-CONNECTIVITY-SOFTWARE&Parent_nodeId=1433195919005714784795&Parent_pageType=product]
After installing this software you will find the resources at “C:\Freescale\KW40Z_Connectivity_Software_1.0.1\ConnSw”
This folder contains all the necessary Bluetooth driver information’s, example projects, platform library, tools, framework and board related header files
Step -2: 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
Now we need to select the path for “codebase path” as shown below
We need to select “C:\Freescale\KW40Z_Connectivity_Software_1.0.1\ConnSw” as its path
Next select the example application to be cloned (Clone example app), and the desired configuration (Clone Configuration).
Here i have selected “bluetooth_alert_notification_server" as project needed to be cloned
Next in clone configuration select “frdmkw40z_bare_metal” as shown below
Under cloned app name provide name of your choice i have given it as “bluetooth_alert_notification_server-clonned”
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”
By default the Project Cloner will clone only application files (board specific files and example app files). To clone all the files, select the Clone full codebase radio button.
Now press the Clone Project button to start the cloning process. The log window will display “Cloning completed” when the process ends.
You can see the process starts and logged information can be seen as shown:
You can see the cloned project in folder “: C:\Users\brao\Desktop\cloned conn project\bluetooth_alert_notification_server-clonned”
Step-3: Building the Binaries using IAR
Here we show the required steps for obtaining the binary files for usage with the boards.
After you select the configuration you want to clone, locate the destination folder and follow the steps bellow
Note: In order to be able to build any of these packages you need a copy of the IAR Embedded Workbench for ARM version 7.40.2 or higher. This connectivity software package does not include support for any other toolchains.
Now open IAR IDE tool
Open the cloned IAR workspace “bluetooth_alert_notification_server-clonned.eww” from below location
“C:\Users\brao\Desktop\cloned conn project\bluetooth_alert_notification_server-cloned”
After opening in IAR the project folder looks as below:
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 ARM in order to enable the complete board support and RTOS kernel support:
Select the KSDK platform (bare-metal) library project
Build the KSDK platform library project.
It builds with zero error
Next Select the “bluetooth_alert_notification_server-clonned” project and build it as did earlier
It builds with zero error and an executable *.out is generated
Debugging the cloned project:
Make the appropriate debugger settings in the project options window:
The projects are configured with “CMSIS-DAP” firmware as the default debug configuration. Please make sure that your board’s OpenSDA chip contains a CMSIS-DAP firmware or that the debugger selection corresponds to the physical interface used to connect to the boards.
Now connect the board and Click the “Download and Debug” button to flash the executable onto the board.
You can see below project execution on IAR tool
You can start debugging the project by clicking on single stepping (step over, step into, step out) or directly you can click on “go” to execute the project
The Alert Notification application implements a GATT client or server for the following profile and services: Alert Notification Profile v1.0
- Alert Notification Service v1.0
- Battery Service v1.0
- Device Information Service v1.1
The application behaves as a GAP central node. It enters the GAP Limited Discovery Procedure and searches for Alert Notification Clients to connect to. After connecting with the peripheral, it waits for notifications to be configured.
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, LED1 is flashing. When the central node connects to the peripheral, 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.
When in connection and if notifications are configured, pressing the SW3 button triggers a new alert notification (“New mail”) to be sent to the GATT client. Holding the SW3 button for 2-3 seconds triggers a new unread alert status notification (missed call) to be sent to the same GATT client.
Happy Executing the clone example package on KW40Z (wireless MCU)...