Flashing nRF5340DK via VSCode works, but via Programmer fails

Hi

I have an application, based on nrf/samples/bluetooth/peripheral_uart.

Using VS Code I can build the app, and flash it to my nRF5340 DK board ((PCA10095 - 2.0.0 - 2022.4), and it runs.

However, if I use the nRF Connect for Desktop's Programmer to flash the build\zephyr\merged.hex file, the application does not successfully start.

....................................

VS Code setup:

Version: 1.87.0 (user setup)
Commit: 019f4d1419fbc8219a181fab7892ebccf7ee29a2
Date: 2024-02-27T23:41:44.469Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Windows_NT x64 10.0.19045

nRF Connect for VS Code: v2024.2.214
....................................

Application, based on nrf/samples/bluetooth/peripheral_uart

Build Configuration: nrf5340dk_nrf5340_cpuapp_ns

....................................

Programmer setup:

nRF Connect for Desktop v4.4.0
Programmer v4.2.0

Steps taken:

Open the Programmer

Auto read memory: On
Auto reset: On
Enable MCUboot: Off

Select Device: nRF5340 DK

Clear Files

Add file: merged.hex

Erase & write

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

Serial output when I use VS Code (successfully)

Starting Nordic UART service example
*** Booting Zephyr OS build v3.3.99-ncs1-1 ***

[00:00:00.471,099] <inf> fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.471,099] <inf> fs_nvs: alloc wra: 0, fe8
[00:00:00.471,130] <inf> fs_nvs: data wra: 0, 0
[00:00:00.494,628] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.494,689] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
[00:00:00.494,720] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 224.11902 Build 2231721665
[00:00:00.496,032] <inf> bt_hci_core: No ID address. App must call settings_load()
[00:00:00.497,406] <inf> bt_hci_core: Identity: EF:BF:5A:B8:62:7F (random)
[00:00:00.497,436] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x2077, manufacturer 0x0059
[00:00:00.497,497] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x2077
	:
	:

Serial output when I use Programmer (unsuccessfully)

Starting Nordic UART service example
*** Booting Zephyr OS build v3.3.99-ncs1-1 ***

[00:00:00.316,406] <inf> fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.316,467] <inf> fs_nvs: alloc wra: 0, fe8
[00:00:00.316,497] <inf> fs_nvs: data wra: 0, 0
[00:00:00.317,840] <inf> peripheral_uart: led_button_thread - start
[00:00:01.317,901] <err> bt_hci_driver: Endpoint binding failed with -11
[00:00:01.317,932] <err> bt_hci_core: HCI driver open failed (-11)

This is the same board that I have a problem flahsing via VS Code every 2nd tiume, and I have to open a command window at:

C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin>

and run this command:

nrfjprog --recover

