Issue Integrating Mesh with Broadcast Source and Central & Peripheral HR on nRF5340

Hello,

I am working on an nRF5340-based project where I successfully integrated the broadcast_source and central_and_peripheral_hr examples from SDK 2.6.0. Both functionalities are working correctly. However, when I try to add the mesh functionality, I encounter the following error:

[00:00:00.710,754] bt_hci_core: opcode 0x2036 status 0x07
[00:00:00.710,784] bt_mesh_pb_adv: Failed enabling advertiser
[00:00:00.710,845] bt_mesh_adv_ext: Mesh advertiser not enabled

I am using SDK 2.6.0 because SDK 2.9.0 did not work correctly with the broadcast_source example.

Additionally, I noticed that in the mesh_light_switch example, ipc_radio is used in the core network, whereas in the other examples, hci_ipc is used instead. Could this be a potential cause of the issue? If so, what would be the recommended approach to align these components correctly?

Do I need to make any specific configurations or modifications to enable the mesh advertiser properly in this context?

Thanks in advance for your support!

UPDATE

I have identified that the opcode 0x2036 - 0x07 error was caused by a lack of resources for ext advertise. I noticed that it was using hci_ipc (still on SDK version 2.6.0), so I modified the sysbuild.cmake to use the configuration file nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf (instead of nrf5340_cpunet_iso-bt_ll_sw_split.conf), adding:

CONFIG_BT_EXT_ADV_MAX_ADV_SET=10

With this configuration, the previous error disappeared. However, I am now encountering a new issue:

[00:00:00.681,488] <inf> bt_mesh_provisionee: Device UUID: 11bcda3f-1161-448b-ae43-25c0ee9e4b74
Mesh initialized
Failed to set periodic advertising parameters (err -134)

Do you have any insights on what might be causing this new error?

Thanks
  • Hi Amanda,

    Thank you for your response. Based on your indications, I decided to use the latest version 2.9.0 of the bap_broadcast_source project from zephyr/samples/bluetooth to ensure compatibility and take advantage of the most recent updates. Initially, I encountered an error but I modified the configuration in the 2.9.0 project to resolve it (disabling USB)

    From there, I started integrating the central_and_peripheral_hr example and adding Mesh functionalities. However, I am now facing an error in the same function call, but with a different error code opcode 0x2068 status 0x12:

    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    [00:00:00.305,267] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.305,297] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
    [00:00:00.305,297] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 3.7 Build 99
    [00:00:00.307,128] <wrn> bt_ecc: ECC HCI commands not available
    [00:00:00.307,250] <inf> bt_hci_core: Identity: F9:46:93:B3:2F:8E (random)
    [00:00:00.307,281] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x0000, manufacturer 0x0059
    [00:00:00.307,312] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0xffff
    Bluetooth initialized
    Load settings
    Scan for HR service peripheral
    Advertising started
    [00:00:00.540,832] <inf> bt_mesh_provisionee: Device UUID: 11bcda3f-1161-448b-ae43-25c0ee9e4b74
    Mesh initialized
    Initializing lc3 encoder for stream 0
    Creating broadcast source
    Creating broadcast source with 1 subgroups with 2 streams
    Initializing lc3 encoder for stream 1
    Starting broadcast source
    [00:00:00.564,483] <wrn> bt_hci_core: opcode 0x2068 status 0x12 str
    Unable to start broadcast source: -22

    I feel that we might be losing focus on the core issue of this ticket. Instead of discussing general configuration options, I believe we should concentrate on understanding the cause of this specific error I am now encountering.

    Additionally, I can share the project here in the ticket, along with the modifications made to the hci_ipc project to support Mesh networking. Let me know how you’d like to proceed.

    Thanks.
    ego_sim_broadcast_2.9.7z

    hci_ipc.7z

  • Hi, 

    From your sysbuild.cmake file, it seems the project would use the nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf for hci_ipc. You could try to add the following configs for hci_ipc:  

    CONFIG_BT_PER_ADV=y
    CONFIG_BT_MAX_CONN=10
    CONFIG_BT_CTLR_ADV_SET=10
    CONFIG_BT_EXT_ADV_MAX_ADV_SET=10
    
    # Zephyr Controller tested maximum advertising data that can be set in a single HCI command
    CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=191
    
    # Enable support for Broadcast ISO in Zephyr Bluetooth Controller
    CONFIG_BT_CTLR_ADV_ISO=y
    
    # Sufficient ISO PDU length for any BAP LC3 presets (155)
    CONFIG_BT_CTLR_ADV_ISO_PDU_LEN_MAX=155
    
    # Number of supported streams
    CONFIG_BT_CTLR_ADV_ISO_SET=1
    CONFIG_BT_CTLR_ADV_ISO_STREAM_MAX=2
    CONFIG_BT_CTLR_ADV_ISO_STREAM_COUNT=2
    CONFIG_BT_CTLR_ISOAL_SOURCES=2
    
    # Support the highest SDU size required by any BAP LC3 presets (155) + 8 bytes of HCI ISO Data
    # packet overhead (the Packet_Sequence_Number, ISO_SDU_Length, Packet_Status_Flag fields; and
    # the optional Time_Stamp field, if supplied)
    CONFIG_BT_CTLR_ISO_TX_BUFFER_SIZE=163

    Then, it would get the output like this on nRF5340DK:

    -Amanda H.

  • Hello Amanda,

    Sorry for my late reply.

    I tested your configuration and observed the same behavior you reported, but this is not the expected one. I mean, everything now seems to be configured correctly, but in the original bap_broadcast_source example, after the last log line, the application should start broadcasting data—which is not happening in this case.

    I have attached the correct behavior from the bap_broadcast_source example for reference.

    This "broadcasting" seems not starting in our project.

    Do you have any other useful suggestion?

    Thanks.

    Regards,

    Daniele

  • Please try to debug your project and find where it hangs. 

  • Hello Amanda,

    I did some test this morning and I found the following points:

    • to start the broadcasting there is a semaphore that is "given" in stream_sent_cb()
    • It seems that stream_sent_cb() is called just 6 times and it stops
    • No issue in init phase or other point apparently

    Do you know how stream_sent_cb() works? This function is assigned to this struct related to stream data.

    static struct bt_bap_stream_ops stream_ops = {
    	.started = stream_started_cb, .stopped = stream_stopped_cb, .sent = stream_sent_cb};

    Thanks for your support.

    Daniele

Related