Error when trying to enable Fast Pair related to the DULT

Hi, 

I am having some issues when trying to enable the Fast Pair when executing the bt_fast_pair_enable(). I used the debugger to determine where it's failing: 

if (!atomic_ptr_cas(&cur_user, NULL, (atomic_ptr_val_t)user)) {
        LOG_ERR("DULT user already registered");
        return -EALREADY;
    }

For some strange reason, cur_user is not set to NULL when initializing and therefore, there's this error. As a consequence, when resetting the DULT ID, it also fails because is_enable is set to false. This seems to work fine in Nordic's locator sample, but not in my custom code after integrating the locator sample, even though my code is really similar and I use the same DULT Kconfig related parameters in my project. Can someone tell me how to solve this? 

I: Settings loaded
I: Fast Pair: RPA expired
W: Fast Pair: cannot get random RPA timeout (rc: 0). Used fixed value
I: Fast Pair: setting RPA timeout to 780 [s]
I: Fast Pair: prepared the advertising set
E: FMDN: Battery: battery level unset before the enable opeartion
E: DULT ID: is not enabled
E: dult_id_reset returned an error: -120
E: FMDN: dult_reset returned error: -120
E: modules_init returned error -22
E: FMDN: bt_fast_pair_enable failed, rc = -22
E: Failed - to init fast pair, err=-22

Thank you. 

Best regards,

Francisco. 

Related