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

nrf5340 Bluetooth only works when JLink is connected

Hello,

I ordered a nRF5340-PDK board and i'm trying to get it to work.

When flashing the Heart Rate hex file I couldn't find the device (i pushed the reset button).

I tried building from source and it works only with JLink connected (in SES).

I added code to blink an LED to the Heart Rate sampled and flashed it. The LED blinks even without JLink being connected.

So I'm guessing somehow this is related to the network processor? Reading the flash in the programmer utility shows the network processor is flashed properly.

What could be the cause of this issue?

Thanks in advance.

Parents
  • Have you reset the device after you've disconnected the debugger?

  • I've noticed that if I:

    * Press scan in nRF Toolbox (HRM page)

    * Quickly press the reset button

    The device appears for a couple of seconds then disappears. By pressing the connect button quickly in the nRF Toolbox app I was able to receive the Heart Rate data.

    I connected to the UART terminal to view the logs.

    *** Booting Zephyr OS build v2.1.99-ncs1  ***
    Bluetooth initialized
    Advertising successfully started
    [00:00:00.021,697] .[0m<inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002).[0m
    [00:00:00.021,697] .[0m<inf> bt_hci_core: HW Variant: nRF53x (0x0003).[0m
    [00:00:00.021,728] .[0m<inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 2.1 Build 99.[0m
    [00:00:00.024,536] .[0m<inf> bt_hci_core: Identity: eb:f7:36:cd:d5:51 (random).[0m
    [00:00:00.024,536] .[0m<inf> bt_hci_core: HCI: version 5.1 (0x0a) revision 0x0000, manufacturer 0x05f1.[0m
    [00:00:00.024,536] .[0m<inf> bt_hci_core: LMP: version 5.1 (0x0a) subver 0xffff.[0m
    Connected
    [00:00:04.141,265] .[0m<inf> bas: BAS Notifications enabled.[0m
    [00:00:04.178,771] .[0m<inf> hrs: HRS notifications enabled.[0m
    Disconnected (reason 0x08)
    

    In the hci_err.h file, I've found

    #define BT_HCI_ERR_CONN_TIMEOUT                 0x08

    -----------

    Here's the only senario to get it working:

    *Reset the device

    *Connect to J-Link in SES

    ------------

    Here's an interesting senario that doesn't work !!!

    * Connect to J-Link in SES

    * Press the reset button

    In this case the device doesn't advertise unless I press the Reconnect J-Link button in SES

  • Hmm, this is strange. What kind of device is runnning the nRF connect app, mobile or PC?

    This is the log output from the app core right? 

    Why don't you get a log from the network core as well. See http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_nrf5340.html#logging-output-on-the-network-core

    Is it possible to replicate it with one of the samples in NCS? 

Reply Children
  • Hello again,

    I'm using NCS v1.2.0

    I've followed your instructions to get the output from the network processor

    /**************** J-Link Disconnected ************************/
    /**************** Pressed reset button **********************/
    *** Booting Zephyr OS build v2.1.99-ncs1  ***
    [00:00:00.004,333] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.004,394] .[0m<inf> hci_rpmsg: Received message of 4 bytes..[0m
    .[1;31m--- 28 messages dropped ---
    .[0m[00:00:00.017,028] .[0m<inf> hci_rpmsg: Received message of 4 bytes..[0m
    [00:00:00.017,395] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.017,456] .[0m<inf> hci_rpmsg: Received message of 8 bytes..[0m
    [00:00:00.017,822] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.017,883] .[0m<inf> hci_rpmsg: Received message of 4 bytes..[0m
    [00:00:00.018,249] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.018,310] .[0m<inf> hci_rpmsg: Received message of 12 bytes..[0m
    [00:00:00.018,676] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.018,768] .[0m<inf> hci_rpmsg: Received message of 12 bytes..[0m
    [00:00:00.019,134] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.019,195] .[0m<inf> hci_rpmsg: Received message of 4 bytes..[0m
    [00:00:00.019,592] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.019,653] .[0m<inf> hci_rpmsg: Received message of 4 bytes..[0m
    [00:00:00.020,050] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.020,141] .[0m<inf> hci_rpmsg: Received message of 4 bytes..[0m
    [00:00:00.020,507] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.020,568] .[0m<inf> hci_rpmsg: Received message of 4 bytes..[0m
    [00:00:00.020,935] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.021,026] .[0m<inf> hci_rpmsg: Received message of 4 bytes..[0m
    [00:00:00.021,392] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.021,484] .[0m<inf> hci_rpmsg: Received message of 10 bytes..[0m
    [00:00:00.021,881] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.021,942] .[0m<inf> hci_rpmsg: Received message of 4 bytes..[0m
    [00:00:00.024,505] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.024,566] .[0m<inf> hci_rpmsg: Received message of 19 bytes..[0m
    [00:00:00.024,963] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.025,054] .[0m<inf> hci_rpmsg: Received message of 36 bytes..[0m
    [00:00:00.025,451] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.025,543] .[0m<inf> hci_rpmsg: Received message of 36 bytes..[0m
    [00:00:00.025,939] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:00:00.026,031] .[0m<inf> hci_rpmsg: Received message of 5 bytes..[0m
    /*********************** J-Link connected *********************/
    Received nothing
    /*********************** nRF Toolbox HRM app connected *************/
    [00:01:42.499,176] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:42.499,237] .[0m<inf> hci_rpmsg: Received message of 6 bytes..[0m
    [00:01:42.544,158] .[0m<inf> bt_ctlr_hci: handle: 0x0000, rssi: -34 dB..[0m
    [00:01:42.592,376] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:42.592,437] .[0m<inf> hci_rpmsg: Received message of 11 bytes..[0m
    [00:01:42.738,769] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:42.738,800] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:42.738,830] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:42.738,922] .[0m<inf> hci_rpmsg: Received message of 29 bytes..[0m
    [00:01:42.836,395] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:42.836,547] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:42.836,578] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:42.836,639] .[0m<inf> hci_rpmsg: Received message of 23 bytes..[0m
    [00:01:42.933,868] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:42.933,929] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:42.933,959] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:42.934,112] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:42.980,499] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:42.980,560] .[0m<inf> hci_rpmsg: Received message of 4 bytes..[0m
    [00:01:42.980,926] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:42.980,957] .[0m<inf> hci_rpmsg: Received message of 10 bytes..[0m
    [00:01:43.031,677] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.031,707] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.031,890] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.031,951] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:43.128,875] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.128,997] .[0m<inf> bt_ctlr_hci: handle: 0x0000, rssi: -38 dB..[0m
    [00:01:43.129,089] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.129,150] .[0m<inf> hci_rpmsg: Received message of 25 bytes..[0m
    [00:01:43.226,379] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.226,440] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.226,501] .[0m<inf> hci_rpmsg: Received message of 18 bytes..[0m
    [00:01:43.323,883] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.323,944] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.324,005] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:43.425,140] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.425,170] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.425,231] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.425,292] .[0m<inf> hci_rpmsg: Received message of 15 bytes..[0m
    [00:01:43.440,093] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.440,155] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.440,185] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.440,246] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:43.455,108] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.455,139] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.455,200] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.455,261] .[0m<inf> hci_rpmsg: Received message of 25 bytes..[0m
    [00:01:43.470,153] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.470,214] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.470,275] .[0m<inf> hci_rpmsg: Received message of 18 bytes..[0m
    [00:01:43.485,137] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.485,198] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.485,290] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:43.500,122] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.500,152] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.500,183] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.500,244] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:43.515,106] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.515,136] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.515,197] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.515,258] .[0m<inf> hci_rpmsg: Received message of 18 bytes..[0m
    [00:01:43.530,151] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.530,212] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.530,273] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:43.545,135] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.545,166] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.545,227] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.545,288] .[0m<inf> hci_rpmsg: Received message of 15 bytes..[0m
    [00:01:43.560,150] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.560,211] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.560,272] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:43.575,103] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.575,134] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.575,195] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.575,256] .[0m<inf> hci_rpmsg: Received message of 25 bytes..[0m
    [00:01:43.590,148] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    .[1;31m--- 1 messages dropped ---
    .[0m[00:01:43.590,301] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:43.605,163] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.605,224] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.605,285] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:43.620,147] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.620,239] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.620,300] .[0m<inf> hci_rpmsg: Received message of 25 bytes..[0m
    [00:01:43.635,131] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.635,162] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.635,192] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.635,253] .[0m<inf> hci_rpmsg: Received message of 18 bytes..[0m
    [00:01:43.650,177] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.650,238] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.650,299] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:43.665,161] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.665,191] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.665,222] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.665,283] .[0m<inf> hci_rpmsg: Received message of 15 bytes..[0m
    [00:01:43.687,408] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.687,469] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.687,500] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.687,561] .[0m<inf> hci_rpmsg: Received message of 11 bytes..[0m
    [00:01:43.702,667] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.702,728] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.702,789] .[0m<inf> hci_rpmsg: Received message of 10 bytes..[0m
    [00:01:43.717,651] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.717,712] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.717,773] .[0m<inf> hci_rpmsg: Received message of 11 bytes..[0m
    [00:01:43.732,666] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:43.732,727] .[0m<inf> hci_rpmsg: Received message of 9 bytes..[0m
    [00:01:43.732,818] .[0m<inf> hci_rpmsg: Received message of 10 bytes..[0m
    [00:01:44.262,725] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:44.262,786] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:44.262,847] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:44.262,878] .[0m<inf> hci_rpmsg: Received message of 13 bytes..[0m
    [00:01:45.263,031] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:45.263,092] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:45.263,153] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:45.263,244] .[0m<inf> hci_rpmsg: Received message of 13 bytes..[0m
    [00:01:46.263,336] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:46.263,397] .[0m<inf> hci_rpmsg: Received message of 14 bytes..[0m
    [00:01:46.263,458] .[0m<inf> hci_rpmsg: Got callback of id 0.[0m
    [00:01:46.263,488] .[0m<inf> hci_rpmsg: Received message of 13 bytes..[0m
    [00:01:46.717,254] .[0m<inf> hci_rpmsg: Got callback of i
    /************** HRM app disconnected  by me ********************/

    I also tried the peripheral sample (not the HR sample) and it had the same issue.

Related