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

Can a project be capable of doing both normal and extended advertising? I can't make this work

So I just got past the hurdle I had when trying to do extended advertising in the following support thread, and now I have a new problem along the same lines:

https://devzone.nordicsemi.com/f/nordic-q-a/81405/error-when-trying-to-enable-extended-advertising-on-code-based-on-nus-example

Now that I believe I can get extended advertising working, I set CONFIG_BT_EXT_ADV=y in my proj.conf file to start adding in code to do that, but before proceeding with the extended advertising firmware I wanted to double check to see if legacy advertising was still working with this CONFIG enabled - and it does NOT work.

Now i'm getting the same -5 return code error when I call bt_le_adv_start() that I got when trying to do extended advertising before.

I've gone back and forth a couple times now to make sure I'm not doing something else wrong, and if that CONFIG line is present, legacy advertising does not work. If it's not present, it does work (bt_le_adv_start returns 0 and I can see the device start advertising from the nRF Connect app on my phone).

Maybe the version of hci_rpmsg that gets loaded into the network core of the nRF5340 can only handle either extended advertising or normal but not both? What all changes when CONFIG_BT_EXT_ADV=y is in the .conf file?

The product I'm designing is supposed to be a generic Bluetooth interface device so my customer may send commands to enable either type of advertising, so I need to be able to turn on either one when commanded to.

Thanks,

Glen

  • Maybe I'm overrunning my stack or heap or something since I'm trying to do so many things in one project - normal advertising, extended advertising, scanning...  How do I determine if I'm overrunning, and how do I pick the correct sizes for heap, workqueue stack, log buffer etc?

  • Hi, 

    Have a look at my colleague's answer in this post

    Regards,
    Amanda

  • Just an update for anyone who has this issue - I finally figured out what to do to have a project that does both. Just enable extended advertising, and there is a flag you can either include or exclude from the options field of the bt_le_adv_param structure that you feed to bt_le_ext_adv_create called BT_LE_ADV_OPT_EXT_ADV. If it's included, you get extended advertising. If it's not, you get legacy advertising.

    I wish someone from Nordic had just been able to suggest this to me months ago, but that's firmware development for you.

Related