This guide uses the DoorlockKeyPad built under 7.12.2 but the same basic concepts apply to any sample app and your project. A generic KBA on upgrading SDKs for Bluetooth projects provides general insights but this document is specific to this Z-Wave release.
Another minor issue with the 7.13.3 release is that it is not properly creating the .GBL files for OTA. The fix is simple:
Modify line 46 in \SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v2.7\protocol\z-wave\ZAF\ApplicationUtilities\application_properties.c
.type = 1<<6UL,
.type = 1<<7UL,
My recommendation is to click on this file in the Project Explorer->ZAF_ApplicationUtilites and make the change. When you change the code, this popup comes up:
And you should click on Make A Copy.
When the next minor release comes out this will be fixed and you will then want to delete the copy and go back to the Linked version of the file. I do NOT recommend changing the files in the SDK.
The Z-Ware C API allows for OTA updates of devices. This article provides an example of how to use it.
zwif_fw_info_get() should first be called to find information about the device and then zwif_fw_updt_req() should be called to perform the update. Each of those functions has callbacks that must be implemented.
The example provided is based on the existing bin_switch demo. It finds the first binary switch node and then allows that node to be updated by adding an additional menu option to do so.
Two places in the code were modified from the plain bin_switch demo. Inside the bin_sw_intf_get() function an additional option to find the firmware update interface was added. The callbacks were added and the main function was modified to add menu option 3 to perform the update.
To run the demo make sure you have a firmware image (.gbl or .otz file) for the binary switch end device example in the same directory as the executable.
The relation between the TX-Power in dB and the raw value used in RAILTest is given by this:
To make the conversion easy the INS14664: Introduction to MaxPowerCalc has been added in Simplicity Studio.
#define 0dBmMeasured // dBm Value measured by raw power setting 24,
// remember to counteract for cables in the setup.
#define wantedOutputPower // The dBm PA output power wanted for the customers application
#define scaledPower (wantedOutputPower - 0dBmMeasured) // intermediate variable for use below
#define rawPASetting (0.000133848*(scaledPower)^5 + 0.001042021*(scaledPower)^4 \
– 0.005109317*(scaledPower)^3 + 0.11773548*(scaledPower)^2 \
+ 3.007063918*(scaledPower) + 24.35849668)
The raw values are used in RAILTest (please make sure to use lower case letters "raw" in RAILTest )
and the settings in the Z-Wave SDK application code are set in "config_rf.h" in dBm:
// The maximum allowed Tx power in deci dBm
#define APP_MAX_TX_POWER 0 // set to 0 dBm by default in the Z-Wave SDK
// The deci dBm output measured at a PA setting of 0dBm (raw value 24)
#define APP_MEASURED_0DBM_TX_POWER 0 //Set to 0 to measure the 0 dBm
// This is set to 33 by default to support the development boards in the Z-Wave SDK
Plot of the raw value as a function of the ScaledPower (in dBm on the RFpin).
The maximum raw value in RAILTest is limited to 155 and the TX power max is 13dBm on the RFpin
More information can be found in
INS14283-6 Bring-up/test HW development, 4.5.1 How to Adjust the PA Output Power Using RailTest
INS14259-9 Z-Wave Plus V2 Application Framework SDK7, 6.3 Setting Up config_rf.h