Flashing failed due to protection on the device

OS: Windows 10
NCS: 2.0.0

I am working on the Nordic DFU NCS Guide on a nRF52833 DK  devzone.nordicsemi.com/.../ncs-dfu

After flashing/debugging several times, I started seeing the message below.  I responded with "yes".   Now I am not able to "debug".  I can only "flash" it. 

I thought something was wrong with the board, so I used a brand new nRF52833DK.  The same thing started happening.  

Any idea of what is going on?

Parents
  • Hi,

    I have reproduced your issue by erasing the board and power cycling it, but as soon as the board was recovered the issue disappeared.
    After you recover the board with

    nrfjprog --recover

    or from VS Code, APPRPOTECT should be disabled. Normally, it should stay in disabled state unless your application enables it. You can check which APPROTECT options you have enabled in your application by looking at .config file in your build\zephyr folder. You can find more information about APPROTECT in the documentation. 


    Best regards,
    Dejan

  • dejans,

    Thank you for the response.  Yes, I had already tried "nrfjprog --recover".  That did not resolve the issue.

    I went through your recommendations, the only APPRPOTECT in build\Zephyr\.config are:

    CONFIG_NRF_APPROTECT_USE_UICR=y
    # CONFIG_NRF_APPROTECT_LOCK is not set

    I added the below to prj.conf, but .config stayed the same.
    CONFIG_NRF_APPROTECT_USE_UICR=n

    Even if I run "nrfjprog --recover" and try to program a completely different application (BLE app), I get the same error.  You can see in the terminal the --recover option is run when I "flash", followed by a power cycle, and then try to "debug".


  • Hi,

    I have tried to reproduce your issue without success. Upon pressing  Debug I got error "Unable to read registers" and debug ended up in cortex_m -> fault_s.S. I have used NCS v2.2.0 and nRF52833-DK board v1.1.0. The error is shown below.



    I do not see from your video that you set a break point somewhere in the code.

    Which board version did you use?

    Best regards,
    Dejan

  • Dejan,

    It doesn't always happen the first time.  It appears to be very random, but once it happens I can not debug.I have two boards on my desk with the failure (other boards are at home).

    I do not see from your video that you set a break point somewhere in the code.

    I can not set a breakpoint, single step, or do any sort of debug.

    Board 1

    1.1.0

    2022.15

    Board 2

    1.1.0

    2022.5

  • Hi,

    I have tested with another nRF52-DK v1.1.0 board. I could not reproduce your error, but managed to reproduce what I saw using my other nRF52-DK. 

    Best regards,
    Dejan

  • I have tested with another nRF52-DK v1.1.0 board. I could not reproduce your error, but managed to reproduce what I saw using my other nRF52-DK.

    Dejans - Just to be clear, you were able to reproduce the error on the nRF52-DK?

  • Hi,

    Bryan said:
    Just to be clear, you were able to reproduce the error on the nRF52-DK?

    Thank you for pointing this out and asking for clarification. I made a typing mistake. I am sorry for the confusion. Both boards I was testing on were nRF52833-DK v1.1.0 and not nRF52-DK v1.1.0.

    Best regards,
    Dejan

Reply Children
Related