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

Parents
  • Hi

    In your screenshot you are not using the fastest possible advertising interval. To do that you should configure the periodic advertising parameters using the BT_GAP_PER_ADV_MIN_INTERVAL define, instead of the BT_GAP_PER_ADV_FAST_INT_MIN_1 define. 

    I tried to get this working myself, and I am able to get a reliable transfer when I update the advertise data every 40ms:

    sequence_test_per_adv.zip

    The example I shared shows an example of implementing a sequence number, allowing me to identify retransmitted packets easily, and also detect when packets are lost. 

    Packet loss is not great when transmitting audio, but any wireless application is susceptible to packet loss, and this is something you need to handle somehow in the application. 

    Best regards
    Torbjørn

  • Hello,

    thank you very much, good job,great!

    If NCS can support each packet sending finished  will have a callback(without bt_le_ext_adv_stop and restart),

    it is best to bt_le_per_adv_set_data().itcan reduce duplicate data.

         

    your codes can send 20 valid data per second, send 100byte at a time will be reached 2kByte/s;

    but now less than 30 bytes at a time.

    i've add config to prj.conf
    # Allow for large Bluetooth data packets.
    CONFIG_BT_L2CAP_TX_MTU=252
    CONFIG_BT_BUF_ACL_RX_SIZE=256

    if set greater than 30, periodic_sync will can't recv data.

       

    thanks

    Best Regards

  • Hi 

    yoyou said:

    If NCS can support each packet sending finished  will have a callback(without bt_le_ext_adv_stop and restart),

    it is best to bt_le_per_adv_set_data().itcan reduce duplicate data.

    What is most important to you? To avoid duplicate data or to avoid packet loss?

    If you only send each packet once you will have much higher packet loss than if you send each packet multiple times, and this will surely have a negative impact on the user experience. 

    I can try to figure out if there is an easier way to detect duplicate packets on the receive side, so you don't have to do this manually. 

    yoyou said:
    i've add config to prj.conf
    # Allow for large Bluetooth data packets.
    CONFIG_BT_L2CAP_TX_MTU=252
    CONFIG_BT_BUF_ACL_RX_SIZE=256

    if set greater than 30, periodic_sync will can't recv data.

    If you increase the CONFIG_BT_CTLR_ADV_DATA_LEN_MAX parameter on the advertiser side you should be able to send longer advertise packets. I tested this myself by setting CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=202, and was able to send 200 byte long packets (200 bytes of data + 2 bytes of manufacturer ID).

    If you send a 200 byte payload every 50ms you should get 4 kByte/s easily. 

    Best regards
    Torbjørn

  • Hi,

    thank you very much,

    avoid packet loss  is most important to me.

    I can try to figure out if there is an easier way to detect duplicate packets on the receive side, so you don't have to do this manually. 

    that is great!

    If you send a 200 byte payload every 50ms you should get 4 kByte/s easily. 

    it is so good!

    but when i add CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=202 two side or only adv side prj.conf bese on your project.   sync side can't recv data,maybe I'm missing something?

       

    Best Regards

Reply
  • Hi,

    thank you very much,

    avoid packet loss  is most important to me.

    I can try to figure out if there is an easier way to detect duplicate packets on the receive side, so you don't have to do this manually. 

    that is great!

    If you send a 200 byte payload every 50ms you should get 4 kByte/s easily. 

    it is so good!

    but when i add CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=202 two side or only adv side prj.conf bese on your project.   sync side can't recv data,maybe I'm missing something?

       

    Best Regards

Children
  • Hi 

    yoyou said:

    I can try to figure out if there is an easier way to detect duplicate packets on the receive side, so you don't have to do this manually. 

    that is great!

    I checked with the team, and it seems the SoftDevice controller doesn't support this feature unfortunately. In other words it is necessary to check this manually, like I do in the example I sent. 

    yoyou said:
    but when i add CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=202 two side or only adv side prj.conf bese on your project.   sync side can't recv data,maybe I'm missing something?

    You only have to add this to the advertiser, the scanner will already be set up to support reception of long packets. 

    Do you see any error messages in the advertiser or scanner that could explain why you don't receive anything?

    Best regards
    Torbjørn

  • Hi,

    thanks for reply,  you work carefully!

    i delete it and rebuild,it work fine,can recv 202 byte,good!

    now,

    First question:

    i want 

    Create a non-connectable non-scannable DIRECTED advertising set
    Only some devices can receive data.
    how to do it?
    if Peer address set to not NULL, periodic_sync will can't recv.
    maybe periodic_sync  side also need set Peer address?
            
    Second question:
    how to set max TX power and max GIAN  for long rang  (without nRF21540) ?

                  

    thanks

    Best regards

  • Hi 

    yoyou said:
    Create a non-connectable non-scannable DIRECTED advertising set
    Only some devices can receive data.
    how to do it?

    This is not supported in the Bluetooth specification unfortunately. Periodic advertising can not be directed. 

    yoyou said:
    how to set max TX power and max GIAN  for long rang  (without nRF21540) ?

    Do you need to set the power statically or dynamically?

    There is a sample in Zephyr showing how you can set the TX power for Bluetooth applications:
    https://docs.zephyrproject.org/2.6.0/samples/bluetooth/hci_pwr_ctrl/README.html

    Best regards
    Torbjørn

  • Hi,

    thanks for reply,

    Do you need to set the power statically or dynamically? 

    i want to set maximum statically only.

       

    Best regards

  • Hi

    Sorry for the slow response, I have been out of office for the last couple of weeks. 

    If you are using the Zephyr controller you can set the static output power by using the BT_CTLR_TX_PWR configuration settings, as described here.

    If you are using the Nordic SoftDevice controller these configurations don't work, and the only way to change the TX power is to do it like in the hci_pwr_ctrl sample I shared earlier.

    Best regards
    Torbjørn 

Related