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.

CC2652R7: Adding mesh stack to central/peripheral configuration

Part Number: CC2652R7
Other Parts Discussed in Thread: SYSCONFIG

I am trying to add a mesh proxy client ability(i.e. act as a central) to a project configuration that already acts as a BLE peripheral.

As a mesh proxy client central I want to scan for, connect to the mesh proxy and send and receive data on the UUID1828 mesh service characteristics.

To achieve this, I have tried to add the Mesh property in the sysconfig dialogue, but this changes my setup as "central/peripheral"  to "peripheral/observer" so this does not seem supported.

My next attempt has been to add the necessary files from the mesh folder (inside the ti installation folder) to my project, but it is quite hard to get just a few of the files as they are all part of a larger stack with plenty of dependencies/needed configuration files etc.

In addition to this, it seems that the Mesh stack is based on Zephyr (and my legacy peripheral project isn't).

So, how do you propose for me to continue? I need to be act as both a central and a peripheral and still have access to the mesh stash at least to be able to fulfill the encryption, segmentation etc standards of the mesh protocol.

Any help appreciated.

Regards,

/Ola

  • Hello Ola,

    I would suggest looking at the multi_role example (<SDK>\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\multi_role) and port the simple_mesh_node example functionalities to it (<SDK>\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\simple_mesh_node).

    We also have training material on TI Bluetooth Mesh Fundamentals here, that could be useful.

    Hope it helps,

    David.

  • Thanks for your response.

    However, as far as I can tell, the simple_mesh_node example handles a statically provisioned mesh node, not a mesh proxy client.

    I do understand that your examples are useful for developing the actual mesh nodes, but as I tried to explain, I am developing the mesh proxy client, not the mesh node itself.

    I did use the multi role example for enabling both central and peripheral behaviour, but as I explained, I cannot have this defined and still use the mesh stack.

    Any other help or pointers greatly appreciated.

    Regards,

    /Ola

  • Hello Ola,

    It is possible to do peripheral + central + mesh relay, and you would have to take the mesh example as reference (which is based on peripheral + mesh) and modify the peripheral portion to be peripheral + central. This will indeed require additional efforts to modify the code.

    Regarding the provisioned mesh, I would suggest to take a look at this material.

    I am still reviewing what other path could be consider here.

    Let me know if it helps please.

    David.

  • Again, thank you for your effort.

    However, in my use case the Mesh nodes I am interfacing are already provisioned, so provisioning is not an issue.

    As a central proxy client, I do need to have access to the mesh stack since the proxied group messages from the mesh network must be decrypted and unsegmented according to the mesh standard.

    In my understanding, the only way to get access to the TI Mesh stack is to check the Mesh checkbox in sysconfig but when I do this, the BLE Device Role is changed, no longer featuring the Central role I need.

    Also, when building the mesh examples, the code footprint is huge, so I do not need the full stack, rather just the encryption/decryption/segmentation.

    I am quite aware of the Mesh mechanism so you really don't need to send any further links that explain it. The Mesh profile BLE spec covers it all.

    Regards,

    /Ola

  • Hello Ola,

    Understand.

    Currently we do not have any example that supports that implementation.

    However we could assist you in specific questions you may have while implementing it on your side.

    BR,

    David.

  • Some help would be greatly appreciated.

    I've managed to isolate a number of files needed in order for client mesh handling to work sufficiently but am getting a number of build warnings that I can't seem to get rid of.

    Files added from the mesh stack:

    utils

    aes_ccm

    cmac_mode

    simplelink_crypto

    buf

    crypto

    Also added the required include folders and the following set of defines:
    CONFIG_BT_MESH_PROXY
    CONFIG_BT_MESH_SUBNET_COUNT=2
    CONFIG_BT_MAX_CONN=2
    CONFIG_BT_MAX_PAIRED=2
    CONFIG_BT_MESH_MODEL_GROUP_COUNT=2
    CONFIG_BT_MESH_MODEL_KEY_COUNT=1
    CONFIG_ATOMIC_OPERATIONS_BUILTIN
    CONFIG_BT_MESH_TX_SEG_MAX=5
    BT_MESH_TX_SDU_MAX=30
    ZEPHYR_KERNEL_BUILD
    CONFIG_ARM

    Functions I am using include:
    bt_mesh_subnet_add

    bt_mesh_subnet_get

    bt_mesh_net_encode

    bt_mesh_net_decode

    bt_ccm_decrypt

    The build warnings I am getting:

    C:/ti/simplelink_cc13xx_cc26xx_sdk_6_41_00_17/source/ti/mesh/zephyr/include\kernel.h:84:9: warning: 'z_tick_get' macro redefined [-Wmacro-redefined]
    #define z_tick_get k_uptime_get
    ^
    C:/ti/simplelink_cc13xx_cc26xx_sdk_6_41_00_17/source/ti/mesh/zephyr/include\sys_clock.h:200:9: note: previous definition is here
    #define z_tick_get() (0)

    Any help greatly appreciated.

    Regards,

    /Ola

  • During the day, a new related problem has turned up.

    Using the encryption/decryption mesh files works well, using the BLE stack only as central, but when also using the peripheral BLE role, the BLE stack seems to get corrupted, at least if it connects as peripheral after using the encryption mechanisms.

    Working scenario is:

    Bond with peripheral app (as peripheral role) - works. Peer address correct every time

    Connect with proxy server (as central role)- works

    Encrypt and send whitelist message. Start receiving notifications- works

    Not working scenario is:

    Connect with proxy server (as central role)- works

    Encrypt and send whitelist message. Start receiving notifications- works

    Bond with peripheral app (as peripheral role) - does not work.

    When checking the peer address from the connection, it is all garbled data and gives a separate address each connection attempt.

    Now, if I remove the call to the function that creates the whitelist message using the encryption mesh functions, I can connect to both central and peripheral again.

    Thus I suspect that the mesh files somehow corrupts the execution context of the BLE stack.

    Any ideas how to pinpoint this? I assume that I am missing some important properties of how the mesh stack is supposed to be setup.

    Regards,

    /Ola

  • Hello Ola,

    For the first issue, have you been able to locate the files where #define z_tick_get is defined? It seems there is a definition conflict in sys_clock.h and kernel.h. Can you look for these files and see if at some point there should be a #if () to select to use one or the other? So that both are not build together.

    Do you have a Bluetooth sniffer to understand better what is happening over the air during peripheral bonding?

    Could you please specify where/how you are erasing the whitelist message?

    Some code-snippets of what you are modifying and consider that could provide more hints could help, if its possible to share.

    BR,

    David.

  • Hello Ola,

    For the first issue, have you been able to locate the files where #define z_tick_get is defined? It seems there is a definition conflict in sys_clock.h and kernel.h. Can you look for these files and see if at some point there should be a #if () to select to use one or the other? So that both are not build together.

    Do you have a Bluetooth sniffer to understand better what is happening over the air during peripheral bonding?

    Could you please specify where/how you are erasing the whitelist message?

    Some code-snippets of what you are modifying and consider that could provide more hints could help, if its possible to share.

    BR,

    David.