Bluetooth connexion issue

Hello community, 
I'm trying to implement BT service on my project to be able to connect with my phone 
for information my project displays data from sensors(BME280, INA219, MPU6050)  connected to my D-kit 
i'm using nrf connect V1.8.0 and NRF5340dk
i got inspired from this BT tutorial to create my services 
but in terms of BT connexion i don't get the device on my ophone when i scan devices around 
which means that connexion isn't established
and i got this message "Advertising failed to start (err-11)"
i will attach below my output display 

i tried to flash my D-kit directly but it didn't work 
and i tried to activate the BT but in vain too 
i tried to use this function


Can you guys help  by telling me what's wrong on this situation 
why can't i get the bt to advertise 
do i missing something on the main or on the activation 
by the way my prj.conf should be good and i will liked below
 


Can you help me with this please 
i will be very grateful 

  • I do not see anything obviously very wrong in the Bluetooth related code now (though there are a few other things worth noting for a different time). Does it build without warnings now? What happens runtime and what do you see when debugging?

    Note the code I posted before, which was basically your code just with the non-BLE part stripped out, and a few issues fixed. And that works fine. I recommend you to test it and compare with your won code. Or perhaps start with that, observe that it is working, and put back things from your original code gradually while checking that nothing breaks. That way I expect you will get this working quickly.

  • followed the same article. built the code. no warning. same output (err -11).

  • as usual, as soon as I post on a support forum, i find the solution in the next 3 minutes.

    the code produced a log that stated "[00:00:01.450,439] <inf> bt_hci_core: bt_init: No ID address. App must call settings_load()"

    which is weird, because in my conf file i have.

    CONFIG_SETTINGS=n

    Furthermore, nrf samples all have something like


    So I didn't put that in the code.

    Apparently calling settings_load is what the code was missing. probably the sample was written for an old version of zephyr.


    The complete main is:




    Apologies for the sloppy as hell code, I just copy pasted everything in the main.c.
1 2 3