This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

sd_ble_gattc_primary_services_discover return NRF_ERROR_BUSY

Hi

sd_ble_gattc_primary_services_discover() is being called from ble_db_discovery_start() within ble_db_discovery.c. I'm trying to get the ble_cts_c service working. It works ok the first time after erasing and flashing the device, but every subsequent debugger run gives me NRF_ERROR_BUSY from this function. Based on that I'm guessing it's something to do with whitelisting, but I don't understand whitelisting well enough to debug it at this point.

EDIT: I've looked at the arguments to sd_ble_gattc_primary_services_discover() on both the runs that succeed (directly after flashing) and fail (all other runs). The arguments are the same in both cases, so that's not the problem.

Thanks nRF52832 PCA10040 SDK13 S132

  • seems like the previous discovery start procedure has not completed before you start the second. You have to check why the first call have not returned with any return value.

  • On the first run after being flashed (the successful runs, provided I don't interrupt everything with debugging), sd_ble_gattc_primary_services_discover() returns NRF_SUCCESS.

    Regardless of whether or not this function returns, why would it affect the device after a power cycle unless it's storing something permanently in flash? Or, I've forgotten to memset() some struct to zero before using it, and somehow values from the previous run are still stored. But I believe I'm zero initializing all structs to zero where needed.

Related