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

nRF Connect SDK with Zephyr and VSC, error code in example "samples/bluetooth/periodic_adv"

Hi,

i'm absolute beginner with the nRF Connect SDK and Zephyr as well as BLE in general (to be true, this is my first project using any NORDIC device....). I installed the Connect SDK together with VSC and tried to get the example "samples/bluetooth/periodic_adv" running because this might be closest to the application which i must realize very soon.

I could build evertyhing and also connect and flash to my board which is the "nRF52 DK". I can even debug and connect the board by serial interface to the NRF Terminal - so everything looks great!

However, the sample itself does not work. By debugging i found that the function bt_le_per_adv_set_param(...) returns an error code of -134 and hence finally the advertising is not started.

What is wrong?

Any help is appreciated because i have been trying to get on the rails for 2 weeks - but so far without any success. I'm coming from STM32 devices (but never used BLE) and are doing all this since 25 years. i already start feeling like a senile old man because i never had such big trouble to start something new..

By the way - until now i could not find any documentation related to error codes returned by Zephir. Does anybody know where i can find a more detailed error listing?

Parents
  • Hello ,

    The errors documentation from Zephyr you can find here.

    The error in this case is about the parameters you are trying to set.

    Can you tell more about the board you have in hands? Is it an nRF52840DK?

    Which target did you configure for this project?

    Also, take a look at 's answer here.

  • Hi Thiago,

    thanks for trying to help me!

    I am using the "nRF52 DK" board which is assembled with an nRF52832.

    As target, i configured the "nrf52dk_nrf52832" because the "real nRF52DK" was not available.

    VSCode shows the "nRF52 DK (PCA10040)" in the list of connected devices, but it shows it as a sub-device (?) to something called 682354721, a number which is also on the label of the jlink processor on the board.

    i can connect the nRFTerminal to the board and also see the "printk" statements of the sample code. My only success up to now was, to change the printk output in a way that i better find it in the terminal output - this worked....

    I have configured to use SDK version 1.7.0 and to test the sampel code, i used the command in VSC "Create a new aplication from sample".

    I did not change anything else up to now.

    Regarding your link to Sigurds answer, here comes the good news. I added "CONFIG_BT_LL_SW_SPLIT=y" to the prj.conf and after that even deleted the hole build sub-directory to make sure that i have a clean build after that. Finally when i started debugging it seems to work everything......

    ...with the drawback that my smartphone Huawai P20 pro does not show the device in the nRF Connect Scanner. However, that could be maybe OK because my "Device Information" show that periodic advertisement as well as extended advertisement are NOT supported.
    Please suggest me a "next reading" for all that because, even when it is running now, it is not very satisfying to me. Just adding the define above has such an impact? What happened by that define? Does it change the Zephyr configuration and system or ist "just" an addition to the application code itself?
  • , if your smartphone does not support periodic advertising or extended advertising, then maybe you should try the peripheral BLE samples instead.

    As stated by , "Periodic advertising is not supported by the SoftDevice Controller today. You need to use the Zephyr Controller for that."

    What 'CONFIG_BT_LL_SW_SPLIT=y' does is to choose the Controller implementation (SoftDevice's or Zephyr's) to use. It stands for Bluetooth Link Layer Software Split. As you can se in this issue:

    The "split link layer" is a version of the BLE controller which is split into:

    • An upper, HW independent, LL (ULL)
    • A lower, thin, LL (LLL), which depends on the particular HW being used

    SoftDevice Controller does not support periodic advertising, meanwhile Zephyr BLE Controller does support. There are other features that SoftDevice Controller supports and Zephyr BLE Controller doesn't, like LLPM (Bluetooth® Low Latency Packet Mode).

    You can read the following documentations to get a better understanding on the 'CONFIG_BT_LL_SW_SPLIT' configuration. 

    Link 1 - BLE Controller

    Link 2 - Bluetooth stack architecture

Reply
  • , if your smartphone does not support periodic advertising or extended advertising, then maybe you should try the peripheral BLE samples instead.

    As stated by , "Periodic advertising is not supported by the SoftDevice Controller today. You need to use the Zephyr Controller for that."

    What 'CONFIG_BT_LL_SW_SPLIT=y' does is to choose the Controller implementation (SoftDevice's or Zephyr's) to use. It stands for Bluetooth Link Layer Software Split. As you can se in this issue:

    The "split link layer" is a version of the BLE controller which is split into:

    • An upper, HW independent, LL (ULL)
    • A lower, thin, LL (LLL), which depends on the particular HW being used

    SoftDevice Controller does not support periodic advertising, meanwhile Zephyr BLE Controller does support. There are other features that SoftDevice Controller supports and Zephyr BLE Controller doesn't, like LLPM (Bluetooth® Low Latency Packet Mode).

    You can read the following documentations to get a better understanding on the 'CONFIG_BT_LL_SW_SPLIT' configuration. 

    Link 1 - BLE Controller

    Link 2 - Bluetooth stack architecture

Children
No Data
Related