hci_uart will not flash with VS Studio

I have a new nrf9160dk board that I will be using for a BLE customer application. I am using zephyr/samples/bluetooth/hci_uart SDK V3.2.0 to be loaded into the nRF52840 in the DK board. I can build and compile with VS Studio with no problems. When I try to flash it into the nRF52840 (switch SW10 set to nRF52) it fails. see below. I tried to flash it using the programmed which said it was programmed but it did not run or boot the nRF52840. There is a startup message in the code. any help you can give would be greatly appreciated since this is needed for a customer application.

************************************************************************

Executing task: nRF Connect: Flash: hci_uart/hci_uart (active)

Flashing hci_uart to nRF9160 DK
west flash -d c:\Nordic4\test\hci_uart\build --domain hci_uart --dev-id 960028025 --erase

*-- west flash: rebuilding
[0/5] Performing build step for 'hci_uart'
ninja: no work to do.
[4/5] cmd.exe /C "cd /D C:\Nordic4\test\hci_uart\build\_sysbuild && C:\Nordic\v1.7.0\toolchains\66cdf9b75e\opt\bin\cmake.exe -E true"
-- west flash: using runner nrfutil
-- runners.nrfutil: mass erase requested
-- runners.nrfutil: reset after flashing requested
-- runners.nrfutil: Flashing file: C:\Nordic4\test\hci_uart\build\merged.hex

thread 'main' panicked at C:\Users\VssAdministrator\.cargo\git\checkouts\nrf-device-lib-cf1a63c495be42f5\936ac5a\serialport-lister\src\lib.rs:49:60:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: Subprocess C:\Nordic\v1.7.0\toolchains\66cdf9b75e\nrfutil\home\bin\nrfutil-device.exe failed with unexpected exit code Some(101)
FATAL ERROR: command exited with status 1: nrfutil --json device x-execute-batch --batch-path 'C:\Nordic4\test\hci_uart\build\hci_uart\zephyr\generated_nrfutil_batch.json' --serial-number 960028025

* The terminal process terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.

***************************************************************

Parents
  • Hi,

    From what I understood from your issue, the bug is happening from the nRF Util bundled with the toolchain. I am wondering if this also happen on the "standalone" version. Can you try to download the latest version (link), and program the board with that version (nrfutil device program [OPTIONS] --firmware <PATH>)?

    Can you please send me both versions' information by running this command : "nrfutil device --version" (maybe you will need to run "nrfutil.exe device --version" for the standalone version)?

    From what I can see internally, it indeed should have been already patched some times ago.

    If you need an alternative right now, you should be able to use nRF JProg to program the chip manually. It has been deprecated, but should still be working for older chips like the nRF9160.

    Best regards,

    Simon D-M

  • This what I see when I use the downloaded version.

    if I program. this command and domwloaded version works fine.

    ************************************************************


    C:\my_files>nrfutil device program --firmware C:\Nordic4\test_n9160\central_uart_tjm\build\central_uart_tjm\zephyr\tfm_merged.hex
    [00:00:02] ###### 100% [2/3 960028025] Programmed

    ***************************************************************

    :\my_files>nrfutil device --version
    nrfutil-device 2.15.1 (6f9a83f 2025-10-10)
    commit-hash: 6f9a83f9a59349b6eb90328523c41dc36b795f0a
    commit-date: 2025-10-10
    host: x86_64-pc-windows-msvc
    build-timestamp: 2025-10-10T06:44:46.117845000Z
    classification: nrf-external

    Detected SEGGER J-Link version: JLink_V8.76

    The device command version you are currently using was tested with a different J-Link version (JLink_V8.66) than the one you have installed (JLink_V8.76). The tested version is not required, and your J-Link version will most likely work fine. If you get issues related to J-Link with your devices, use the tested version.

Reply
  • This what I see when I use the downloaded version.

    if I program. this command and domwloaded version works fine.

    ************************************************************


    C:\my_files>nrfutil device program --firmware C:\Nordic4\test_n9160\central_uart_tjm\build\central_uart_tjm\zephyr\tfm_merged.hex
    [00:00:02] ###### 100% [2/3 960028025] Programmed

    ***************************************************************

    :\my_files>nrfutil device --version
    nrfutil-device 2.15.1 (6f9a83f 2025-10-10)
    commit-hash: 6f9a83f9a59349b6eb90328523c41dc36b795f0a
    commit-date: 2025-10-10
    host: x86_64-pc-windows-msvc
    build-timestamp: 2025-10-10T06:44:46.117845000Z
    classification: nrf-external

    Detected SEGGER J-Link version: JLink_V8.76

    The device command version you are currently using was tested with a different J-Link version (JLink_V8.66) than the one you have installed (JLink_V8.76). The tested version is not required, and your J-Link version will most likely work fine. If you get issues related to J-Link with your devices, use the tested version.

