<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF52840 JTAG disable and don&amp;#39;t recover through any JTAG Debugger.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84669/nrf52840-jtag-disable-and-don-t-recover-through-any-jtag-debugger</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 14 Feb 2022 06:53:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84669/nrf52840-jtag-disable-and-don-t-recover-through-any-jtag-debugger" /><item><title>RE: nRF52840 JTAG disable and don't recover through any JTAG Debugger.</title><link>https://devzone.nordicsemi.com/thread/352798?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 06:53:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96d043fa-3931-49c0-a869-577540e397ee</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;As I explained previously,&amp;nbsp;&lt;span&gt;BRPOT&amp;nbsp;only protects the memory (which Bootloader&amp;nbsp;locates) to prevent application code from erasing or writing to protected blocks instead of Ctrl-AP erase.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 JTAG disable and don't recover through any JTAG Debugger.</title><link>https://devzone.nordicsemi.com/thread/352721?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 19:13:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b93260ef-8d15-4b45-b8ab-cdc1b68af726</guid><dc:creator>Siddharth Kachhia</dc:creator><description>&lt;p&gt;If I want to protect Bootloader from JTAG or Debugger Read, then does BPROT protects Bootloader or not ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 JTAG disable and don't recover through any JTAG Debugger.</title><link>https://devzone.nordicsemi.com/thread/352638?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 13:32:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68a78ec4-d7c3-42b6-9077-7ecbf7b2cf90</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Siddharth Kachhia"]So Suppose If I have protected 1 memory blocks through BPROT(Block Protection) register, though ERASEALL command via CTRL-AP can erase my entire flash, UICR, and RAM ?[/quote]
&lt;p&gt;Yes, see&amp;nbsp;&lt;a title="ERASEALL" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/dif.html?cp=4_0_0_3_7_2_0_1#register.ERASEALL"&gt;ERASEALL&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
[quote user="Siddharth Kachhia"]Does BPROT protect bootloader blocks or only application code ?[/quote]
&lt;p&gt;Yes, see&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52805/bprot.html?cp=4_6_0_5_2"&gt;BPROT — Block protection&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 JTAG disable and don't recover through any JTAG Debugger.</title><link>https://devzone.nordicsemi.com/thread/352634?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 13:28:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4875e970-aa3f-4c3b-9837-7b87253e77a1</guid><dc:creator>Siddharth Kachhia</dc:creator><description>&lt;p&gt;So Suppose If I have protected 1 memory blocks through BPROT(Block Protection) register, though ERASEALL command via CTRL-AP can erase my entire flash, UICR, and RAM ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Does BPROT protect bootloader blocks or only application code ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 JTAG disable and don't recover through any JTAG Debugger.</title><link>https://devzone.nordicsemi.com/thread/352616?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 13:09:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23fe7133-7103-49c8-9a2e-1c53df6843f1</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BRPOT&amp;nbsp;only protects the memory to prevent application code from erasing or writing to protected blocks instead of Ctrl-AP erase, so&amp;nbsp;it should erase the chip regardless of the BRPOT config.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="Siddharth Kachhia"]How to erase/write Ctrl-AP port Reg from cmd line ?[/quote]
&lt;p&gt;See the commands in&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/working-with-the-nrf52-series-improved-approtect"&gt;Working with the nRF52 Series&amp;#39; improved APPROTECT&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 JTAG disable and don't recover through any JTAG Debugger.</title><link>https://devzone.nordicsemi.com/thread/352576?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 11:38:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb11a252-e66d-4fd6-9414-6a9022e7dc16</guid><dc:creator>Siddharth Kachhia</dc:creator><description>&lt;p&gt;Ctrl-AP erase can also erase BPROT - Block Protection area of flash or not ?&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1 class="title topictitle1"&gt;&lt;/h1&gt;
&lt;p&gt;If I have protected some flash area with BPROT then Ctrl-AP can erase it or not ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 JTAG disable and don't recover through any JTAG Debugger.</title><link>https://devzone.nordicsemi.com/thread/352541?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 10:29:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e2200b9-aec5-43fd-b22f-e9ed934bec46</guid><dc:creator>Siddharth Kachhia</dc:creator><description>&lt;p&gt;How to erase/write Ctrl-AP port Reg from cmd line ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 JTAG disable and don't recover through any JTAG Debugger.</title><link>https://devzone.nordicsemi.com/thread/352528?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 09:59:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08c8c381-8c78-4bc5-a6fa-b02023de2271</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;&lt;span&gt;No, not in software, but you could close the JTAG or SWD port in hardware.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 JTAG disable and don't recover through any JTAG Debugger.</title><link>https://devzone.nordicsemi.com/thread/352520?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 09:48:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e64efbb4-9fd1-482b-a9b1-79a230b054b1</guid><dc:creator>Siddharth Kachhia</dc:creator><description>&lt;p&gt;Is it possible to fully disable JTAG and/or SWD?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 JTAG disable and don't recover through any JTAG Debugger.</title><link>https://devzone.nordicsemi.com/thread/352513?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 09:34:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b6e7737-fef6-4957-b1ea-d07de0b5787b</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user=""]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 &lt;br /&gt;flash img and rd/wr register through nrfjprog utility.[/quote]
&lt;p&gt;Yes, this is the new feature of APPROTECT in the nRF52840 Rev3.&amp;nbsp;&lt;/p&gt;
[quote user=""]1) What does --recover do with nrfjprog utility ? Is it write/reset any ctrl-AP register to enable JTAG/Debug lines again ?[/quote]
&lt;p&gt;Writing image to disable ap protect, and Erasing user code and UICR flash areas. It&amp;nbsp;&lt;span&gt;erases the device and writes UICR.APPROTECT to HwDisabled (0x5A).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]2) Can I disable --recover in board through any register so that in the field Flash read/write can be disable through any JTAG ?[/quote]
&lt;p&gt;No, this is not support to disable&amp;nbsp;&lt;span&gt;--recover.&lt;/span&gt;&lt;/p&gt;
[quote user=""]3) If I want to disable JTAG/Debug lines in future, what are the options available for that ?[/quote]
&lt;p&gt;To unlock the device debug port (for debugging etc.), execute the following steps to disable the access port protection: &lt;br /&gt;1. Start with a CTRL-AP ERASEALL operation. &lt;br /&gt;2. Program code compiled with MDK 8.40.2 or later, without ENABLE_APPROTECT defined. &lt;br /&gt;3. Write HwDisabled (0x5A) to UICR.APPROTECT &lt;br /&gt;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.&lt;/p&gt;
&lt;p&gt;See&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/pdf/in_141_v1.1.pdf"&gt;https://infocenter.nordicsemi.com/pdf/in_141_v1.1.pdf&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, have a look at this&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/working-with-the-nrf52-series-improved-approtect"&gt;Working with the nRF52 Series&amp;#39; improved APPROTECT&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>