NCS1.9.0 or NCS1.9.1 periodic_adv work error in nRF5340-DK

Hello,

NCS1.9.0 or NCS1.9.1,  Windows10 X64,VS Code,periodic_adv.default codes

with nRF52840-DK work fine.

but nRF5340-DK got error,as folow logs

"Failed to create advertising set (err -5)"

*** Booting Zephyr OS build v2.7.99-ncs1  ***
Starting Periodic Advertising Demo
Failed to create advertising set (err -5)
[00:00:00.283,355] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.283,355] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
[00:00:00.283,386] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 14.50663 Build 1008232294
[00:00:00.286,712] <inf> bt_hci_core: Identity: C7:71:77:EB:8D:C1 (random)
[00:00:00.286,712] <inf> bt_hci_core: HCI: version 5.2 (0x0b) revision 0x22fe, manufacturer 0x0059
[00:00:00.286,712] <inf> bt_hci_core: LMP: version 5.2 (0x0b) subver 0x22fe
[00:00:00.289,093] <wrn> bt_hci_core: opcode 0x2036 status 0x01

  

thanks

Best Regards

  • Hi,

    my project directed advertising low quality audio(2kByte/s), One-way communication,no reply.

    Because need to send continuous audio data, so prepare the next data in sent function. 

    data must be send one by one,

    it means :

    send next data at finshed last data sending,

    not at timeout.

    as:

    i'll periodic_adv send "123456789",  three bytes are sent at a time.

    1.bt_le_per_adv_set_data("123")

    2.when "123" send finshed, in sent() function

       bt_le_per_adv_set_data("456")

    3.when "456" send finshed, in sent() function

       bt_le_per_adv_set_data("789")

     

    Make sure periodic_sync receives correctly "123456789".

    Error received:

    "123123456789"

    "456123789"

    "789123"

    "123789"

    You know what I mean?

      

    thanks

    Best Regards

  • Hi

    Most likely you need to include some kind of sequence counter in the payload, so that the receiver knows when it is receiving a repeated payload, and when it is receiving new data. Then the receiver should be able to assemble the data in the right order, and also recognize if it has lost some packets completely (if the sequence number suddenly increases by more than one). 

    The sequence number is essentially just a counter that you increment every time you are updating the payload with new data. 

    Best regards
    Torbjørn

  • Hi,

    thanks for reply,

    I know how to do the project of ble_app_uart in nRF SDK,

    but i do not know how to do in periodic_adv/sync NCS.

    i just want to get a callback when send one data finished,

    and then immediately modify it to the next data for next advertising.

    why is it difficult to achieve? NCS1.9 not support it at all.

     

    Best Regards

  • Hi 

    I made some modifications to the periodic_adv sample in order to do this:

    285510_periodic_adv.zip

    Essentially I configure the sent callback, start advertising with a 3 second timeout, and reconfigure the data every time the sent callback occurs. 

    Please note that I don't update the advertising directly in the sent callback, instead I use a semaphore to signal to the main loop that the advertising is ready to be restarted. 

    Best regards
    Torbjørn

  • Hello,

    thanks for help,

    my project is directed advertising low quality audio2kByte/s),

    One-way communication,no reply. need to send continuous audio data. 

    i've try 500ms,when timeout less than 500ms periodic_sync can't recv data.

    Send data at least 20 times per second, 100 bytes each time,timeout must set 50ms. so

    your approach doesn't seem to achieve (2kByte/s), 

    whether nRF5340DK or nRF52840DK.

     adv_sync_nRF5340DK_cpuapp_config.rar

      

    Best Regards

Related