<?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>SWO output from a locked nRF52?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/101743/swo-output-from-a-locked-nrf52</link><description>Hello. 
 Is it possible to enable output through SWO from an nRF52840 that is locked? 
 I can get SWO output from a device that is not locked. I can also enable SWO from the target, and just attach to the device with Segger&amp;#39;s SWO viewer. So the debugger</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Jul 2023 10:09:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/101743/swo-output-from-a-locked-nrf52" /><item><title>RE: SWO output from a locked nRF52?</title><link>https://devzone.nordicsemi.com/thread/435925?ContentTypeID=1</link><pubDate>Wed, 12 Jul 2023 10:09:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74ce0ad2-053f-4e73-b4bf-c006f936d0c1</guid><dc:creator>mrono</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/101743/swo-output-from-a-locked-nrf52/435921"]I&amp;#39;m awaiting feedback from R&amp;amp;D to confirm whether this is supposed to work or not, but I&amp;#39;m afraid it doesn&amp;#39;t look promising.[/quote]
&lt;p&gt;Ok, thank you. Lets wait for confirmation.&lt;/p&gt;
&lt;p&gt;This is not a huge problem, as I can add a uart and use that. I just would have been cleaner to have fewer cables.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SWO output from a locked nRF52?</title><link>https://devzone.nordicsemi.com/thread/435921?ContentTypeID=1</link><pubDate>Wed, 12 Jul 2023 10:03:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7599ba20-c84c-4e72-b8a1-43f0a4e8694f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I tested again to verify that my observations were correct. It turns out they weren&amp;#39;t, because now when I use &amp;#39;-swoattach 1&amp;#39;, I am met with the same AP protect prompt I saw&amp;nbsp;earlier&amp;nbsp;with v7.80c. I don&amp;#39;t understand why I did not see this earlier. I used the &amp;#39;nrfjprog --rbp all&amp;#39; command to enable the protection, followed by a power cycle to ensure the debug interface registers were reset.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m awaiting feedback from R&amp;amp;D to confirm whether this is supposed to work or not, but I&amp;#39;m afraid it doesn&amp;#39;t look promising.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SWO output from a locked nRF52?</title><link>https://devzone.nordicsemi.com/thread/435904?ContentTypeID=1</link><pubDate>Wed, 12 Jul 2023 09:21:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1333366f-b471-43e7-8a59-45ee347711b2</guid><dc:creator>mrono</dc:creator><description>&lt;p&gt;That&amp;#39;s what I&amp;#39;m seeing as well.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/101743/swo-output-from-a-locked-nrf52/435897"]With Segger v7.88h, I was able to connect to the SWO, but did not manage to get any output after readback protection was enabled.[/quote]
&lt;p&gt;So do you get a stable connection with 7.88h, just no output? To me that would suggest that readback protection might prevent&amp;nbsp;SWO altogether.&lt;/p&gt;
&lt;p&gt;I used 7.80c and tried to trick the SWO viewer by&amp;nbsp;connecting with Jlink commander first, then just ignored the prompt. But the connection wasn&amp;#39;t really stable, I think the J-Link was confused by the &amp;#39;hanging&amp;#39; erase prompt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SWO output from a locked nRF52?</title><link>https://devzone.nordicsemi.com/thread/435897?ContentTypeID=1</link><pubDate>Wed, 12 Jul 2023 09:05:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfa4f3e3-2d0b-47d9-954b-1d34c7944ea6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I thought SWO output was supposed to be available even with approtect enabled, but I&amp;#39;m not sure anymore. I did some experiments here, and with Jlink v7.80c it seems that SWO viewer still tries to connect to the debug interface when I use -swoattach 1 as I get the Segger prompt to disable AP. With Segger v7.88h, I was able to connect to the SWO, but did not manage to get any output after readback protection was enabled.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;$ JLinkSWOViewerCLExe -swoattach 1 -swofreq 1000000 -cpufreq 64000000 -device nrf52840_xxaa -itmport 0x0
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I will check internally if anyone has experience with this.&lt;/p&gt;
&lt;p&gt;Project I used for testing:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/swo_5F00_test.zip"&gt;devzone.nordicsemi.com/.../swo_5F00_test.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SWO output from a locked nRF52?</title><link>https://devzone.nordicsemi.com/thread/435863?ContentTypeID=1</link><pubDate>Wed, 12 Jul 2023 07:15:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e19b9b9f-2af6-46e8-85e9-352ccbcd8e8c</guid><dc:creator>mrono</dc:creator><description>&lt;p&gt;I added the pin init and the traceconfig settings from system_nrf52 to the Segger example I&amp;#39;m using. I still can&amp;#39;t get it to work.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/vibe"&gt;Vidar Berg&lt;/a&gt;&amp;nbsp;Should this work in principle? Or does approtect prevent SWO even if it is the target that enables it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SWO output from a locked nRF52?</title><link>https://devzone.nordicsemi.com/thread/435713?ContentTypeID=1</link><pubDate>Tue, 11 Jul 2023 12:07:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e57290a4-bd37-4b7b-8097-9c23475d253f</guid><dc:creator>mrono</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/101743/swo-output-from-a-locked-nrf52/435692"]But are you enabling the SWO in your code like here:&amp;nbsp;&lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/master/mdk/system_nrf52.c#L131"&gt;https://github.com/NordicSemiconductor/nrfx/blob/master/mdk/system_nrf52.c#L131&lt;/a&gt;, [/quote]
&lt;p&gt;My version of system_nrf52.c is one commit behind that. And it seems to hard-code SWO to P0.18 which is not correct for nRF52840.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll add the pin initialisation and the clock-&amp;gt;traceconfig init to the segger init function that I&amp;#39;ve used. Let&amp;#39;s see if that helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SWO output from a locked nRF52?</title><link>https://devzone.nordicsemi.com/thread/435697?ContentTypeID=1</link><pubDate>Tue, 11 Jul 2023 11:41:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:818434cc-4080-426a-92ad-52bc0ebbd768</guid><dc:creator>mrono</dc:creator><description>&lt;p&gt;Hmm, actually I used Segger&amp;#39;s example code&amp;nbsp;&lt;a href="https://wiki.segger.com/J-Link_SWO_Viewer#Configure_SWO_output_after_device_reset"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I need to check the differences, but it does work on an unlocked nRF. I do use the -swoattach flag when launching SWO viewer which is supposed to let the target enable SWO.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SWO output from a locked nRF52?</title><link>https://devzone.nordicsemi.com/thread/435692?ContentTypeID=1</link><pubDate>Tue, 11 Jul 2023 11:28:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd1d0863-6853-428f-b6cd-72befa9d6153</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have much experience with using SWO, to be honest. We mostly use RTT for logging. RTT is not available with approtect enabled though. But are you enabling the SWO in your code like here:&amp;nbsp;&lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/master/mdk/system_nrf52.c#L131"&gt;https://github.com/NordicSemiconductor/nrfx/blob/master/mdk/system_nrf52.c#L131&lt;/a&gt;, or have you been using the debugger for this?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>