<?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>Enable/Disable JTAG in SLM nRF9160</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73272/enable-disable-jtag-in-slm-nrf9160</link><description>Hi 
 
 In the final SLM version , please provide an option to disable and enable JTAG in software (thru AT command or by some means) 
 As part of security, this is needed 
 
 Regards 
 Sharath</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 31 May 2021 13:08:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73272/enable-disable-jtag-in-slm-nrf9160" /><item><title>RE: Enable/Disable JTAG in SLM nRF9160</title><link>https://devzone.nordicsemi.com/thread/312648?ContentTypeID=1</link><pubDate>Mon, 31 May 2021 13:08:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d554e8df-85eb-45ff-9abf-3a6a99200a55</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Praveen,&lt;/p&gt;
&lt;p&gt;If you have any faults in the nRF9160 you can make sure to save the latest URCs in the external MCUs Flash for example.&lt;br /&gt;&lt;br /&gt;or&amp;nbsp;&lt;br /&gt;Just enable the necessary debug logging/UART GPIO changes for example in the spesific application that you use when re-flashing the device in the field.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Martin L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enable/Disable JTAG in SLM nRF9160</title><link>https://devzone.nordicsemi.com/thread/312345?ContentTypeID=1</link><pubDate>Fri, 28 May 2021 11:39:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0424dda-1d92-4025-b295-8e3b5379a3f8</guid><dc:creator>praveenpalaparthi</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The suggestion you gave is valid, but before re flashing the unit with debug code, if we want to read the logs from the faulty unit how we can get the logs.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can we have AT Command to read RTT logs through serial interface.&lt;/p&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;p&gt;Through serial AT command to enable disable RTT logs&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;With regards,&lt;/div&gt;
&lt;div&gt;Praveen Palaparthi&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enable/Disable JTAG in SLM nRF9160</title><link>https://devzone.nordicsemi.com/thread/310018?ContentTypeID=1</link><pubDate>Tue, 18 May 2021 06:55:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c01d221-433b-46ec-940d-57579785e32d</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Sharath,&lt;br /&gt;&lt;br /&gt;Regarding security, I strongly suggest against another solution than using APPROTECT, e.g. where you could &amp;quot;disable&amp;quot;/&amp;quot;enable&amp;quot; JTAG with an AT command.&lt;br /&gt;&lt;br /&gt;If you really need access to the JTAG port for a device in the field, then you could just connect, erase the application and re-flash the same application then you can debug as much as you&amp;#39;d like.&lt;br /&gt;I think that is the best current solution and also secure against any other people getting access to the application.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Please specify why you would like to access the JTAG port for a device out in the field.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Martin L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enable/Disable JTAG in SLM nRF9160</title><link>https://devzone.nordicsemi.com/thread/307847?ContentTypeID=1</link><pubDate>Mon, 03 May 2021 08:32:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a441ecc-bd1d-41b7-b5f0-b62d2aac8b79</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Sharath,&lt;br /&gt;&lt;br /&gt;As mentioned earlier and referenced to the documentation:&lt;/p&gt;
[quote user="male"]&lt;blockquote&gt;&lt;div&gt;Martin Lesund said:&lt;/div&gt;&lt;div&gt;Only way to recover from only APPROTECT enabled is an full erase of the FLASH.&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fnan_041%2FAPP%2Fnan_production_programming%2Fonly_APPROTECT_enabled.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fnan_041%2FAPP%2Fnan_production_programming%2Fonly_APPROTECT_enabled.html&lt;/a&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;&lt;br /&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Martin L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enable/Disable JTAG in SLM nRF9160</title><link>https://devzone.nordicsemi.com/thread/307822?ContentTypeID=1</link><pubDate>Mon, 03 May 2021 05:27:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6005a4fc-d820-4c5e-9aab-d73c84d52f4c</guid><dc:creator>SharathMalve</dc:creator><description>&lt;p&gt;Hi Martin&lt;/p&gt;
&lt;p&gt;For a JTAG&amp;nbsp;&lt;strong&gt;APPROTECT&lt;/strong&gt; locked field returned unit , if a developer wants to analyze how to unlock jtag and debug/analyze (without erasing FLASH)&lt;/p&gt;
&lt;p&gt;Any provision to inlock jtag &lt;strong&gt;APPROTECT&lt;/strong&gt;?&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Sharath&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enable/Disable JTAG in SLM nRF9160</title><link>https://devzone.nordicsemi.com/thread/304978?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 07:18:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af5eb15a-f9a7-44d0-b56b-8bbe3607899d</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Sharath,&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;APPROTECT protects the physical debug interface. (see the doc.)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;FOTA etc. is of course possible since that is not done over the debug port.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Martin L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enable/Disable JTAG in SLM nRF9160</title><link>https://devzone.nordicsemi.com/thread/304976?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 07:16:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c53f1470-1161-4f10-aa2b-5af9f56a4325</guid><dc:creator>SharathMalve</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If we need to do FOTA I think it will allow (when in APPROTECT MODE)....?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Sharath&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enable/Disable JTAG in SLM nRF9160</title><link>https://devzone.nordicsemi.com/thread/304974?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 07:12:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5b55b17-7b88-4890-b905-75d0a1876f6a</guid><dc:creator>Martin Lesund</dc:creator><description>[quote user="male"]Only way to recover from only APPROTECT enabled is an full erase of the FLASH.[/quote]
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fnan_041%2FAPP%2Fnan_production_programming%2Fonly_APPROTECT_enabled.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fnan_041%2FAPP%2Fnan_production_programming%2Fonly_APPROTECT_enabled.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enable/Disable JTAG in SLM nRF9160</title><link>https://devzone.nordicsemi.com/thread/304972?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 07:09:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4612b9d7-4fbb-45b5-b3bd-b12608952c19</guid><dc:creator>SharathMalve</dc:creator><description>&lt;p&gt;Thanks Martin&lt;/p&gt;
&lt;p&gt;We will validate this&lt;/p&gt;
&lt;p&gt;Other point: To unlock jtag &lt;span&gt;APPROTECT&amp;nbsp;&lt;/span&gt;, can I do a FOTA (FOTA file having function to unlock JTAG when it gets executed)&lt;/p&gt;
&lt;p&gt;What are the options to unlock JTAG&amp;nbsp;&lt;span&gt;APPROTECT&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Sharath&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enable/Disable JTAG in SLM nRF9160</title><link>https://devzone.nordicsemi.com/thread/304882?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 14:44:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd0a3aab-cbc8-4cf7-a5bd-d71e8cd17148</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Sharath,&lt;br /&gt;&lt;br /&gt;As referred in the documentation you can either use the standard SWD interface yourself or use our &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf_cltools%2FUG%2Fcltools%2Fnrf_nrfjprogexe_reference.html&amp;amp;resultof=%22%6e%72%66%6a%70%72%6f%67%22%20" rel="noopener noreferrer" target="_blank"&gt;&amp;quot;nrfjprog&amp;quot; command&lt;/a&gt; line tool.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Option (&lt;em&gt;in my opinion this is the easiest&lt;/em&gt;)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Open your command prompt --&amp;gt;&lt;/p&gt;
&lt;p&gt;First command reads the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf9160%2Fuicr.html&amp;amp;cp=2_0_0_3_5&amp;amp;anchor=register.APPROTECT" rel="noopener noreferrer" target="_blank"&gt;UICR.APPROTECT&lt;/a&gt;&lt;span&gt;&amp;nbsp;register:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;&lt;a title="A register used to prevent read and write access to all CPU registers and memory-mapped addresses." href="https://infocenter.nordicsemi.com/topic/nan_041/dita_common/glossary/glossary.html#approtect"&gt;&lt;dfn&gt;APPROTECT&lt;/dfn&gt;&lt;/a&gt;&amp;nbsp;blocks debugger read/write access to all CPU registers and memory mapped addresses.&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfjprog --memrd 0x00FF8000&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If this register has a value other than&amp;nbsp;&lt;/span&gt;&lt;span&gt;0xFFFFFFFF&lt;/span&gt;&lt;span&gt;, it is protected.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here you can see my device is not protected:&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/6201.pastedimage1618406402221v1.png" alt=" " /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So from the &amp;quot;device protection section&amp;quot; from my last post:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;write any value other than&amp;nbsp;&lt;span&gt;0xFFFFFFFF&lt;/span&gt;&amp;nbsp;to it, The protection activates after a reset&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So I write to this to the UICR.APPROTECT register with the command:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfjprog --memwr 0x00FF8000 --val 0x00000000&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then read out the register to make sure it is written using the previous command.&lt;/p&gt;
&lt;p&gt;If I reset the device now it it will register the change and you will not be able to reach the device with the debugger.&lt;/p&gt;
&lt;p&gt;As you see here I cannot read out any registers etc.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2335.pastedimage1618406771019v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fnan_041%2FAPP%2Fnan_production_programming%2Fonly_APPROTECT_enabled.html" rel="noopener noreferrer" target="_blank"&gt;Only way to recover from only APPROTECT enabled is an full erase of the FLASH.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;e.g.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfjprog --recover&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;----------------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;Another way to enable APPROTECT is to use the dedicated nrfjprog command:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfjprog --rbp ALL&lt;/pre&gt;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/4666.pastedimage1618468428228v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Which basically does the same thing &amp;quot;under the hood&amp;quot; as shown with writing to the registers, but you do not need to reset the device for the readback protection to take in effect.&lt;/p&gt;
&lt;p&gt;So if you want to make sure no-one can erase the flash as well you enable the ERASEPROTECT register as well.&amp;nbsp;&lt;br /&gt;However that should be avoided when only testing since it is very hard to recover from.&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fnan_041%2FAPP%2Fnan_production_programming%2Fapprotect_eraseprotect_enabled.html&amp;amp;cp=2_0_8_6_0_0" rel="noopener noreferrer" target="_blank"&gt;APPROTECT and ERASEPROTECT are enabled&lt;/a&gt;&amp;nbsp;&lt;br /&gt;It is recommended only under the final production phase when you know everything is set correctly and the device is ready.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;2. Option (&lt;/strong&gt;&lt;em&gt;using the SWD protocol)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;in this example we use the Jlink on board to access the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf9160%2Fchapters%2Fdif%2Fctrl-ap.html&amp;amp;cp=2_0_0_8_1" rel="noopener noreferrer" target="_blank"&gt;CTRL-AP&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Open up &amp;quot;J-Link commander&amp;quot;&lt;/p&gt;
&lt;p&gt;Use command &amp;quot;?&amp;quot; to see full list of optional commands.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;SWDSelect   // Activate SWD
SWDWriteDP 1 0x50000000  // Enable debug power
SWDWriteDP 2 0x04000000  // Selects the 0x04XXXXXX Access Port and 0xXXXX00XX Register bank in the access port

