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.

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

  • Yes I did, but nothing. Yet LED1 is blinking as it's supposed to do

    As soon as I hit Target->Connect J-Link in SES the Zephyr Hear Rate device shows up in nRF Connect!!

  • 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

  • I am also seeing a similar issue on a custom battery powered nRF5340 PCB using latest NCS. After power on BLE does not come up. Attaching a segger and doing a reset in Ozone will always clear the issue and BLE will work until the next time power is removed and reattached.

    I tried doing a software timeout if BT initialization failed, and then a watchdog reset. The device then starts advertising, but it need a lot of retries on GATT write/reads (using a python bluepy script). After a debugger reset I don't see the retries.

    Pinreset also seems to fix the issue, but I don't know if this is possible to trigger from software ?

  • 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? 

Related