Flashing on PCB gives Unknown Error in J-Link DLL

Hey Team,

I'm trying to flash the audio application on our custom PCB, this PCB follows the interfaces of the nrf5340 audio dk. Previously on lower SDK versions (2.7-2.9), I was able to flash my programs without any errors. However now with the newer toolchain version (3.0.1), Im getting this error whenever i run the west flash command

Command:

`west flash -d /opt/nordic/ncs/v3.0.1/nrf/applications/nrf5340_audio/build --domain nrf5340_audio --dev-id 801055229 --recover`

Logs:

Flashing nrf5340_audio to 801055229
west flash -d /opt/nordic/ncs/v3.0.1/nrf/applications/nrf5340_audio/build --domain nrf5340_audio --dev-id 801055229 --recover

-- west flash: rebuilding
[0/10] Performing build step for 'ipc_radio'
ninja: no work to do.
[1/10] Performing build step for 'nrf5340_audio'
ninja: no work to do.
[4/10] cd /opt/nordic/ncs/v3.0.1/nrf/applications/nrf5340_audio/build/_sysbuild && /opt/nordic/ncs/toolchains/ef4fc6722e/Cellar/cmake/3.21.0/bin/cmake -E true
[6/9] No install step for 'nrf5340_audio'
[7/9] Completed 'nrf5340_audio'
[8/9] cd /opt/nordic/ncs/v3.0.1/nrf/applications/nrf5340_audio/build/_sysbuild && /opt/nordic/ncs/toolchains/ef4fc6722e/Cellar/cmake/3.21.0/bin/cmake -E true
-- west flash: using runner nrfutil
-- runners.nrfutil: reset after flashing requested
-- runners.nrfutil: Recovering and erasing flash memory for both the network and application cores.
-- runners.nrfutil: Flashing file: /opt/nordic/ncs/v3.0.1/nrf/applications/nrf5340_audio/build/merged.hex
-- runners.nrfutil: Recover
-- runners.nrfutil: Recover
-- runners.nrfutil: Erasing address ranges touched by firmware
Error: One or more batch tasks failed:
 * 801055229: Device error: Emulator error: Unknown Error in J-Link DLL (error code =-1) (Generic)

FATAL ERROR: command exited with status 1: nrfutil --json device x-execute-batch --batch-path /opt/nordic/ncs/v3.0.1/nrf/applications/nrf5340_audio/build/generated_nrfutil_batch.json --serial-number 801055229

Sometimes I also get this error randomly

Error: One or more batch tasks failed:
 * 801055229: Device error: Failed to read from memory address 0x500038e4: Failed to write DebugPort register 0x08: Unknown Error in J-Link DLL (error code =-1) (Generic)

What should be the cause of this error and how do I fix it? Please let me know if you require any further information.

PS: Relevant information about the PCB like schematics and stuff are already shared in the private threads with this same account. 

Regards,

Soham

Parents
  • Hello,

    I am not completely sure what is causing the issue. From the error log, it looks like a problem related to J-Link. This could be due to an issue with the J-Link connection, firmware, or compatibility between the J-Link software and the target device.

    Try updating or reinstalling the J-Link drivers, ensuring firmware compatibility, and also try power cycling the debugger.

    Also, take a look at this thread and see if you are facing a similar issue. A workaround has been mentioned there, see if that resolves your problem.

    Kind regards,
    Abhijith

  • Apparently the newer sdk versions just broke a lot of stuff for me, now when I flash the audio application on the nrf5340 Audio DK, I get this fatal error which wasnt occuring before the update

    SEGGER J-Link V8.32 - Real time terminal output
    SEGGER J-Link (unknown) V1.0, SN=1050161689
    Process: JLinkExe
    *** Booting nRF Connect SDK v3.0.1-9eb5615da66b ***
    *** Using Zephyr OS v4.0.99-77f865b8f8d0 ***
    HL [00:00:00.433,013] <inf> board_version: Compatible board/HW version found: 1.1.0
    HL [00:00:00.466,064] <inf> fw_info: 
             nRF5340 Audio nRF5340 Audio DK cpuapp              
             NCS base version: 3.0.1                            
             Cmake run : Mon Jun 16 16:29:32 2025
    HL [00:00:00.466,064] <inf> fw_info: ------- DEBUG BUILD -------
    HL [00:00:00.466,064] <inf> fw_info: HEADSET left device
    HL [00:00:02.470,092] <err> bt_hci_driver: Endpoint binding failed with -11
    HL [00:00:02.470,092] <err> bt_hci_core: HCI driver open failed (-11)
    HL [00:00:02.470,092] <err> main: ERR_CHK Err_code: [-11] @ line: 532
    HL [00:00:02.470,123] <err> os: r0/a1:  0x00000003  r1/a2:  0x00000003  r2/a3:  0x00000002
    HL [00:00:02.470,123] <err> os: r3/a4:  0x00000003 r12/ip:  0x20003e98 r14/lr:  0x00061629
    HL [00:00:02.470,123] <err> os:  xpsr:  0x09100000
    HL [00:00:02.470,123] <err> os: s[ 0]:  0x20002780  s[ 1]:  0x000617e1  s[ 2]:  0x2001e428  s[ 3]:  0x00000004
    HL [00:00:02.470,153] <err> os: s[ 4]:  0xffffffff  s[ 5]:  0x0003bdf1  s[ 6]:  0x0003bdf1  s[ 7]:  0x2001e458
    HL [00:00:02.470,153] <err> os: s[ 8]:  0x2001e428  s[ 9]:  0xffffffff  s[10]:  0xffffffff  s[11]:  0x00061825
    HL [00:00:02.470,153] <err> os: s[12]:  0x0003bdf1  s[13]:  0x00072bb8  s[14]:  0xfffffff5  s[15]:  0x00000214
    HL [00:00:02.470,184] <err> os: fpscr:  0x0003bdf1
    HL [00:00:02.470,184] <err> os: Faulting instruction address (r15/pc): 0x00004a5c
    HL [00:00:02.470,214] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
    HL [00:00:02.470,214] <err> os: Current thread: 0x20006228 (main)
    HL [00:00:02.470,214] <err> error_handler: Caught system error -- reason 3. Entering infinite loop

    Backtracking with addr2line, the error occurs in

    // unicast_server/main:531
    
    ret = bt_mgmt_init();
    What is causing this?
    PS: This started occuring after i upgraded the nrfutl device recently