SWDReadAP 3 // CTRL-AP Bank 0, register offset 3 (APPROTECTSTATUS 0x00C): Access port protection status
SWDReadAP 3 // //Second read returns the value: 0: enabled 1: not enabled&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/3225.pastedimage1618468074448v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So here you can see I get:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;0x00000003&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;and that is&lt;/p&gt;
&lt;p&gt;&lt;em&gt;0000 0000&amp;nbsp;0000&amp;nbsp;0000 0000 0000 0000 &lt;strong&gt;0011&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;in binary, so we can see from the APPROTECT.STATUS that both APPROTECT and SECUREPROTECT is disabled:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/3808.pastedimage1618468057876v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;(ONGOING, I WILL UPDATE the rest of the information SOON)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Martin L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enable/Disable JTAG in SLM nRF9160</title><link>https://devzone.nordicsemi.com/thread/302056?ContentTypeID=1</link><pubDate>Tue, 23 Mar 2021 07:09:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b16fe3e9-b9d2-4758-a389-186419751778</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Sharath,&lt;br /&gt;&lt;br /&gt;This is already supported by for example using nrfjprog.&lt;/p&gt;
&lt;p&gt;Please go through the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fnan_041%2FAPP%2Fnan_production_programming%2Fintro.html&amp;amp;cp=2_0_8" rel="noopener noreferrer" target="_blank"&gt;Production Programming note&lt;/a&gt;&amp;nbsp;in the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fnan_041%2FAPP%2Fnan_production_programming%2Fdevice_protection.html" rel="noopener noreferrer" target="_blank"&gt;device protection section&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Martin L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>