nrfjprog failures

I'm working on custom test software for use in production programming/testing of my product containing a nRF9160. I'm using the nrfjprog executable, but with problems, every second call to nrfjprog --program is failing:

D:\[path here]\nrfjprog\nrfjprog 
--ini D:\[path here]\nrfjprog\nrfjprog.ini 
-f NRF91 
-c 4000 
-s [serial here] 
--program D:\[path here]\temp_files\74e8207a-5983-41e5-b1e6-45eaa2d0f0fb.hex 
--sectorerase 
--verify 
--log 
[error] [ Client] - Encountered error -102: Command program_file executed for 188 milliseconds with result -102 
[error] [ nRF91] - The write access failed, but no cause could be determined. 
[error] [ nRF91] - It may be due to an unaligned access, accessing a nonexistent memory, or a communication issue. 
[error] [ nRF91] - Failed while performing 'Write' operation on target address 0x00000000. -102: An unknown error. 
[error] [ nRF91] - Failed while reading device information. 
[error] [ Worker] - An unknown error. ERROR: JLinkARM DLL reported an error. Try again. If error condition ERROR: persists, run the same command again with argument --log, contact Nordic ERROR: Semiconductor and provide the generated log.log file to them.

The log file is attached.

nrfjprog v10.22.1

JLINK v7.80c

nrf connect system report:

# nRFConnect System Report - 2023-07-17T12-26-40.066Z

- System:     Acer Aspire TC-885
- BIOS:       American Megatrends Inc ACRSYS - 1072009
- CPU:        1 x Intel Core™ i7-8700 3.2 GHz 12 cores (6 physical)
- Memory:     5.3 GB free of 15.9 GB total
- Filesystem: C: (NTFS) 930.9 GB 47.6% used

- OS:         Microsoft Windows 10 Home (10.0.19045) Windows x64

- Versions
    - kernel: 10.0.19045
    - git: 2.30.0.windows.1
    - node: 16.17.1
    - python: 3.11.0
    - python3: 3.10.11
    - nrf-device-lib-js: 0.6.12
    - nrf-device-lib: 0.15.3
    - nrfjprog DLL: 10.19.1
    - JLink: JLink_V7.80c

- Connected devices:
    - CAFEBABE : COM24
    - 000600105884 Unknown: undefined
    - {34C052A1-08B6-5809-881E-95820D434537} : COM21
    - FTXP9XD7 : COM10
    - {921BE77D-DA9D-11ED-A25F-94C69193D3EE} : COM7, COM8

6712.log.log

Parents Reply Children
  • Thank you for checking.

    How are you connecting the DK by the way? Are you connecting the USB directly to your PC, or via a hub?

    There is no COM port connected to the DK when trying to flash for the first time, right?

    Best regards,

    Michal

  • Not sure what you mean with 'DK', but if it is the debug probe, this is connected directly to the PC, no hubs.

    I've two situations with programming troubles:

    - The testboard situation, where the DUT is tested and programmed, here is also a USB<->UART connected. In this case NRFJPROG is called from my test software. In this case every second try succeeds.

    - Programming in development from VSCode. In this case programming always fails, only full erase works, not '--sectorerase'.

    I also tested without USB<->UART connected, no change. When i change the debug probe from a JLink plus to a Jlink base the error message in VSCode changes slightly.

    This is with the plus version:

    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: Flashing file: D:\[PATH]\merged.hex
    [ #################### ]  13.455s | Erase file - Done erasing                                                          
    [error] [  nRF91] - The write access failed, but no cause could be determined.                                         
    [error] [  nRF91] - It may be due to an unaligned access, accessing a nonexistent memory, or a communication issue.
    [error] [  nRF91] - Failed while performing 'Write' operation on target address 0x00000000. 
    -102: An unknown error.
    [error] [  nRF91] - Failed while reading device information.
    [error] [ Worker] - An unknown error.
    [error] [ Client] - Encountered error -102: Command program_file executed for 203 milliseconds with result -102
    ERROR: JLinkARM DLL reported an error. Try again. If error condition
    ERROR: persists, run the same command again with argument --log, contact Nordic
    ERROR: Semiconductor and provide the generated log.log file to them.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.
    FATAL ERROR: command exited with status 33: nrfjprog --program 'D:\[path]\merged.hex' --sectorerase --verify -f NRF91 --snr [serial]

    And with the base version:

    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: Flashing file: D:\[path]\merged.hex
    [error] [ Client] - Encountered error -102: Command erase_file executed for 217 milliseconds with result -102          
    [error] [  nRF91] - Failed while performing 'Erase' operation on target address 0x00000000. 
    -102: JLinkARM.dll WriteU32 returned error -1.
    [error] [  nRF91] - Failed while erasing device. -102: JLinkARM.dll WriteU32 returned error -1.
    [error] [ Worker] - JLinkARM.dll WriteU32 returned error -1.
    ERROR: JLinkARM DLL reported an error. Try again. If error condition
    ERROR: persists, run the same command again with argument --log, contact Nordic
    ERROR: Semiconductor and provide the generated log.log file to them.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.
    FATAL ERROR: command exited with status 33: nrfjprog --program 'D:\[PATH]\merged.hex' --sectorerase --verify -f NRF91 --snr [serial]

    With the plus version I am able to execute a sector erase in J-Flash without problems.

Related