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.

LAUNCHXL-CC2640R2: Support for BLE central mode in simple np project

Part Number: LAUNCHXL-CC2640R2

Hi Team,

We need to integrate the BLE central mode with simple no project. The basic idea is to provide the multi-role capability in simple np project.

We have couple of queries below, could you please help us in the approach/implementation process?

1. Is there any example/reference project available with BLE central mode integrated with simple np project?

2. If no, Are there any limitations either from BLE stack or from the device hardware side?

3. Please suggest a reference project to implement the BLE central mode in simple np project. Can we consider the multi-role example project as reference?

Thanks in advance.

Best Regards,

Akshay

  • Hi Akshay

    Thank you for reaching out!

    The simple_np (SNP) project allows the CC2640R2 to be used as a network processor through the use of the Network Processor Interface (NPI)

    1. Is there any example/reference project available with BLE central mode integrated with simple np project?

    The simple_np project can be sent NPI commands to perform different BLE procedures (advertise, connect, terminate connection, etc). That said, the simple_np project can only support Peripheral + Broadcaster GAP roles. However, the host_test project, is able to support both peripheral and central roles and should be able to support a multi-role use-case. Some additional information may be found in the BLE Network Processor section of the User's Guide.

    2. If no, Are there any limitations either from BLE stack or from the device hardware side?

    The simple_np project does not support a central use-case, but the host_test project does. I would recommend using the host_test project as your starting point for your development given that you are interested in central role operation.

    3. Please suggest a reference project to implement the BLE central mode in simple np project. Can we consider the multi-role example project as reference?

    Since the host_test project works mainly by sending NPI commands, then I would recommend referencing the btool software included in your SDK (found inside the tools folder at the root of the SDK install) to see how the commands are formed and how the NPI commands work. You may further modify the host_test project to include pre-defined services/profiles to ease in host_test operation and modify the host_test logic to better suit your application.

    Best Regards,

    Jan

  • Hi Jan,

    Thanks for the details.

    If my understanding is correct, we have to refer the central role part of Host_test application and understand the implementation of NPI command flow using Btool application. Later, we can use the similar flow(commands) to integrate the central role into SNP project.

    Best Regards,

    Akshay

  • Hi Akshay,

    It may be possible to add central functionality to the SNP project, but this is not supported out of the box and may lead to issues later on.I would recommend using host_test for your evaluation as this project is able to interface with NPI commands out of the box and it provide support for central role out of the box.

    Best Regards,

    Jan

  • Hi Jan,

    Thanks for your suggestions.

    I've tried the host_test example code for both ble4.2 stack and ble5stack.

    Below are my observations -

    1. For BLE4.2 stack: After loading the host_test example in CENTRAL_CFG mode and performing a rest, the Btool shows error GapInit_getPhyParam failed.

    Please refer below image for reference -

    Could you please let me know, if I miss anything in the process?

    2. For BLE5 Stack: The host_test example works fine in CENTRAL_CFG mode. Using Btool, I can scan near by peripheral devices and connect to the mentioned MAC ID. However, I don't see the Simple_NP example in BLE5stack. 

    Could you please share the SNP example for BLE5stack?

    Thanks and Regards,

    Akshay

  • Hi Akshay,

    Could you try opening btool using the .bat file instead of the exe and see if you get the error in ble4? There is no SNP example in the ble5 examples, but the host_test example implements all of the functionality of the BLE4 SNP example in BLE5.

    Best Regards,

    Jan

  • Hi Jan,

    I've tried with .bat file and observed the same error. 

    Below is the Btool log for your reference please-

    [1] : <Info> - 11:50:12.080
    Port opened at 13-10-2023 11:50:12
    --------------------------------------------------------------------
    [2] : <Tx> - 11:50:12.221
    -Type           : 0x01 (Command)
    -OpCode         : 0xFC1D (HCIExt_ResetSystemCmd)
    -Data Length    : 0x01 (1) byte(s)
     Type           : 0x00 (0) (Chip Reset)
    Dump(Tx):
    0000:01 1D FC 01 00                                  .....
    --------------------------------------------------------------------
    [3] : <Rx> - 11:50:12.441
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x05 (5) bytes(s)
     Event          : 0x041D (1053) (HCIExt_ResetSystemCmdDone)
     Status         : 0x00 (0) (SUCCESS)
     CmdOpCode      : 0xFC1D (HCIExt_ResetSystemCmd)
    Dump(Rx):
    0000:04 FF 05 1D 04 00 1D FC                         ........
    --------------------------------------------------------------------
    [4] : <Tx> - 11:50:12.991
    -Type           : 0x01 (Command)
    -OpCode         : 0xFE00 (GAP_DeviceInit)
    -Data Length    : 0x08 (8) byte(s)
     ProfileRole    : 0x08 (8) (
                      Central)
     AddrMode       : 0x00 (0) (ADDRMODE_PUBLIC)
     RandomAddr     : 00:00:00:00:00:00
    Dump(Tx):
    0000:01 00 FE 08 08 00 00 00 00 00 00 00             ............
    --------------------------------------------------------------------
    [5] : <Rx> - 11:50:13.164
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
     Status         : 0x00 (0) (SUCCESS)
     OpCode         : 0xFE00 (GAP_DeviceInit)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 00 00 FE 00                      .........
    --------------------------------------------------------------------
    [6] : <Rx> - 11:50:13.180
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x2C (44) bytes(s)
     Event          : 0x0600 (1536) (GAP_DeviceInitDone)
     Status         : 0x00 (0) (SUCCESS)
     DevAddr        : F0:5E:CD:E8:37:AC
     DataPktLen     : 0x00FF (255)
     NumDataPkts    : 0x05 (5)
     IRK            : 00:00:00:00:00:00:58:17:00:00:00:00:00:00:00:00
     CSRK           : 8F:CE:F2:74:18:95:DA:79:4D:CF:AA:C6:FB:83:58:CA
    Dump(Rx):
    0000:04 FF 2C 00 06 00 AC 37 E8 CD 5E F0 FF 00 05 00 ..,....7..^.....
    0010:00 00 00 00 00 58 17 00 00 00 00 00 00 00 00 8F .....X..........
    0020:CE F2 74 18 95 DA 79 4D CF AA C6 FB 83 58 CA    ..t...yM.....X.
    --------------------------------------------------------------------
    [7] : <Tx> - 11:50:13.212
    -Type           : 0x01 (Command)
    -OpCode         : 0xFE61 (GapInit_getPhyParam)
    -Data Length    : 0x02 (2) byte(s)
     PHY            : 0x01 (1) (INIT_PHY_1M)
     ParamId        : 0x02 (2) (INIT_PHYPARAM_CONN_INT_MIN)
    Dump(Tx):
    0000:01 61 FE 02 01 02                               .a....
    --------------------------------------------------------------------
    [8] : <Tx> - 11:50:13.243
    -Type           : 0x01 (Command)
    -OpCode         : 0xFE61 (GapInit_getPhyParam)
    -Data Length    : 0x02 (2) byte(s)
     PHY            : 0x01 (1) (INIT_PHY_1M)
     ParamId        : 0x03 (3) (INIT_PHYPARAM_CONN_INT_MAX)
    Dump(Tx):
    0000:01 61 FE 02 01 03                               .a....
    --------------------------------------------------------------------
    [9] : <Tx> - 11:50:13.259
    -Type           : 0x01 (Command)
    -OpCode         : 0xFE61 (GapInit_getPhyParam)
    -Data Length    : 0x02 (2) byte(s)
     PHY            : 0x01 (1) (INIT_PHY_1M)
     ParamId        : 0x04 (4) (INIT_PHYPARAM_CONN_LATENCY)
    Dump(Tx):
    0000:01 61 FE 02 01 04                               .a....
    --------------------------------------------------------------------
    [10] : <Rx> - 11:50:13.259
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
     Status         : 0x01 (1) (FAILURE)
     OpCode         : 0xFE61 (GapInit_getPhyParam)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 01 61 FE 00                      ......a..
    --------------------------------------------------------------------
    [11] : <Tx> - 11:50:13.275
    -Type           : 0x01 (Command)
    -OpCode         : 0xFE61 (GapInit_getPhyParam)
    -Data Length    : 0x02 (2) byte(s)
     PHY            : 0x01 (1) (INIT_PHY_1M)
     ParamId        : 0x05 (5) (INIT_PHYPARAM_SUP_TIMEOUT)
    Dump(Tx):
    0000:01 61 FE 02 01 05                               .a....
    --------------------------------------------------------------------
    [12] : <Rx> - 11:50:13.275
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
     Status         : 0x01 (1) (FAILURE)
     OpCode         : 0xFE61 (GapInit_getPhyParam)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 01 61 FE 00                      ......a..
    --------------------------------------------------------------------
    [13] : <Rx> - 11:50:13.306
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
     Status         : 0x01 (1) (FAILURE)
     OpCode         : 0xFE61 (GapInit_getPhyParam)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 01 61 FE 00                      ......a..
    --------------------------------------------------------------------
    [14] : <Rx> - 11:50:18.702
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
     Status         : 0x01 (1) (FAILURE)
     OpCode         : 0xFE61 (GapInit_getPhyParam)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 01 61 FE 00                      ......a..
    --------------------------------------------------------------------


    As per logs, after GAP_DeviceInit the command GapInit_getPhyParam was tried for 3 times and the launchpad responded with status of Failure.
    Please let us know, if there are any changes required in the Host_test application of BLE4 in central configuration.

    Also, thanks for the information on the Host test application of BLE5 stack.




    Thanks and Regards,

    Akshay

  • Hi Akshay,

    Can you share the hex file you are using to run the test shown above? I have used the pre-generated hex file included in the SDK and was able to successfully initialize the ble4 host_test through btool:

    Are you building your own host_test project? If so, then could you share it with me, so i can try to reproduce the behavior you are seeing?

    Best Regards,

    Jan

  • Hi Jan,

    Yes, I'm able to initialize the ble4 host_test by loading thr pre-generated hex file.

    Also, after changing the Optimization level to 2-Global Optimizations in my host_test project, the board is working fine and able to initialize ble4 using Btool application.

    Thanks for your support.

    Best Regrads,

    Akshay

  • Hi Akshay,

    Thank you for sharing your solution! I will mark this thread as "Closed" for now. If you have any further questions or concerns, then feel free to open a new E2E thread and we would be more than happy to help!

    Best Regards,

    Jan