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

Advertising startup fails with status 0x03

Hello, I've tried the "smp_svr" sample from the nRF Connect SDK on my new nRF52832 boards because I wanted to test Bluetooth advertising and DFU capability. They compile and flash successfully, but unfortunately, the board doesn't start the advertiser, giving me the following error in the serial console:

[00:00:00.524,047] <dbg> bt_hci_core.bt_buf_get_cmd_complete: sent_cmd 0x200059e0
[00:00:00.524,078] <dbg> bt_ctlr_hci_driver.cmd_handle: Replying with event of 6 bytes
[00:00:00.524,078] <dbg> bt_hci_core.hci_cmd_complete: opcode 0x200a
[00:00:00.524,078] <dbg> bt_hci_core.hci_cmd_done: opcode 0x200a status 0x03 buf 0x200059e0
[00:00:00.524,108] <dbg> bt_ctlr_hci_driver.hci_driver_send: exit: 0
[00:00:00.524,108] <dbg> bt_hci_core.process_events: ev->state 0
[00:00:00.524,108] <dbg> bt_conn.bt_conn_prepare_events:
[00:00:00.524,139] <dbg> bt_hci_core.hci_tx_thread: Calling k_poll with 2 events
[00:00:00.524,139] <wrn> bt_hci_core: opcode 0x200a status 0x03
[00:00:00.524,169] <err> bt_hci_core: Failed to start advertiser

I've also tried the "scan_adv" sample, which seems to be working correctly as I can see the board on the nRF Connect app, so I tried the "peripheral" sample, but alas, it gives me the same error. I also tried the same on an identical, unopened board, to no avail. 

Parents Reply
  • Hi,

    I am not able to reproduce this using the smp_svr sample (zephyr\samples\subsys\mgmt\mcumgr\smp_svr) from NCS 1.3 and testing on a DK. I build and flash like this, and the device advertises without any problems:

    west build -b nrf52dk_nrf52832 --pristine
    west flash

    Can you explain in detail how you build and flash the sample? Do you test on a DK or custom board? If a custom board, does it work if you test on a DK instead (to narrow down the issue)?

Children
  • EDIT: I solved the problem. See the solution in another comment.

    Hello, I'm testing on a custom board, the last time I used the following commands (nrf52832_brd is my custom board definition, which I based on the DK):

    nrfjprog -e
    west build -b nrf52832 -p
    west flash

    Unfortunately, I do not have access to a DK currently, but I've been able to successfully start advertising by calling bt_le_adv_start twice, like this (I used the "peripheral" sample because it's easier to compile and debug, as it doesn't require MCUboot):

    bt_le_adv_start(BT_LE_ADV_CONN_NAME, ad, ARRAY_SIZE(ad), NULL, 0);
    err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, ad, ARRAY_SIZE(ad), NULL, 0);
    if (err) {
        printk("Advertising failed to start (err %d)\n", err);
        return;
    }

    The second time, it starts advertising and I can see the device in nRF Connect. Unfortunately, when I try to connect to the device, it quickly disconnects with the error "Disconnected (reason 0x08)", and it keeps trying to connect until I manually cancel it, as shown in the log:

    *** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
    Bluetooth initialized
    [00:00:00.006,286] <inf> fs_nvs: 6 Sectors of 4096 bytes
    [00:00:00.006,286] <inf> fs_nvs: alloc wra: 0, fc0
    [00:00:00.006,286] <inf> fs_nvs: data wra: 0, 4c
    [00:00:00.007,720] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.007,720] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    [00:00:00.007,720] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 2.3 Build 0
    [00:00:00.007,995] <inf> bt_hci_core: No ID address. App must call settings_load()
    [00:00:00.010,559] <inf> bt_hci_core: Identity: df:36:63:1e:83:34 (random)
    [00:00:00.010,589] <inf> bt_hci_core: HCI: version 5.2 (0x0b) revision 0x0000, manufacturer 0x05f1
    [00:00:00.010,589] <inf> bt_hci_core: LMP: version 5.2 (0x0b) subver 0xffff
    Advertising successfully started
    [00:00:00.515,716] <wrn> bt_hci_core: opcode 0x200a status 0x03
    [00:00:00.515,747] <err> bt_hci_core: Failed to start advertiser
    Connected
    Disconnected (reason 0x08)
    Connected
    Disconnected (reason 0x08)
    Connected
    Disconnected (reason 0x08)
    Connected
    Disconnected (reason 0x08)

  • Nevermind, I solved the problem! After looking up the disconnection error message online, I found out that it was a problem with the clock. I changed it to the internal RC oscillator, changed the accuracy, and it now works perfectly (just set CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC and CONFIG_CLOCK_CONTROL_NRF_K32SRC_250PPM). Thanks for your help.

Related