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. 

Parents
  • Hi, 

    Is it possible that dult_user_register is called somewhere else in your application?

    If the cur_user atomic_ptr is already set here, I guess that dult_user_register was called before in another place. It would be good to use the debugger and verify who called the function before Fast Pair.

    Regards,
    Amanda H.

  • Hi Amanda, 

    Thanks for your reply. Initially, I thought the same as you, but yesterday I checked that's the only time that the dult_user_register is called (by the dult_init function). I have just rechecked with the debugger. 

    However, I just noticed something weird when checking the log output that I included in my ticket. Even though, I see in the debugger that it fails when executing the dult_user_register function, I don't see the log associated in the output "LOG_ERR("DULT user already registered");. Therefore, I think that the dult_user_register is not failing and the debugger is glitching a bit. 

    The real problem seemed to be that in my application the battery level was not set before the enable operation. I just set it using bt_fast_pair_fmdn_battery_level_set and the issue is solved! 

    Thanks. 

    Best regards, 

    Francisco. 

Reply
  • Hi Amanda, 

    Thanks for your reply. Initially, I thought the same as you, but yesterday I checked that's the only time that the dult_user_register is called (by the dult_init function). I have just rechecked with the debugger. 

    However, I just noticed something weird when checking the log output that I included in my ticket. Even though, I see in the debugger that it fails when executing the dult_user_register function, I don't see the log associated in the output "LOG_ERR("DULT user already registered");. Therefore, I think that the dult_user_register is not failing and the debugger is glitching a bit. 

    The real problem seemed to be that in my application the battery level was not set before the enable operation. I just set it using bt_fast_pair_fmdn_battery_level_set and the issue is solved! 

    Thanks. 

    Best regards, 

    Francisco. 

Children
No Data
Related