I tried doing this before flashing with the Programmer, but it still failed.

  • Here is the log output from the Programmer:

    2024-03-05T15:44:44.366Z DEBUG Application data folder: C:\Users\me\AppData\Roaming\nrfconnect\pc-nrfconnect-programmer
    2024-03-05T15:44:44.412Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:44:44.412Z DEBUG App pc-nrfconnect-programmer v4.2.0 (official)
    2024-03-05T15:44:44.412Z DEBUG App path: C:\Users\me\.nrfconnect-apps\node_modules\pc-nrfconnect-programmer
    2024-03-05T15:44:44.412Z DEBUG nRFConnect 4.4.0, required by the app is (>=4.3.0)
    2024-03-05T15:44:44.412Z DEBUG nRFConnect path: C:\Users\me\AppData\Local\Programs\nrfconnect\resources\app.asar
    2024-03-05T15:44:44.412Z DEBUG HomeDir: C:\Users\me
    2024-03-05T15:44:44.412Z DEBUG TmpDir: C:\Users\me\AppData\Local\Temp
    2024-03-05T15:44:44.988Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:44:44.992Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:44:45.477Z INFO Using nrfutil-device version: 2.0.3
    2024-03-05T15:44:45.477Z INFO Using nrf-device-lib version: 0.17.3
    2024-03-05T15:44:45.477Z INFO Using nrfjprog DLL version: 10.23.1
    2024-03-05T15:44:45.477Z INFO Using JLink version: JLink_V7.88j
    2024-03-05T15:44:45.629Z INFO Getting serialport options from persistent store 001050071243.pc-nrfconnect-programmer
    2024-03-05T15:44:45.630Z DEBUG Sending usage data "device connected"
    2024-03-05T15:44:58.445Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:44:59.602Z INFO Using nrfutil device to communicate with target via JLink
    2024-03-05T15:44:59.602Z INFO JLink OB firmware version J-Link OB-nRF5340-NordicSemi compiled Nov  7 2022 16:22:01
    2024-03-05T15:44:59.602Z INFO Device family NRF53_FAMILY
    2024-03-05T15:44:59.602Z INFO Device version NRF5340_xxAA_ENGD
    2024-03-05T15:44:59.603Z INFO Board version PCA10095
    2024-03-05T15:44:59.610Z DEBUG Sending usage data "device selected"
    2024-03-05T15:44:59.610Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:44:59.610Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:44:59.773Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:45:00.635Z INFO Reading readback protection status for Application core
    2024-03-05T15:45:00.637Z INFO Reading readback protection status for Application core 0%
    2024-03-05T15:45:00.649Z INFO Reading readback protection status for Application core 100%
    2024-03-05T15:45:00.649Z INFO Application core protection status 'NRFDL_PROTECTION_STATUS_NONE'
    2024-03-05T15:45:00.649Z INFO Reading readback protection status for Application core completed
    2024-03-05T15:45:00.696Z INFO Reading readback protection status for Network core
    2024-03-05T15:45:00.697Z INFO Reading readback protection status for Network core 0%
    2024-03-05T15:45:00.712Z INFO Reading readback protection status for Network core 100%
    2024-03-05T15:45:00.712Z INFO Network core protection status 'NRFDL_PROTECTION_STATUS_NONE'
    2024-03-05T15:45:00.713Z INFO Reading readback protection status for Network core completed
    2024-03-05T15:45:01.037Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:45:01.037Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:45:01.037Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:45:01.037Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:45:01.037Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:45:01.198Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:45:02.069Z INFO Loading core information for Application core
    2024-03-05T15:45:02.070Z INFO Loading core information for Application core 0%
    2024-03-05T15:45:02.101Z INFO Loading core information for Application core 100%
    2024-03-05T15:45:02.101Z INFO Loading core information for Application core completed
    2024-03-05T15:45:02.148Z INFO Loading core information for Network core
    2024-03-05T15:45:02.149Z INFO Loading core information for Network core 0%
    2024-03-05T15:45:02.179Z INFO Loading core information for Network core 100%
    2024-03-05T15:45:02.179Z INFO Loading core information for Network core completed
    2024-03-05T15:45:02.194Z INFO Reading memory for Application core
    2024-03-05T15:45:02.195Z INFO Reading memory for Application core 0%
    2024-03-05T15:45:09.544Z INFO Reading memory for Application core 100%
    2024-03-05T15:45:09.845Z INFO Reading memory for Application core completed
    2024-03-05T15:45:09.846Z INFO Parse memory regions for Application core
    2024-03-05T15:45:09.850Z INFO Reading memory for Network core
    2024-03-05T15:45:09.851Z INFO Reading memory for Network core 0%
    2024-03-05T15:45:09.852Z INFO Parse memory regions for Application core
    2024-03-05T15:45:11.480Z INFO Reading memory for Network core 100%
    2024-03-05T15:45:11.612Z INFO Reading memory for Network core completed
    2024-03-05T15:45:11.613Z INFO Parse memory regions for Application core
    2024-03-05T15:45:11.613Z INFO Parse memory regions for Network core
    2024-03-05T15:45:11.853Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:45:11.853Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:45:12.009Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:45:12.849Z INFO Reading readback protection status for Application core
    2024-03-05T15:45:12.850Z INFO Reading readback protection status for Application core 0%
    2024-03-05T15:45:12.865Z INFO Reading readback protection status for Application core 100%
    2024-03-05T15:45:12.865Z INFO Application core protection status 'NRFDL_PROTECTION_STATUS_NONE'
    2024-03-05T15:45:12.866Z INFO Reading readback protection status for Application core completed
    2024-03-05T15:45:12.911Z INFO Reading readback protection status for Network core
    2024-03-05T15:45:12.911Z INFO Reading readback protection status for Network core 0%
    2024-03-05T15:45:12.927Z INFO Reading readback protection status for Network core 100%
    2024-03-05T15:45:12.927Z INFO Network core protection status 'NRFDL_PROTECTION_STATUS_NONE'
    2024-03-05T15:45:12.927Z INFO Reading readback protection status for Network core completed
    2024-03-05T15:45:13.190Z INFO Device is loaded and ready for further operation
    2024-03-05T15:46:14.137Z INFO Parsing HEX file:  C:\Users\me\Downloads\merged.hex
    2024-03-05T15:46:14.139Z INFO File was last modified at  3/5/2024, 7:30:23 AM
    2024-03-05T15:46:14.197Z INFO Update files regions according to Application core
    2024-03-05T15:46:14.197Z INFO Parse memory regions for file
    2024-03-05T15:46:14.197Z INFO Update files regions according to Network core
    2024-03-05T15:46:14.197Z INFO Parse memory regions for file
    2024-03-05T15:46:43.399Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:46:43.399Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:46:43.399Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:46:43.399Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:46:43.399Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:46:43.399Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:46:43.399Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:46:43.399Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:46:43.589Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:46:44.412Z INFO Recovering Application core
    2024-03-05T15:46:44.413Z INFO Recovering Application core 0%
    2024-03-05T15:46:45.684Z INFO Recovering Application core 100%
    2024-03-05T15:46:45.685Z INFO Recovering Application core completed
    2024-03-05T15:46:45.779Z INFO Recovering Network core
    2024-03-05T15:46:45.781Z INFO Recovering Network core 0%
    2024-03-05T15:46:47.032Z INFO Recovering Network core 100%
    2024-03-05T15:46:47.033Z INFO Recovering Network core completed
    2024-03-05T15:46:47.094Z INFO Writing HEX to Application core
    2024-03-05T15:46:47.686Z INFO Writing HEX to Application core 33.333333333333336%
    2024-03-05T15:46:47.687Z INFO Writing HEX to Application core 33.33333333333333%
    2024-03-05T15:46:49.457Z INFO Writing HEX to Application core 100%
    2024-03-05T15:46:49.465Z INFO Writing HEX to Application core completed
    2024-03-05T15:46:49.465Z INFO Reading memory for Application core
    2024-03-05T15:46:49.468Z INFO Reading memory for Application core 0%
    2024-03-05T15:46:56.718Z INFO Reading memory for Application core 100%
    2024-03-05T15:46:56.988Z INFO Reading memory for Application core completed
    2024-03-05T15:46:56.990Z INFO Parse memory regions for Application core
    2024-03-05T15:46:56.993Z INFO Reading memory for Network core
    2024-03-05T15:46:56.993Z INFO Reading memory for Network core 0%
    2024-03-05T15:46:56.995Z INFO Parse memory regions for Application core
    2024-03-05T15:46:58.682Z INFO Reading memory for Network core 100%
    2024-03-05T15:46:58.820Z INFO Reading memory for Network core completed
    2024-03-05T15:46:58.821Z INFO Parse memory regions for Application core
    2024-03-05T15:46:58.821Z INFO Parse memory regions for Network core
    2024-03-05T15:46:58.824Z INFO Loading core information for Application core
    2024-03-05T15:46:58.825Z INFO Loading core information for Application core 0%
    2024-03-05T15:46:58.825Z INFO Loading core information for Application core 100%
    2024-03-05T15:46:58.825Z INFO Loading core information for Application core completed
    2024-03-05T15:46:58.828Z INFO Update files regions according to Application core
    2024-03-05T15:46:58.828Z INFO Parse memory regions for file
    2024-03-05T15:46:58.828Z INFO Update files regions according to Network core
    2024-03-05T15:46:58.828Z INFO Parse memory regions for file
    2024-03-05T15:46:58.828Z INFO Parse memory regions for Application core
    2024-03-05T15:46:58.828Z INFO Parse memory regions for Network core
    2024-03-05T15:46:58.902Z INFO Loading core information for Network core
    2024-03-05T15:46:58.903Z INFO Update files regions according to Application core
    2024-03-05T15:46:58.903Z INFO Parse memory regions for file
    2024-03-05T15:46:58.903Z INFO Update files regions according to Network core
    2024-03-05T15:46:58.903Z INFO Parse memory regions for file
    2024-03-05T15:46:58.904Z INFO Parse memory regions for Application core
    2024-03-05T15:46:58.904Z INFO Parse memory regions for Network core
    2024-03-05T15:46:58.905Z INFO Loading core information for Network core 0%
    2024-03-05T15:46:58.951Z INFO Loading core information for Network core 100%
    2024-03-05T15:46:58.952Z INFO Loading core information for Network core completed
    2024-03-05T15:46:58.955Z INFO Update files regions according to Application core
    2024-03-05T15:46:58.955Z INFO Parse memory regions for file
    2024-03-05T15:46:58.956Z INFO Update files regions according to Network core
    2024-03-05T15:46:58.956Z INFO Parse memory regions for file
    2024-03-05T15:46:58.956Z INFO Parse memory regions for Application core
    2024-03-05T15:46:58.956Z INFO Parse memory regions for Network core
    2024-03-05T15:46:59.342Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:47:00.510Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:47:00.510Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:47:00.521Z INFO Update files regions according to Application core
    2024-03-05T15:47:00.521Z INFO Parse memory regions for file
    2024-03-05T15:47:00.522Z INFO Update files regions according to Network core
    2024-03-05T15:47:00.522Z INFO Parse memory regions for file
    2024-03-05T15:47:00.684Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:47:01.501Z INFO Reading readback protection status for Application core
    2024-03-05T15:47:01.502Z INFO Reading readback protection status for Application core 0%
    2024-03-05T15:47:01.517Z INFO Reading readback protection status for Application core 100%
    2024-03-05T15:47:01.517Z INFO Application core protection status 'NRFDL_PROTECTION_STATUS_NONE'
    2024-03-05T15:47:01.517Z INFO Reading readback protection status for Application core completed
    2024-03-05T15:47:01.563Z INFO Reading readback protection status for Network core
    2024-03-05T15:47:01.564Z INFO Reading readback protection status for Network core 0%
    2024-03-05T15:47:01.582Z INFO Reading readback protection status for Network core 100%
    2024-03-05T15:47:01.582Z INFO Network core protection status 'NRFDL_PROTECTION_STATUS_NONE'
    2024-03-05T15:47:01.582Z INFO Reading readback protection status for Network core completed
    2024-03-05T15:47:01.838Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:47:01.838Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:47:02.009Z DEBUG Sending usage data "running nrfutil device"
    2024-03-05T15:47:02.791Z INFO Reading readback protection status for Application core
    2024-03-05T15:47:02.791Z INFO Reading readback protection status for Application core 0%
    2024-03-05T15:47:02.806Z INFO Reading readback protection status for Application core 100%
    2024-03-05T15:47:02.806Z INFO Application core protection status 'NRFDL_PROTECTION_STATUS_NONE'
    2024-03-05T15:47:02.806Z INFO Reading readback protection status for Application core completed
    2024-03-05T15:47:02.853Z INFO Reading readback protection status for Network core
    2024-03-05T15:47:02.854Z INFO Reading readback protection status for Network core 0%
    2024-03-05T15:47:02.868Z INFO Reading readback protection status for Network core 100%
    2024-03-05T15:47:02.868Z INFO Network core protection status 'NRFDL_PROTECTION_STATUS_NONE'
    2024-03-05T15:47:02.868Z INFO Reading readback protection status for Network core completed

  • Hi,

    The merged.hex file is only for the application core, so you are missing the network core. You either need to use the merged_domains.hex file, or both GENERATED_CP_NETWORK_merged_domains.hex and GENERATED_CP_APPLICATION_merged_domains.hex.

  • Thank you for the quick (and correct) response :)

Related