Reply
  • Apparently the newer sdk versions just broke a lot of stuff for me, now when I flash the audio application on the nrf5340 Audio DK, I get this fatal error which wasnt occuring before the update

    SEGGER J-Link V8.32 - Real time terminal output
    SEGGER J-Link (unknown) V1.0, SN=1050161689
    Process: JLinkExe
    *** Booting nRF Connect SDK v3.0.1-9eb5615da66b ***
    *** Using Zephyr OS v4.0.99-77f865b8f8d0 ***
    HL [00:00:00.433,013] <inf> board_version: Compatible board/HW version found: 1.1.0
    HL [00:00:00.466,064] <inf> fw_info: 
             nRF5340 Audio nRF5340 Audio DK cpuapp              
             NCS base version: 3.0.1                            
             Cmake run : Mon Jun 16 16:29:32 2025
    HL [00:00:00.466,064] <inf> fw_info: ------- DEBUG BUILD -------
    HL [00:00:00.466,064] <inf> fw_info: HEADSET left device
    HL [00:00:02.470,092] <err> bt_hci_driver: Endpoint binding failed with -11
    HL [00:00:02.470,092] <err> bt_hci_core: HCI driver open failed (-11)
    HL [00:00:02.470,092] <err> main: ERR_CHK Err_code: [-11] @ line: 532
    HL [00:00:02.470,123] <err> os: r0/a1:  0x00000003  r1/a2:  0x00000003  r2/a3:  0x00000002
    HL [00:00:02.470,123] <err> os: r3/a4:  0x00000003 r12/ip:  0x20003e98 r14/lr:  0x00061629
    HL [00:00:02.470,123] <err> os:  xpsr:  0x09100000
    HL [00:00:02.470,123] <err> os: s[ 0]:  0x20002780  s[ 1]:  0x000617e1  s[ 2]:  0x2001e428  s[ 3]:  0x00000004
    HL [00:00:02.470,153] <err> os: s[ 4]:  0xffffffff  s[ 5]:  0x0003bdf1  s[ 6]:  0x0003bdf1  s[ 7]:  0x2001e458
    HL [00:00:02.470,153] <err> os: s[ 8]:  0x2001e428  s[ 9]:  0xffffffff  s[10]:  0xffffffff  s[11]:  0x00061825
    HL [00:00:02.470,153] <err> os: s[12]:  0x0003bdf1  s[13]:  0x00072bb8  s[14]:  0xfffffff5  s[15]:  0x00000214
    HL [00:00:02.470,184] <err> os: fpscr:  0x0003bdf1
    HL [00:00:02.470,184] <err> os: Faulting instruction address (r15/pc): 0x00004a5c
    HL [00:00:02.470,214] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
    HL [00:00:02.470,214] <err> os: Current thread: 0x20006228 (main)
    HL [00:00:02.470,214] <err> error_handler: Caught system error -- reason 3. Entering infinite loop

    Backtracking with addr2line, the error occurs in

    // unicast_server/main:531
    
    ret = bt_mgmt_init();
    What is causing this?
    PS: This started occuring after i upgraded the nrfutl device recently
Children
No Data
Related