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

Bluetooth split stack issues with nRF91 and nRF52 in NCS

Hi,

I am trying to build a simple example that will run nRF91 as BLE host and nRF52 as BLE controller in the latest stable NCS 1.4 and nRF9160DK 0.8.2. However, I have encountered two issues.

My sample for nRF91 won't communicate with HCI UART driver flashed to nRF52840 on nRF9160DK.

This is what I get from the log.

00> *** Booting Zephyr OS build v2.4.0-ncs1-5-g1664f186a309  ***
00> 
00> [00:00:00.000,274] <inf> main: Bluetooth trying to init
00> [00:00:00.002,868] <inf> fs_nvs: 2 Sectors of 4096 bytes
00> [00:00:00.003,143] <inf> fs_nvs: alloc wra: 0, ff0
00> [00:00:00.003,387] <inf> fs_nvs: data wra: 0, 0
00> [00:00:00.610,656] <wrn> bt_hci_core: OpCode 0x0000 completed instead of expected 0x0c03
00> [00:00:00.611,053] <wrn> bt_hci_core: opcode 0x0c03 status 0xc0
00> [00:00:00.611,358] <err> main: Bluetooth init failed (err -5)

Steps to reproduce:

  1. Build HCI UART from ncs/zephyr/samples/bluetooth/hci_uart and flash it to nRF52840 on nRF9160DK
  2. Build my sample code from https://github.com/lukasbrchl/nrf91_bluetooth_host and flash it to nRF9160 on nRF9160DK
  3. Restart DK and observe the error

The weird thing is that when I use the prebuilt hci_uart.hex file from this thread. Then it works without any problem. Even when I try to build and flash the LTE BLE Gateway sample, then it also initializes Bluetooth without problems.

Bluetooth MAC address is not kept static after reset in the split stack

Steps to reproduce:

  1. Flash the prebuilt hci_uart.hex file from this thread to nRF52840 on nRF9160DK
  2. Build my sample code from https://github.com/lukasbrchl/nrf91_bluetooth_host and flash it to nRF9160 on nRF9160DK
  3. Observe in nRF Connect on a mobile phone that MAC address changes on each restart.

It was already discussed in this thread. Since I cannot get working the hci_uart sample (first issue) I cannot experiment in adding additional settings/configs. 

Please let me know your thoughts.

Parents Reply Children
  • Hi Simon,

    ok, looking forward to your thoughts. Yesterday, I was again inspecting it for a few more hours but haven't been able to find the issue.

    Lukas

  • I tried to inspect some yesterday, and I had to go back all the way to NCS v.0.3.0 to find a hci_uart that worked with your sample. However, in that version of NCS, west was not introduced yet, which makes it hard to work with.

    I will investigate more today/tomorrow.

  • Try setting CONFIG_BT_WAIT_NOP=y in the prj.conf of your project (https://github.com/lukasbrchl/nrf91_bluetooth_host). I tested it just now and it solved the issue.

    Best regards,

    Simon

  • Oh man! I took this one from our main application where we have CONFIG_BT_WAIT_NOP=n and it was working. And I have probably overlooked trying to set this one to y as it is in the LTE BLE Gateway sample. Sorry about that.

    So the first issue is now fixed, thanks a lot. Now to the second one, I am still unable to have a static mac address kept on the nRF9160 host after reset.

    Steps to reproduce:

    1. Flash the hci_uart sample to nRF52840 on nRF9160DK
    2. Flash my simple sample code from https://github.com/lukasbrchl/nrf91_bluetooth_host to nRF9160 on nRF9160DK
    3. Observe in nRF Connect on a mobile phone that MAC address changes on each restart.

    Log from nRF9160 host:

    00> [00:00:00.000,274] <inf> main: Bluetooth trying to init
    00> [00:00:00.002,929] <inf> fs_nvs: 2 Sectors of 4096 bytes
    00> [00:00:00.003,204] <inf> fs_nvs: alloc wra: 0, fd8
    00> [00:00:00.003,479] <inf> fs_nvs: data wra: 0, 1c
    00> [00:00:00.600,616] <wrn> bt_hci_core: opcode 0x0000 pool id 5 pool 0x20010580 != &hci_cmd_pool 0x20010558
    00> [00:00:00.621,856] <wrn> bt_hci_core: ECC HCI commands not available
    00> [00:00:00.622,161] <inf> bt_hci_core: No ID address. App must call settings_load()
    00> [00:00:00.622,528] <inf> main: Bluetooth initialized
    00> [00:00:00.624,877] <inf> bt_hci_core: Identity: fd:2a:5f:e1:bf:c6 (random)
    00> [00:00:00.625,244] <inf> bt_hci_core: HCI: version 5.2 (0x0b) revision 0x1123, manufacturer 0x0059
    00> [00:00:00.625,671] <inf> bt_hci_core: LMP: version 5.2 (0x0b) subver 0x1123

    From my point of view, the host expects the MAC address from the nRF52 controller, but don't get it. I also tried to set some configs in the controller but it doesn't work (and it doesn't make sense).

    Configs added in hci_uart sample that won't help.

    CONFIG_BT_SETTINGS=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    

    I think this is a bug somewhere and I am unable to debug it further. It would really help us if you could also inspect this one.

     

  • I tried to investigate this a little, and think I made some progress. The value of id_addr->a was consistent and always the same after each reset. However, the value of addr changed every time, and this value was equal to the one I saw in the nRF Connect Mobile phone app. I'm not sure why this is. Maybe because the variable is stored inside a local scope or something? I did not get time to get any further today, but will continue tomorrow. Maybe you are able to figure this out?

    Best regards,

    Simon

Related