<?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>How do I disable control access port protection on nRF52 using openOCD?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17015/how-do-i-disable-control-access-port-protection-on-nrf52-using-openocd</link><description>I am using openOCD as the debugger for my nRF52 device. Nothing is working anymore. I am seeing errors like: 
 $ Error: Could not find MEM-AP to control the core 
 $ Error: Target not examined yet 
 whenever I try to do a command. I think the chip</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 31 Oct 2020 11:08:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17015/how-do-i-disable-control-access-port-protection-on-nrf52-using-openocd" /><item><title>RE: How do I disable control access port protection on nRF52 using openOCD?</title><link>https://devzone.nordicsemi.com/thread/277906?ContentTypeID=1</link><pubDate>Sat, 31 Oct 2020 11:08:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3be2a01d-6ac1-41a4-91cc-a31a54a97e0f</guid><dc:creator>caligari</dc:creator><description>&lt;p&gt;You need a programmer capable of managing the DAP protocol (stlink does not). Try an &lt;a href="https://www.aliexpress.com/wholesale?SearchText=cmsis&amp;amp;SortType=price_asc" rel="noopener noreferrer" target="_blank"&gt;8-dollar cmsis-dap&lt;/a&gt; with &lt;span style="font-family:courier new, courier;"&gt;-f interface/cmsis-dap&lt;/span&gt; and be sure that pin 21 (reset) is pulled-up.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I disable control access port protection on nRF52 using openOCD?</title><link>https://devzone.nordicsemi.com/thread/277369?ContentTypeID=1</link><pubDate>Wed, 28 Oct 2020 11:36:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3391a34e-0025-4892-955d-1b0eb641491d</guid><dc:creator>Ideje</dc:creator><description>&lt;p&gt;Doesn&amp;#39;t work for me, AP still locked&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I disable control access port protection on nRF52 using openOCD?</title><link>https://devzone.nordicsemi.com/thread/245406?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 03:18:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ec6e773-8cd6-4f95-bbc0-f0de9e001b0d</guid><dc:creator>karelv</dc:creator><description>&lt;p&gt;4 years old, and the answer is still valid!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I just&amp;nbsp;wanted to share that the instructions are a little updated now.&lt;/p&gt;
&lt;p&gt;=&amp;gt; nrf52.dap apreg 1 0x0C&lt;/p&gt;
&lt;p&gt;=&amp;gt; nrf52.dap apreg 1 0x04 0x01&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I disable control access port protection on nRF52 using openOCD?</title><link>https://devzone.nordicsemi.com/thread/65293?ContentTypeID=1</link><pubDate>Thu, 13 Oct 2016 08:10:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4c8bdfc-7a09-4733-a225-58cc6ae049f0</guid><dc:creator>Michael Dietz</dc:creator><description>&lt;p&gt;See section &lt;a href="http://openocd.org/doc/html/Architecture-and-Core-Commands.html"&gt;16.5.1 ARMv7 Debug Access Port (DAP) specific commands&lt;/a&gt; for more info on these openOCD commands.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I disable control access port protection on nRF52 using openOCD?</title><link>https://devzone.nordicsemi.com/thread/65292?ContentTypeID=1</link><pubDate>Wed, 12 Oct 2016 13:05:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d90f46a5-a0d1-40a9-8a01-78f94f4a1d64</guid><dc:creator>Michael Dietz</dc:creator><description>&lt;p&gt;If you are using openOCD and enable &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/dif.html?cp=2_2_0_15_1#concept_udr_mns_1s"&gt;control access port&lt;/a&gt; protection on an nRF52 device, it is difficult to unlock if you don&amp;#39;t know what to do.&lt;/p&gt;
&lt;p&gt;Using openOCD, you can check if access protection is enabled by executing the command:
&lt;code&gt;&amp;gt; dap apreg 1 0x0c&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This command reads the register at address 0x0c in the access port at index 1 (the control access port&amp;#39;s index). If it returns 0x0 then &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/dif.html?cp=2_2_0_15_1_0_3#register.APPROTECTSTATUS"&gt;access port protection is enabled&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Unlock the chip by executing the command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;gt; dap apreg 1 0x04 0x01&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;and then resetting the device. Note that this will erase all Flash and RAM as this is the only way to disable CTRL-AP protection.&lt;/p&gt;
&lt;p&gt;Note: The easiest solution would be to use Nordic&amp;#39;s &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.tools/dita/tools/nrf5x_command_line_tools/nrf5x_command_line_tools_lpage.html"&gt;nrfjprog&lt;/a&gt; to unlock your chip via &lt;code&gt;$ nrfjprog -f NRF52 --recover&lt;/code&gt;, but this requires the use of a JLink debugger (on-board nRF5 DKs or external).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>