nrfjprog --program failed: Encountered error -102:

Hi,

I am using nRF52-DK to program a custom board based on BC832 (nRF52832 SoC).  I recently updated "nRF Connect for Desktop" and associated applications. I believe some of the drivers also got updated. After the updates I was not able to program the BC832 on the custom board nor the nRF52832 SoC on the DK itself. After updating the JLINK drivers and turning on Legacy Support, now, I am able to program the nRF52832 on board the DK but not on the target board. I am using a 10-pin SWD interface as shown below (with SB32 shorted):

I also purchased a new nRF52-DK board with Board version PCA10040.

My OS: Windows 11

My JLINK driver: V798f (64-bit) - Legacy Support Enabled 

Programming Tools used:

 - nRF Connect for Desktop -> Programmer (V4.4.0)

 - nrfjprog (Command line) (v 10.24.2)

 - nRF Connect for VS Code

I have two custom boards. One has a firmware loaded prior to software updates and the problems. The other has BC832 with factory FW. Both present different errors and corresponding logs. I have collected log files for my attempts at programming and recovering the two custom boards.

nRF52_DK_error_logs.zip

 

The log file for the case where I can successfully upload the hex file to the nRF52832 on-board the DK is given below:

program_DK_NO_ERROR_log.log

I need help urgently. I believe I have tested all the relevant solutions that I could find on the forums and Q&As but none of them worked for my custom boards.

Looking forward to your suggestions.

Regards,

Omar 

  • Hi Omar, 

    Please try to downgrade nrfjprog to 10.18.1 to see if it makes any difference. It seems to be the solution for this similiar issue: RE: nrfjprog failures 
    if it's the case then it must be the issue with the new version of either nrfjprog or Jlink. 

    To isolate the problem with the custom board. Could you try to use a DK board to program another DK board ? 
    Please try to supply power to both of the DK directly instead of supplying via the debug out port. 

    Could you point me to where you set the Legacy Support option ? 


  • Hello Hung,

    Thank you for helping me out. With nrfjprog v10.18.1 I am able to program the custom PCB. However with limited functionality. Command "nrfjprog --program" works for the first time. Then I have to repower the PCB to be able to program again. The command "nrfjprog --pinresetenable" does not work after the program command is run and times out after 10 seconds. I am attaching the log files for both the commands. I tried to downgrade the J-Link to V7.94e but everything remains the same. Legacy Support option is available on some of the versions of J-Link (see image)

    program_FW_loaded_NO_ERROR_log.log

    pinreset_FW_loaded_log.log

    Another strange behavior is that the application code does not start on power-up on this PCB. To be able to run the application code I have to perform a strange sequence of actions:

    1. Run Program Command

    2. Run Pinresetenable Command (fails)

    3. Press manual reset button.   

    I have attached relevant portion of the schematics showing the RESET pin.

    Thank you once again for helping me out,

    Regards,

    Omar 

  • The strange sequence as seen on the command prompt:

  • Hi Omar, 
    Could you try to do a nrfjprog --recover before programming ? 

    Have you disabled APPROTECT ? If you don't then it's not possible to write to UICR (pinresetenable) after the program is running (after resetting the board). 

    Could you try to test with 2DKs as I suggested? 
    Please make sure the debug cable is not too long. 
     

  • Hello Hung,

    Yes I have disabled APPROTECT in the code. I confirm that running the "nrfjprog --pinresetenable" works fine when the application is running on the target board.

    I don't have two nRF52 DKs however I have a BC832-DK. I am able to program the BC832 on that board without any issues. 

    Starting the application code on the custom board remains shoddy though. Application code only starts after the pinresetenable fails and I press the reset button. It sometimes takes multiple tries before pinresetenable fails.

    Regards,

    Omar

Related