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,

    Could you please rerun the nrfutil device command with the --log-level trace option:

    nrfutil device program --firmware /Users/soham/ksham/pcb-tests/led-test/build/merged.hex --log-level trace

    Then share the log file located at <USERHOME>/.nrfutil/logs/nrfutil-device.log?

    Since there are two different errors occurring, it would be helpful if you could try to reproduce both issues and generate logs for each. If you’re unable to reproduce both with the above command alone, please try adding the following option:

    --options chip_erase_mode=ERASE_RANGES_TOUCHED_BY_FIRMWARE

    Additionally, it would be useful if you could run:

    nrfjprog --program /Users/soham/ksham/pcb-tests/led-test/build/merged.hex --chiperase --log log.txt

    and share the log.txt file. There might be J-Link stability issues with your board that nrfjprog is handling silently, and we might be able to catch that in the log.

    One more clarification: In one of your earlier responses, you mentioned that the issue started occurring after upgrading the nrfutil device tool. Does that mean you were able to flash the firmware successfully before the upgrade?

    Kind regards,
    Abhijith

Reply
  • Hello,

    Could you please rerun the nrfutil device command with the --log-level trace option:

    nrfutil device program --firmware /Users/soham/ksham/pcb-tests/led-test/build/merged.hex --log-level trace

    Then share the log file located at <USERHOME>/.nrfutil/logs/nrfutil-device.log?

    Since there are two different errors occurring, it would be helpful if you could try to reproduce both issues and generate logs for each. If you’re unable to reproduce both with the above command alone, please try adding the following option:

    --options chip_erase_mode=ERASE_RANGES_TOUCHED_BY_FIRMWARE

    Additionally, it would be useful if you could run:

    nrfjprog --program /Users/soham/ksham/pcb-tests/led-test/build/merged.hex --chiperase --log log.txt

    and share the log.txt file. There might be J-Link stability issues with your board that nrfjprog is handling silently, and we might be able to catch that in the log.

    One more clarification: In one of your earlier responses, you mentioned that the issue started occurring after upgrading the nrfutil device tool. Does that mean you were able to flash the firmware successfully before the upgrade?

    Kind regards,
    Abhijith

Children
No Data
Related