Problem writing to nrf52840

I am using the following chip: NRF52840-QIAA-R

boggi@getshop-boggi:~/....$ nrfjprog --program /home/boggi/..../build_1/zephyr/zephyr.hex --sectoranduicrerase --verify -f NRF52 --snr 1050385234 --log
[ #################### ] 5.321s | Erase file - Done erasing
[error] [ Client] - Encountered error -102: Command program_file executed for 389 milliseconds with result -102
[error] [ nRF52] - The write access failed, but no cause could be determined.
[error] [ nRF52] - It may be due to an unaligned access, accessing a nonexistent memory, or a communication issue.
[error] [ nRF52] - Failed while performing 'Write' operation on target address 0x00000000.
-102: An unknown error.
[error] [ nRF52] - 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.
boggi@getshop-boggi:~/....$ nrfjprog --memwr 0x00000000 --val 0x12345678 -f NRF52 --log
Parsing parameters.
Writing.


boggi@getshop-boggi:~/....$ nrfjprog --memwr 0x20000000 --val 0x12345678 -f NRF52 --log
Parsing parameters.
Writing.

boggi@getshop-boggi:~/....$ nrfjprog --memwr 0x00000000 --val 0x12345678 -f NRF52 --log
Parsing parameters.
WARNING: Writing to a non-empty address may result in unexpected behavior.
Would you like to continue with the operation? [Y]/N
Writing.

boggi@getshop-boggi:~/....$ nrfjprog --memwr 0x00000000 --val 0x12345678 -f NRF52 --log
Parsing parameters.
WARNING: Writing to a non-empty address may result in unexpected behavior.
Would you like to continue with the operation? [Y]/N
Writing.

boggi@getshop-boggi:~/....$ nrfjprog --program /home/boggi/..../build_1/zephyr/zephyr.hex --sectoranduicrerase --verify -f NRF52 --snr 1050385234 --log
[ #################### ] 5.327s | Erase file - Done erasing
[error] [ Client] - Encountered error -102: Command program_file executed for 392 milliseconds with result -102
[error] [ nRF52] - The write access failed, but no cause could be determined.
[error] [ nRF52] - It may be due to an unaligned access, accessing a nonexistent memory, or a communication issue.
[error] [ nRF52] - Failed while performing 'Write' operation on target address 0x00000000.
-102: An unknown error.
[error] [ nRF52] - 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.

Is there anything I am missing here?

I attach the log for all executions above.

316576.log.log

I have also tried nrfjprog --recover --log, it executes correct, but does not help

  • update, degrading nrfjprog did give a different result:

    [ #################### ] 0.194s | Erase file - Done erasing
    [error] [ Client] - Encountered error -102: Command program_file executed for 448 milliseconds with result -102
    [error] [ nRF52] - The write access failed, but no cause could be determined.
    [error] [ nRF52] - It may be due to an unaligned access, accessing a nonexistent memory, or a communication issue.
    [error] [ nRF52] - Failed while performing Write operation on target address 203288.
    -102: An unknown error.
    [error] [ nRF52] - 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.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.


    but still.

  • Hello,

    First, can you please try:

    nrfjprog --program /home/boggi/..../build_1/zephyr/zephyr.hex --recover --verify -f NRF52 --snr 1050385234

    So exchange the --serialanduicrerase with --recover.

    Next, for the remaining "small" writes, you should add "--verify"

    What you are seeing is probably that you have the new nRF52840's which has a bit different readbackprotection. Therefore, if it is empty, readbackprotection is enabled, so the FW needs to unlock it. If you have the latest MDK, this is done automatically. 

    And you should stick to the latest version of nrfjprog, as the older ones may not be aware of this new readback protection.

    The reason --recover before doing the --program in two different options is that the recover will write a small application to the nRF, turning off readback protection. 

    Give it a go, and let me know if it doesn't work.

    Best regards,

    Edvin

  • Hi Edvin.

    Thanks for following me up.

    I still get issues.

    boggi@getshop-boggi:~/Downloads$ nrfjprog --program /home/boggi/..../build_1/zephyr/zephyr.hex --recover --verify -f NRF52 --snr 1050385234


    [ #################### ] 1.113s | Erase file - Done erasing
    [error] [ Client] - Encountered error -102: Command program_file executed for 397 milliseconds with result -102
    [error] [ nRF52] - The write access failed, but no cause could be determined.
    [error] [ nRF52] - It may be due to an unaligned access, accessing a nonexistent memory, or a communication issue.
    [error] [ nRF52] - Failed while performing 'Write' operation on target address 0x00000000.
    -102: An unknown error.
    [error] [ nRF52] - 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.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.


    boggi@getshop-boggi:~/Downloads$ nrfjprog --version
    nrfjprog version: 10.24.2 external
    JLinkARM.dll version: 7.94e
    boggi@getshop-boggi:~/Downloads$

    Attached log:

  • Ok, then we are probably looking at something else. 

    Using the same computer, same version of nrfjprog and JLink. Are you able to program other devices, such as an nRF52840 DK? 

    Are you able to program other application files to the nRF52840, or is it just this one file failing?

    What device are you trying to program? Is it a DK, or a custom board? And how did you connect it to the computer? USB cable? external debugger? External board via nRF52840 DK?

  • Hello.

    I am able to program the dev board NRF52.

    I am programming a custom board using the NRF52 dev board by shortening VDD and VTC. The custom board is connected to the SWDIO and SWDCLK, VDD_nRF, GND, and GND detect on he dev board.  The dev board is connected usb.

    If i disconnect VDD and VTC the programming possible:

    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: Flashing file: /home/boggi/..../build_1/zephyr/zephyr.hex
    [ ###### ] 0.000s | Erase file - Check ima[ ##### ] 0.000s | Check image validity -[ ########## ] 0.000s | Check image validity -[ ############### ] 0.000s | Check image validity -[ #################### ] 0.006s | Check image validity -[ ############# ] 0.000s | Erase file - Erasing [ ########## ] 0.000s | Erasing non-volatile m[ #################### ] 1.514s | Erase file - Done erasing
    [ #################### ] 3.665s | Program file - Done programming
    [ #################### ] 1.354s | Verify file - Done verifying
    Enabling pin reset.
    Applying pin reset.
    -- runners.nrfjprog: Board with serial number 1050385234 flashed successfully.
    * Terminal will be reused by tasks, press any key to close it.

Related