Failed to use periodic advertisement function on nRF5340dk

Hello, I am new to BLE and nrf zephyr programming. I am trying to flash periodic_adv and periodic_sync samples (https://github.com/nrfconnect/sdk-zephyr/tree/16bcaed54230e3d86aeaf2b2f1d47393967254fd/samples/bluetooth/periodic_adv) into my nrf5340dk. The build and flash process are successful. But when connected to terminal, I see the following log information and warning.

For periodic_sync, 

*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
Starting Periodic Advertising Synchronization Demo
Checking LED device...done.
Configuring GPIO pin...done.
[00:00:00.482,757] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.482,788] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
[00:00:00.482,818] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
[00:00:00.484,466] <inf> bt_hci_core: Identity: FC:49:49:27:11:81 (random)
[00:00:00.484,497] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x21fb, manufacturer 0x0059
[00:00:00.484,527] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x21fb
Scan callbacks register...success.
Periodic Advertising callbacks register...Success.
Start scanning...[00:00:00.486,907] <wrn> bt_hci_core: opcode 0x2041 status 0x01
failed (err -5)
 

And for periodic_adv, 

*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
Starting Periodic Advertising Demo
[00:00:00.459,564] <wrn> bt_hci_core: opcode 0x203a status 0x01
[00:00:00.459,594] <wrn> bt_hci_core: Controller does not support 'LE_READ_MAX_ADV_DATA_LEN'. Assuming maximum length is 31 bytes.
[00:00:00.461,120] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.461,151] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
[00:00:00.461,151] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
[00:00:00.462,799] <inf> bt_hci_core: Identity: FC:49:49:27:11:81 (random)
[00:00:00.462,829] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x21fb, manufacturer 0x0059
[00:00:00.462,860] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x21fb
[00:00:00.463,287] <wrn> bt_hci_core: opcode 0x2036 status 0x01
Failed to create advertising set (err -5)

I am using toolchain version 2.7.0 and SDK version 2.7.0. I am programming on Mac OS 14.7.1. I am building the project on non-secure manner. I assume this is because of the wrong configuration of the network core but not sure how to fix this. The same firmware is working on nrf52840dk without any problems. Any suggestions?

Many thanks

Parents
  • Hello,

    The reason this doesn't work out of the box for the nRF5340 is that it is missing some configurations for the network application when running on a 2 core chip (as you mentioned).

    Seeing as you are using NCS v2.7.0, you are either building using sysbuild or parent/child image builds. The way you add network core configurations depends on which one you are using. If you are not sure, please check your build log. If you are using child and parent image functionality, then you should see this a couple of times in your build log:

                ---------------------------------------------------------------------
                --- WARNING: Child and parent image functionality is deprecated   ---
                --- and should be replaced with sysbuild. Child and parent image  ---
                --- support remains only to allow existing customer applications  ---
                --- to build and allow porting to sysbuild, it is no longer       ---
                --- receiving updates or new features and it will not be possible ---
                --- to build using child/parent image at all in nRF Connect SDK   ---
                --- version 2.9 onwards.                                          ---
                ---------------------------------------------------------------------

    If you are using parent child image functionality (not recommended for future development), add a folder called child_image, and inside there, add a file called hci_ipc.conf. The file should contain:

    CONFIG_BT_BUF_ACL_RX_SIZE=251
    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_PER_ADV=y
    CONFIG_BT_PER_ADV_SYNC_TRANSFER_SENDER=y
    CONFIG_BT_PER_ADV_RSP=y

    And this is your folder structure:

    If you are using the new sysbuild, then you should add call this file ipc_radio.conf, and place it in a folder called "sysbuild" instead of "child_image". In addition, you need a couple of files to tell the sysbuild building system that you have an additional image. I copied them from the ncs\nrf\samples\bluetooth\peripheral_uart sample:

    additional files.zip

    (Kconfig.sysbuild and sysbuild.conf)

    To build using sysbuild, there is a checkbox in the bottom of VS code when you configure your build configuration. If you are using command line to build, add the argument "--sysbuild".

    Best regards,

    Edvin

Reply Children
No Data
Related