The issue where protect is automatically enabled every time the firmware is written

Hello,

I have a question regarding a recent issue.

I'm currently developing with the nRF52840 IC or EVM, and I'm facing a problem. Whenever I write firmware to the flash, it seems that the read-protect mode is automatically enabled. This makes development very difficult, as I have to perform recovery mode every time.

There were no such issues with the previous IC.

Could you please help me find a solution? I would greatly appreciate your assistance.

Parents
  • Hello,

    For the nRF 5 SDK, to disable the access port protection for debugging, follow these steps:

    a. Run nrfjprog --recover -f nrf52

    b. Compile your code without the ENABLE_APPROTECT define.

    c. Write HwDisabled (0x5A) to UICR.APPROTECT. This can be done in your code.

    d. Flash the compiled code and perform any reset to run the code. The programmed code will open the access port by writing to APPROTECT.DISABLE during start-up.

    If you want to keep the debug interface open across power cycles, you need to add code at the beginning of your application to disable APPROTECT. Here's an example of how to do this:
    NRF_APPROTECT->DISABLE = APPROTECT_DISABLE_DISABLE_SwDisable;

    By implementing these steps, you should be able to keep the debug interface open and avoid having to perform recovery mode every time you flash new firmware.

    How to correctly disable APPPROTECT is also detailed in the following ticket:  Unresponsive device when flashing after disabling APPPROTECT 

    Best Regards,

    Swathy 

Reply
  • Hello,

    For the nRF 5 SDK, to disable the access port protection for debugging, follow these steps:

    a. Run nrfjprog --recover -f nrf52

    b. Compile your code without the ENABLE_APPROTECT define.

    c. Write HwDisabled (0x5A) to UICR.APPROTECT. This can be done in your code.

    d. Flash the compiled code and perform any reset to run the code. The programmed code will open the access port by writing to APPROTECT.DISABLE during start-up.

    If you want to keep the debug interface open across power cycles, you need to add code at the beginning of your application to disable APPROTECT. Here's an example of how to do this:
    NRF_APPROTECT->DISABLE = APPROTECT_DISABLE_DISABLE_SwDisable;

    By implementing these steps, you should be able to keep the debug interface open and avoid having to perform recovery mode every time you flash new firmware.

    How to correctly disable APPPROTECT is also detailed in the following ticket:  Unresponsive device when flashing after disabling APPPROTECT 

    Best Regards,

    Swathy 

Children
No Data
Related