nRF52840 JTAG disable and don't recover through any JTAG Debugger.

Hi Team!

Currently I an working on disabling JTAG/Debug and SWD lines to protect code from read/write through any JTAG debugger.

For this, I have used nrfjprog utility and rbp command to disable JTAG read/write/erase. I have performed it and it works perfectly.
Now to enable JTAG again, I need to use nrfjprog --recover, which erase flash and UICR to enable flash rd/wr again. After --recover, I can do
flash img and rd/wr register through nrfjprog utility.

Question:
1) What does --recover do with nrfjprog utility ? Is it write/reset any ctrl-AP register to enable JTAG/Debug lines again ?
2) Can I disable --recover in board through any register so that in the field Flash read/write can be disable through any JTAG ?
3) If I want to disable JTAG/Debug lines in future, what are the options available for that ?

Thanks in Advance!

Parents
  • Hi, 

    Now to enable JTAG again, I need to use nrfjprog --recover, which erase flash and UICR to enable flash rd/wr again. After --recover, I can do
    flash img and rd/wr register through nrfjprog utility.

    Yes, this is the new feature of APPROTECT in the nRF52840 Rev3. 

    1) What does --recover do with nrfjprog utility ? Is it write/reset any ctrl-AP register to enable JTAG/Debug lines again ?

    Writing image to disable ap protect, and Erasing user code and UICR flash areas. It erases the device and writes UICR.APPROTECT to HwDisabled (0x5A). 

    2) Can I disable --recover in board through any register so that in the field Flash read/write can be disable through any JTAG ?

    No, this is not support to disable --recover.

    3) If I want to disable JTAG/Debug lines in future, what are the options available for that ?

    To unlock the device debug port (for debugging etc.), execute the following steps to disable the access port protection:
    1. Start with a CTRL-AP ERASEALL operation.
    2. Program code compiled with MDK 8.40.2 or later, without ENABLE_APPROTECT defined.
    3. Write HwDisabled (0x5A) to UICR.APPROTECT
    4. Perform any reset to run the code. The programmed code from step 2 will open access port by writing to APPROTECT.DISABLE during startup.

    See https://infocenter.nordicsemi.com/pdf/in_141_v1.1.pdf  

    Also, have a look at this Working with the nRF52 Series' improved APPROTECT 

    Regards,
    Amanda

Reply
  • Hi, 

    Now to enable JTAG again, I need to use nrfjprog --recover, which erase flash and UICR to enable flash rd/wr again. After --recover, I can do
    flash img and rd/wr register through nrfjprog utility.

    Yes, this is the new feature of APPROTECT in the nRF52840 Rev3. 

    1) What does --recover do with nrfjprog utility ? Is it write/reset any ctrl-AP register to enable JTAG/Debug lines again ?

    Writing image to disable ap protect, and Erasing user code and UICR flash areas. It erases the device and writes UICR.APPROTECT to HwDisabled (0x5A). 

    2) Can I disable --recover in board through any register so that in the field Flash read/write can be disable through any JTAG ?

    No, this is not support to disable --recover.

    3) If I want to disable JTAG/Debug lines in future, what are the options available for that ?

    To unlock the device debug port (for debugging etc.), execute the following steps to disable the access port protection:
    1. Start with a CTRL-AP ERASEALL operation.
    2. Program code compiled with MDK 8.40.2 or later, without ENABLE_APPROTECT defined.
    3. Write HwDisabled (0x5A) to UICR.APPROTECT
    4. Perform any reset to run the code. The programmed code from step 2 will open access port by writing to APPROTECT.DISABLE during startup.

    See https://infocenter.nordicsemi.com/pdf/in_141_v1.1.pdf  

    Also, have a look at this Working with the nRF52 Series' improved APPROTECT 

    Regards,
    Amanda

Children
Related