This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640R2F: BLE5 stack Simple Serial Socket

Part Number: CC2640R2F

Hi TI team (Clément),

I have some question about BLE5 stack Simple Serial Socket as below

https://github.com/ti-simplelink/ble_examples/releases/tag/simplelink_cc2640r2_sdk-3.30.00.00

1. Is it support LE coded PHYs ?

2. Normally the stack is running on LE 1M PHYs, How can I change to LE coded PHYs ? and What the parameters should I change ?

Thank you

  • Hi,

    (For other readers, the coded PHYs are only available with Bluetooth 5.0 and latter.)

    1- The example can be modified in order to be able to use coded PHYs. Keep in mind that using a Coded PHY will decrease the available bandwidth. Keep also in mind that not all the devices are able to use Coded PHYs (of course CC2640R2F can used coded PHYs)

    2-Generally speaking, the functions HCI_LE_SetDefaultPhyCmd() (if the connection is not yet formed) and HCI_LE_SetPhyCmd() (if the connection is already formed) must be used to set the PHY. You can find more documentation here.
    The examples simple_peripheral and simple_central in your SDK provide a good example on how to switch PHY based on the RSSI (recommended to keep the best throughput possible when the devices are close to each other).

    I hope this will help,

    Kind regards,

  • Hi Clément,

    Thank you for the information

    My understanding are not cleared, please explain as below

    I flash BLE5 stack Simple Serial Socket into ② CC2640R2F (Default running LE 1M PHYs) after that I want to change LE 1M PHYs to LE coded PHYs

    1. Can the ① External MCU sent HCI command to change PHYs immediately ? or Do I change code in BLE5 stack and re-flash again for changing PHYs ?

    2. When I set the new parameter by HCI command, Where is the parameter stored (running on RAM, stored in Flash ROM or etc.) ?

    Thank you

  • Hi,

    1- Both are possible but not recommended (I think it's a bit heavy to re-flash the device just to change the PHY + I don't understand how the External MCU could chose when the PHY must be changed). I would rather recommend one of these two options: - use the same kind of code that the one present in simple_peripheral to let the CC2640R2F decide (based on the RSSI) which PHY is used - use all the time the same PHY

    2- The parameter would be stored in RAM. Same remark for the autoPHY update, the information would only be stored in RAM. That being said, I don't see the added value to store this element in non-volatile memory (I mean if one device loses power, then the BLE connection will be ended, so who cares which PHY was used?)

    Best regards,

  • Hi Clément,

    Thank you very much for your advise

    1. Could you please confirm my unerstanding, Is it correct ?

    Example: Assume as the BT device able to comunicate range 50m for LE 1M PHY and 100 m for LE coded with mobile device

    1.1 For option 1: The PHY will update automatically depend on the RSSI

    If the mobile device far from BT device 40 m, it is running on LE 1M PHY after that the mobile device is moved to 90 m, it will update and change to run on LE coded PHY, right.

    1.2 For Option 2: The PHY is fixed (not chage all the time)

    If the mobile device far from BT device 40 m, it is running on LE 1M PHY after that the mobile device is moved to 90 m, the connection will be terminated (not change to LE coded PHY)

    2. If I want to use Option1 (based on the RSSI), Should I implement for both server and client side ?

    Please confirm and explain 

    Thank you

  • Hi again,

    1- Your understanding is correct. The PHY changes are based on the RSSI measured.

    2- You can decide that the server is responsible to measure the RSSI and trigger the PHY changes. As a result the server only needs to accept those changes. The advantage of this implementation is you can directly reused the code provided in simple_peripheral / simple_central examples.

    Regards,

  • Hi Clément,

    I am not sure for my understanding is it correct ?

    Could you please help to explain as my question below

    1. If I set the advetiser to advertise on both 1M PHY and LE coded PHY as http://dev.ti.com/tirex/content/simplelink_cc26x2_sdk_2_30_00_34/docs/ble5stack/ble_user_guide/html/ble-stack-5.x/phy.html#advertising-phy

    1.1 About  Advetising interval, Physical channel (37,38 and 39), Is the parameters run on 1M PHY as same as LE coded PHY ?

    1.2 About operation, Both 1M PHY and LE coded PHY advertise at the same time ? or it advertise on 1M PHY first and then switch to advertise on LE coded PHY.

    2. About scanner, Can it scan on 1M PHY and LE coded at the same time ?

    3. About Initiator, Can it initiate only one PHY ? and then the both devices will change PHY follow initiating PHY ?

    Example: Scanner on LE coded PHY and then initiate on 1M PHY. After the both devices met, it will run on 1M PHY

    Please explain 

    Thank you

  • Hi,

    1- FYI, the BLE5 stack Simple Serial Socket example is configured to use two advertisement sets.

    1.1- Not exactly. I'll let you see inside the structures GAPADV_PARAMS_LEGACY_SCANN_CONN and GAPADV_PARAMS_AE_LONG_RANGE_CONN to see the differences. You can also review our SimpleLink Academy trainings related to advertising and scanning.

    1.2- The two advertisements are not sent at the same time. It advertises on 1M PHY first, then switches to advertise on LE coded PHY, then advertises on 1M PHY, then on LE coded PHY... 

    2- Yes, you can scan non-coded and coded PHYs at the same time. The PHY scanned is set using the function GapScan_setPhyParams().

    3- Yes, the connection can only be initiate on ONE phy. The PHY used for connection init is set using the function GapInit_connect(). Once the connection formed, the devices can change the PHY used as often as required. Your example is perfectly valid: Scanner on LE coded PHY and then initiate on 1M PHY. After the both devices met, it will run on 1M PHY and they will be able to agree to use a different PHY if needed.
    That being said, if the scanner scans on a coded PHY, it is dangerous to use a non-coded PHY to initiate the connection. As you know, the coded PHYs have a longer range than the 1M PHY. So the devices migh be able to communicate over a coded PHY but not over a non-coded PHY.

    I hope this will help,

    Kind regards,