help getting a BLE end to end application working

I am trying to get an end to end BLE application working. I have an nRF52832 board that is running peripheral_uart. It is advertising and sending a text stream to the connected device. If I run "nRF Toolbox" on my iPhone I can connect to the nRF52832 and see the BLE strings come across every N seconds as setup in my program. I have a nRF9160DK board that I want to be able to see the BLE text strings in the nRF52840 on the nRF9160DK board and send those strings to the nRF910 on the nrf9160DK board.

I am using samples/hci_uart in the nRF52840 and samples/central_uart in the nRF9160.. I have not looked at BLE in a very long time so I may have the wrong programs. Are these the correct projects to create an end to end BLE application?

first I want to connect to my advertising device and see the notifications with the text strings in the nRF52840. is hci_uart the correct program? I have made no changes in this program except to print a message on startup. I can build and flash into the RF52840 (SW10 set to nRF51) but I do not see anything printing on any of the 3 created COM ports and I do not see a connection on my advertising device. It is still advertising and not connected to anything.

second I want to get the strings from the nRF82840. I am running the central_uart in the nRF9160 (SW10 set to nRF91). I do see startup messages as show below but it keeps rebooting with a timeout as shown below

*** Booting nRF Connect SDK v2.5.0 ***
Starting central_uart
Passed register authorization callbacks.
Passed register authorization info callbacks.
ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:338
command opcode 0x0c03 timeout with err -11

*** Booting nRF Connect SDK v2.5.0 ***
Starting central_uart
Passed register authorization callbacks.
Passed register authorization info callbacks.
ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:338
command opcode 0x0c03 timeout with err -11

This is for an end to end production system so any help you can give to get BLE strings from my nRF52832 to the nRF9160 would be greatly appreciated.

  • Hi Timothy,

    Have you got any NRF91 sample working? Have you got the connection to the cloud ? Did you provide a compatible SIM card to the board. Please complete our course here if you haven't : https://academy.nordicsemi.com/courses/cellular-iot-fundamentals/

  • The nrf91 sample lte_ble_gateway is working. I have a nRF Cloud account. I have created a LTE device that has the Device ID and PIN from the nRF9160DK board. I do run the program on the nRF9160 and I see 2 messages printed out in red as shown below. I see LED 4 lit that says I a connection to the nRF Cloud. The next step says I should see the device connected in nRF Cloud. I do NOT see that. so I am much closer but still not connecting to my device in the cloud and not connecting to my nRF52832 that is advertising.

    1. what do the 2 messages in Red mean?

    2. how do I make the connection to my device? What am I missing?

    3. how do I connect to my advertising nRF52832 board running hci_lpuart?

    4. how do I receive the strings being sent when there is a connection?

    thank you for your help this is for a production system that needsto send strings from nRF52832 over BLE to the cloud.

    *** Booting nRF Connect SDK v3.0.2-89ba1294ac9b ***
    *** Using Zephyr OS v4.0.99-f791c49f492c ***
    LTE Sensor Gateway sample started Version: 0.1 Date: 10/30/25
    [00:00:00.377,777] <inf> lte_ble_gw: Initializing Bluetooth..
    [00:00:00.626,281] <inf> lte_ble_gw: Establishing LTE link (this may take some time) ...
    [00:00:01.144,561] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:01.144,592] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    [00:00:01.144,622] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 137.20634 Build 2617349514
    [00:00:01.162,475] <inf> bt_hci_core: Identity: EE:F0:7B:84:FC:21 (random)
    [00:00:01.162,506] <inf> bt_hci_core: HCI: version 6.0 (0x0e) revision 0x10f3, manufacturer 0x0059
    [00:00:01.162,536] <inf> bt_hci_core: LMP: version 6.0 (0x0e) subver 0x10f3
    [00:00:01.162,567] <inf> lte_ble_gw: Bluetooth ready
    [00:00:01.172,576] <err> bt_gatt: Unable to import the key for AES CMAC -134
    [00:00:01.175,781] <inf> lte_ble_gw: Scanning...
    +CEREG: 2,"9E03","026B8102",7
    +CSCON: 1
    +CEREG: 5,"9E03","026B8102",7,,,"11100000","11100000"
    [00:00:08.115,600] <inf> nrf_cloud_info: Device ID: nrf-351901936291081
    [00:00:08.115,997] <inf> nrf_cloud_info: IMEI: 351901936291081
    [00:00:08.116,546] <inf> nrf_cloud_info: Modem FW: mfw_nrf9160_1.3.4
    [00:00:08.116,577] <inf> nrf_cloud_info: Protocol: MQTT
    [00:00:08.116,607] <inf> nrf_cloud_info: Download protocol: HTTPS
    [00:00:08.116,638] <inf> nrf_cloud_info: Sec tag: 16842753
    [00:00:08.116,668] <inf> nrf_cloud_info: Host name: mqtt.nrfcloud.com
    [00:00:15.299,865] <err> nrf_cloud_transport: Failed to save session state: -2
    [00:00:15.300,659] <inf> lte_ble_gw: Initializing GNSS
    [00:00:15.306,152] <inf> lte_ble_gw: GNSS initialized
    [00:00:15.309,204] <inf> lte_ble_gw: Requesting A-GNSS Data
    [00:00:15.309,692] <inf> lte_ble_gw: GNSS started with interval 30 seconds, and timeout 15 seconds
    [00:00:15.309,753] <inf> nrf_cloud_info: Team ID: 45c9165d-a392-4543-96c3-d17ba0aaf166
    +CSCON: 0

  • Hi Timothy, 
    Please verify that the nRF9160 works first. 
    Have you looked at the academy course I provided? 

    Regarding the the first red line please try to find if in your nRF52 project this is set: 

    CONFIG_TFM_PROFILE_TYPE_MINIMAL=y

    Please change it to n

    And also set this: CONFIG_TFM_PROFILE_TYPE_NOT_SET=y

    For the second one, please take a look here: 
    RE: nrf_cloud not connecting in thingy91X

  • Hung Bui

    the nrf91060 is working. It runs and sets LED 4 to say that it  is connected to nRF Cloud.

    in nrf Cloud do I create a LTE device using the nRF9160 IMEI and PIN or do I use the nrf52832 IMEI and PIN. If I need to use the nRF52832 hardware information how do I get that. It is a custom board.

  • Hello Hung,

    I am working with Timothy and I can verify that the changes you recommended for the first red line error are corrected with your two CONFIG_TFM_PROFILE_TYPE... lines but with the proviso that they are done in the nRF9160 project rather than the nRF52 project. Thanks.

    Burt

Related