HCI Command to set PHY

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HCI Command to set PHY

1,054 Views
All_Seer
Contributor II

Hi,

I am using KW38. Just wondering why I can't set the default PHY, or set the PHY.

I have no issue using the HCI_LE_Read_Phy, but can't get any success is either the HCI_LE_Set_Default_Phy or the HCI_LE_Set_PHY.

I am getting the Rx CMD Code: 04 0F 04 12 01 32 20.

Thanks!

Tags (3)
0 Kudos
3 Replies

991 Views
All_Seer
Contributor II

Hi Julian,

Yes I am using the hci_bb example with the latest version of the test tool.

I am using only one kw38 board and trying to have a standalone test using the HCI commands.

I was able to send the HCI_LE_Set_Default_Phy without any errors but when i tried to read with HCI_Read_Phy, the Tx and Rx are still 00 even thhough I tried both 01 and 02 inputs. Is there any way to set the PHY mode of the device? I also tried DTM but was unsuccessful in sending the standard LE DTM commands for test setup, tx, tx, and test end.

Regards,

Bryan

0 Kudos

985 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @All_Seer,

An active connection between two devices is needed to send a successful Set_Phy command, if not, the HCI_Read_PHY command will not reflect any changes to the PHY mode in this case.

The HCI_LE_Set_Default_PHY command is used to set the default PHY for all future connections initiated by the local device, and it only affects future connections, not the current connection. Therefore, you cannot use this command to change the PHY mode of an existing connection or to see changes reflected in the HCI_Read_PHY command output.

If you want to change the PHY mode for an existing connection, you can use the HCI_LE_Set_PHY command, which allows you to set the PHY mode for a specific connection handle. This command can be used to change the PHY mode for the currently active connection, and the changes will be reflected in the HCI_Read_PHY command output.

Please help me check in the Bluetooth Core Specification v5.0, Vol. 6, Part B (Link Layer Specification), in section 5.1.10 PHY Update Procedure, as all the procedures and rules for PHY updates are broken down.

The commands needed to establish a connection are dependent on each case and the parameters needed. However, there are key HCI commands typically used to establish a BLE connection, such as: HCI_Reset, HCI_LE_Set_Event_Mask, HCI_LE_Set_Scan_Parameters, HCI_LE_Set_Scan_Enable, HCI_LE_Create_Connection, HCI_LE_Set_Connection_Update_Enable, as well as advertising parameters and data. Please help me look into "Link Control" and "Link Policy" sections of Volume 2, Part E of the Core Bluetooth Specification for all the commands that are supported to establish a connection.

I hope you find this helpful!

Best regards,
Julián

0 Kudos

1,002 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @All_Seer,

I hope you are doing great. What is the example you are using for this application? Are you using the hci_blackbox example with the Test Tool 12 application? If yes, help me confirm they are the latest version.

As for the Rx CMD you are receiving, it seems this is a Rx CMD from the HCI_LE_Set_Phy command, is this correct?

With this in mind, the status of the return parameter would be '12'. Vol 2, Part D 2.1 (Error Code Descriptions) of the Bluetooth Specification V5.0 describes this error as "Invalid HCI command parameters (0x12)", with the following description:

"The Invalid HCI Command Parameters error code indicates that at least one of the HCI command parameters is invalid.

This shall be used when:

  • the parameter total length is invalid.
  • a command parameter is an invalid type.
  • a connection identifier does not match the corresponding event.
  • a parameter is odd when it is required to be even.
  • a parameter is outside of the specified range.
  • two or more parameter values have inconsistent values.

Note: An invalid type can be, for example, when a SCO connection handle is used where an ACL connection handle is required."

Are you utilizing two KW38 to make a connection? If not, please help me understand what configuration you are using, and what parameters are you filling in the HCI command.

Best regards,

Julián

0 Kudos