This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ble_advertising_init error 7

NRF52 DK - SDK13.0 - ARMGCC - Eclipse

I am trying to add a custom service to the example ble_app_hrs.

I add all the part per the tutorial and end up getting error 7 on ble_advertising_init.

Per other answers, I tried changing the order of advertising_init and and services_init and they always come back as error 7 either way.

I noticed in ble_stack_init there was a line for

ble_cfg.common_cfg.vs_uuid_cfg.vs_uuid_count = 0

I changed that to 1 per another answer in the devzone.

Still error 7.

Should there be 4 of the memset(&ble_cfg... in the ble_stack_init in the hrs example? I would think memset being called several times for each instance would wipe out all the previous settings (I could be wrong).

I would appreciate it if someone could point me down the correct path to fix this error 7 in ble_advertising_init.

Bryan

Parents
  • Hi Bryan,

    Error codes to be found (or at least entry point to that) in components\softdevice\s132\headers\nrf_error.h, value 7 means NRF_ERROR_INVALID_PARAM. Going back to your mystic function ble_advertising_init residing in components\ble\ble_advertising\ble_advertising.c file you see that return value (status/error code) comes from line ret = ble_advdata_set(&m_advdata, p_srdata);. Finally by looking signature (header) of function ble_advdata_set in file components\ble\common\ble_advdata.h you see that indeed NRF_ERROR_INVALID_PARAM is thrown by Soft Device when you are trying to set invalid advertising parameters.

    So final question remains: what is going to that function and have you checked that against BT SIG Core spec (because that's the typical reason of assert in SD because some rules must be enforced)?

    Btw. you are saying which SDK version you use but this is clearly Soft Device API so you should be clear which flavor and version you use (that says in which API documentation you look for codes and functions, however this one is pretty easy because haven't changed for quite some time).

  • I am using SD 4.0.4. I fixed the error by commenting out the extra memset(&ble_cfg...'s that were in the SDK example and making sure that servies_init was called before advertising_init

Reply Children
No Data
Related