Softdevice - basic BLE advertising/transmission. Getting return error code 18 for ble_advertising_start() function

Hello,

I am using the nRF 52840 DK board. Using nRF5_SDK_17.0.2 I am trying to implement basic BLE advertising in my code. Also, I have turned on the RTT log. From the log, I can see I am getting error code 18 for the ble_advertising_start() function (as per forum discussion here, error code 18 is the NRF_ERROR_CONN_COUNT error, which could indicate that you are trying to start advertising while the previous connection is not properly closed. ). But in my code, I am not trying to start advertising again and again. Just starting once after boot. Can anyone help me why I am getting error code 18 here?

I am attaching my sdk_config.h file below:

Also attaching code file.

I am able to build the code but BLE is not getting advertised.

Output in the debug terminal is as shown below:

<info> app: nrf_sdh_enable_request 0
<info> app: nrf_sdh_ble_default_cfg_set 0
<info> app: nrf_sdh_ble_enable 0
<info> app: ble_stack_init done.
<info> app: sd_ble_gap_device_name_set 0
<info> app: sd_ble_gap_ppcp_set 0
<info> app: gap_params_init done.
<info> app: ble_advertising_init 0
<info> app: advertising_init done.
<info> app: ble_advertising_start 18
<info> app: advertising_start done.
<info> app: Ble tutorial started.

In the above debug terminal ble_advertising_start should be 0.

I am attaching the screenshot for your reference.

Am I doing anything wrong? Also, I am attaching a zip file of the code base.

Please help.

Thanks and regards,

Neeraj Dhekale

Related