HCI Application is a Host Controller Interface application which provides a serial communication to interface with the KW40/KW41 BLE radio part. It enables the user to have a way to control the radio through serial commands. In this section will be discussed how user could send serial commands to the KW40/KW41 device.
“HCI app” file is given to test the BLE functionality. User needs to open the COM port with the configuration 115200 8N1N. Then, it is needed to send commands in Hex format, user can make use of Docklight application. Once HCI application is downloaded to the board, next steps need to be followed:
If there is a need to change the output power of the radio. The NXP connectivity software provides the Controller_SetTxPowerLevel() which is called inside of the Controller_TaskInit(). Controller_SetTxPowerLevel() function make use of the following defines to determine the default power output in the application:
mAdvertisingDefaultTxPower_c and mConnectionDefaultTxPower_c. The value range for both is from 0 to 31. The range might be different for each device, so, it needs to be corroborated. This range is applicable only for KW41Z device. For example, for KW40Z, range is from 0 to 15.
The defines are defined in the file ble_controller_task_config.h.
Finally, HCI applications can be found in the connectivity software package of your desired device.
If the KW40Z is the device under test (DUT), the HCI application is called "hci_app", it can be found in the next path:
"<insllation_path>\KW40Z_Connectivity_Software_1.0.1\ConnSw\examples\bluetooth\hci_app"
If the KW41Z is the device under test (DUT), the HCI application is called "hci_black_box", it can be found in the next path:
"<insllation_path>\MKW41Z_ConnSw_1.0.2\boards\frdmkw41z\wireless_examples\bluetooth\hci_black_box"
Hi,
I'm working with the KW30Z chip set, is the hci_app compatible with this chip set?
Thanks!
Hi Josh, I hope you're doing well!
hci_app is compatible with the KW30Z chipset, you can find the Connectivity Software in this page here.
You can find the hci_app example project in the following path after installing the Connectivity Software:
<C:\Freescale\KW40Z_Connectivity_Software_1.0.1\ConnSw\examples\bluetooth\hci_app>
To use the test tool, could you please take a look at this document?
Best regards,
Sebastian
Sebastian,
Thanks for the response! I have a board where the main MCU is the MK22FN512VLL12 and I have the KW30Z as an auxiliary chip that just manages BLE. I've programmed the KW30Z with the hci_app with no problems. I'm having trouble finding documentation on hci commands to send to the KW30Z over serial from the main MCU. Could you give me some direction please?
Thanks!,
Josh
hi miguel,
can you tell me parameter tx_power's range in HCI_VENDOR_CONFIG_TX_POWER command?
thanks.
Hi @EverettRao ,
The format of the command in the xml file is wrong.
Please update the XML file for this command as below:
<Vendor_Commands>
<GroupDesc>Vendor_Commands</GroupDesc>
<Cmd>
<CmdName>HCI_VENDOR_CONFIG_TX_POWER</CmdName>
<CmdDesc>HCI_VENDOR_CONFIG_TX_POWER Desc. OgB: FD OcB: 2D </CmdDesc>
<CmdSync>01</CmdSync>
<CmdHeader>3F 012D</CmdHeader>
<CmdParms>
<Parm>
<ParmName>tx_power</ParmName>
<ParmDesc>tx_power Desc</ParmDesc>
<ParmSize>1</ParmSize>
<ParmType>tInt</ParmType>
<ParmLastValue>00</ParmLastValue>
<ParmDefaultValue>00</ParmDefaultValue>
</Parm>
<Parm>
<ParmName>Channel</ParmName>
<ParmDesc>type Desc</ParmDesc>
<ParmSize>1</ParmSize>
<ParmType>tInt</ParmType>
<ParmLastValue>00</ParmLastValue>
<ParmDefaultValue>00</ParmDefaultValue>
</Parm>
<Parm>
<ParmName>NotUsed</ParmName>
<ParmDesc>Not Used</ParmDesc>
<ParmSize>2</ParmSize>
<ParmType>tInt</ParmType>
<ParmLastValue>00</ParmLastValue>
<ParmDefaultValue>00</ParmDefaultValue>
</Parm>
</CmdParms>
</Cmd>
</Vendor_Commands>
On TestTool, you should see something like this:
As parameters, there are 2 options for the channel:
And the tx_power is the level in dbm. If you put a value > 20 you will receive COMMAND_DISALLOWED_ERROR.
Regards,
Ovidiu