Children
  • Hi,

    I'm sorry for the delay. So if I understood correctly this is the output of the downloaded version. Can you please also try to run the command in the NCS bundled version so that we can compare the versions?

    You can do it by opening a nRF Connect Terminal in VS Code (Go to nRF Connect extension tab and click "Open Terminal") and running the same command (nrfutil device --version) in that terminal.

    Best regards,

    Simon D-M

  • Simon

    in a terminal inside VS Studio when I run the command shown below. it programs fine. see below.

    PS C:\Nordic4\test_n9160\central_uart_tjm> nrfutil device program --firmware C:\Nordic4\test_n9160\central_uart_tjm\build\central_uart_tjm\zephyr\tfm_merged.hex
    [00:00:02] ###### 100% [2/3 960028025] Programmed
    PS C:\Nordic4\test_n9160\central_uart_tjm>

    if I try to flash it in VS STudio code I still get

    Executing task: nRF Connect: Flash: central_uart_tjm/central_uart_tjm (active)

    Flashing central_uart_tjm to nRF9160 DK
    west flash -d c:\Nordic4\test_n9160\central_uart_tjm\build --domain central_uart_tjm --dev-id 960028025

    -- west flash: rebuilding
    [0/5] Performing build step for 'central_uart_tjm'
    [0/16] Performing build step for 'tfm'
    ninja: no work to do.
    [4/5] cmd.exe /C "cd /D C:\Nordic4\test_n9160\central_uart_tjm\build\_sysbuild && C:\Nordic\v1.7.0\toolchains\66cdf9b75e\opt\bin\cmake.exe -E true"
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    -- runners.nrfutil: Flashing file: C:\Nordic4\test_n9160\central_uart_tjm\build\merged.hex

    thread 'main' panicked at C:\Users\VssAdministrator\.cargo\git\checkouts\nrf-device-lib-cf1a63c495be42f5\936ac5a\serialport-lister\src\lib.rs:49:60:
    called `Option::unwrap()` on a `None` value
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    Error: Subprocess C:\Nordic\v1.7.0\toolchains\66cdf9b75e\nrfutil\home\bin\nrfutil-device.exe failed with unexpected exit code Some(101)
    FATAL ERROR: command exited with status 1: nrfutil --json device x-execute-batch --batch-path 'C:\Nordic4\test_n9160\central_uart_tjm\build\central_uart_tjm\zephyr\generated_nrfutil_batch.json' --seri
    al-number 960028025

    * The terminal process terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.

  • Simon

    my colleague Burt pointed out that I sued the "new terminal" from the terminal menu not the "open terminal". when I use the open terminal the command fails exactly as when I push the flash button. see below.  nrfutil version is different in the terminal created from new terminal vs the one created in the open terminal.

    Working directory: c:\Nordic4\v2.9.0
    SDK: nRF Connect SDK v3.2.1
    Toolchain: nRF Connect SDK Toolchain v3.2.1

    PS C:\Nordic4\v2.9.0> cd ..
    PS C:\Nordic4> cd .\test_n9160\central_uart_tjm\
    PS C:\Nordic4\test_n9160\central_uart_tjm> nrfutil device program --serial-number 960028025 --firmware build\central_uart_tjm\zephyr\tfm_merged.hex

    thread 'main' panicked at C:\Users\VssAdministrator\.cargo\git\checkouts\nrf-device-lib-cf1a63c495be42f5\936ac5a\serialport-lister\src\lib.rs:49:60:
    called `Option::unwrap()` on a `None` value
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    Error: Subprocess C:\Nordic\v1.7.0\toolchains\66cdf9b75e\nrfutil\home\bin\nrfutil-device.exe failed with unexpected exit code Some(101)


    PS C:\Nordic4\test_n9160\central_uart_tjm> nrfutil device --version
    nrfutil-device 2.15.2 (3c54c5f 2025-11-13)
    commit-hash: 3c54c5feb9c6743403ce7d2026939ab443376b91
    commit-date: 2025-11-13
    host: x86_64-pc-windows-msvc
    build-timestamp: 2025-11-13T09:29:57.574629800Z
    classification: nrf-external

    Detected SEGGER J-Link version: JLink_V8.76
    PS C:\Nordic4\test_n9160\central_uart_tjm>

  • Hi,

    Timothy said:
    nrfutil-device 2.15.1 (6f9a83f 2025-10-10)

    I can see that you have the version 2.15.1 for the downloaded version. But when I download the latest version and run the same command, it tells me that I have the 2.15.6 version.

    Can you please try to download the latest version (here) and retry to flash to see it the bug has been fixed in the latest version?

    Best regards,

    Simon D-M

  • Simon, if I may interject, on Tim's behalf: we know that the issue was non-existent in 2.15.1, as Tim showed above. The issue came about in 2.15.2 (but I believe existed in certain much older releases). We know that it is fixed in more recent releases. However, the toolchain for SDK v3.2.1 comes packaged with the broken v2.15.2. And modern nRF Connect for VS Code uses the nrfutil-device in the toolchain.

    Burt

Related