This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error when trying to enable extended advertising on code based on NUS example

Hi,

I'm working on an nRF5340 project using nRF Connect SDK v1.7.0 with VS Code. I started my project with the NUS example.

I've been able to customize the standard/legacy advertising packets as required by my customer with no problem using bt_le_adv_start(), but they also want me to be able to use extended advertising in certain circumstances.

In order to do that I see that I have to not only switch to calling bt_le_ext_adv_start, but also create an advertising set using bt_le_ext_adv_create. I found an example that does that for reference (iso_broadcast), but when I call bt_le_ext_adv_create I get a -5 return code (-EIO).

The full sequence of calls is bt_le_ext_adv_create calls le_ext_adv_param_set, which calls bt_hci_cmd_send_sync(BT_HCI_OP_LE_SET_EXT_ADV_PARAM, buf, &rsp);

The send_sync function gets a 1  from this call: status = cmd(buf)->status;

That causes the function to send the -5 back up the chain.

What am I doing wrong?

Thanks,

Glen

  • I tried to use your code in hr_coded example and adding settings or BT_LE_EXT_ADV_NCONN_NAME in bt_le_ext_adv_create passes normally. Not sure what else is different in your setup but i cannot find anything that is relevant to this issue to be different than your code snippet and this hr_coded exampe  

  • Will your example work on my nRF5340 eval board where I could debug it?

  • i used 5340 DK, so not sure why you are seeing any difference.  Have you run the hr_coded example (unedited) on your eval board? does it run normally?

  • I just tried it and I get the same error from bt_le_ext_adv_create. I'm using VSCode with SDK 1.7.0. The newer SDK isn't supposed to have any relevant changes but I guess I could upgrade and see what happens.

  • I upgraded to all the latest stuff and I get the same thing... at line 83 of main.c in the create_advertising_coded function I get -5 back from bt_le_ext_adv_create().

1 2 3