<?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>Understanding processor halt when SWDIO/SWCLK are pulled high/low respectively</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95800/understanding-processor-halt-when-swdio-swclk-are-pulled-high-low-respectively</link><description>Hello, 
 I am working on a custom board which has a multiplexer connected to route two output pins to either UART RX/TX lines or SWDIO/SWCLK. 
 The multiplexer is controlled by the nRF application, and selecting either mode works as expected (can enable</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 20 Jan 2023 14:47:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95800/understanding-processor-halt-when-swdio-swclk-are-pulled-high-low-respectively" /><item><title>RE: Understanding processor halt when SWDIO/SWCLK are pulled high/low respectively</title><link>https://devzone.nordicsemi.com/thread/405865?ContentTypeID=1</link><pubDate>Fri, 20 Jan 2023 14:47:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63aadecc-34ec-49da-bd98-7ec7a12cbf03</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="nwl_at_whisper"]Is there any documentation about the internal SWD debug handling in the nRF? The provided documentation does not seem to explain why this resulted in the processor being halted.[/quote]
&lt;p&gt;We implement the standard component from ARM. The specification is available from ARMs website:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.arm.com/documentation/ihi0031/latest"&gt;https://developer.arm.com/documentation/ihi0031/latest&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The first chapter in the previous link (although it mentions cortex m1, it applies to the whole cortex m family) can explain the behavior that you&amp;#39;re seeing:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;The serial interface to the SW-DP must use a connection sequence, to ensure that hot-plugging the serial connection does not result in unintentional transfers. 
The connection sequence ensures that the SW-DP is synchronized correctly to the header that is used to signal a connection. 
It consists of a sequence of 50 clock cycles with data = 1, that is, with the serial data signal asserted HIGH by the debugger.

This connection sequence is also used as a line reset sequence, see Protocol Error responses on page 5-13. 
The protocol requires that any run of 50 consecutive 1s on the data input is detected as a line reset, regardless of the state of the protocol.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you scoped the SWD pins to see how&amp;nbsp;these signals behave when you get into this unwanted situation?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding processor halt when SWDIO/SWCLK are pulled high/low respectively</title><link>https://devzone.nordicsemi.com/thread/405734?ContentTypeID=1</link><pubDate>Thu, 19 Jan 2023 17:02:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15cf9be3-43b8-40e0-9c57-7d6df763d79e</guid><dc:creator>nwl_at_whisper</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon, you&amp;#39;re correct that I&amp;#39;m looking at the case where UART TX data could be muxed to a SWD line, but only one of the lines has data on it (UART TX) and the other line has a pull up (the UART RX line).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I looked through the SWD spec that you linked, but it did not explain the behavior that I saw. Specifically, pulling SWCLK high and then temporarily shorting SWDIO low does not seem to be valid according to the SWD protocol, so I&amp;#39;m not sure why the processor would halt.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In our design, there is no way to avoid that UART TX data could potentially end up on one of the lines, but the workaround we have is to not enable the pull-up resistor on the UART RX line, (so that SWCLK does not end up pulled high), but we need to make sure this will resolve the issue we were seeing in all situations.&lt;/p&gt;
&lt;p&gt;Is there any documentation about the internal SWD debug handling in the nRF? The provided documentation does not seem to explain why this resulted in the processor being halted.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding processor halt when SWDIO/SWCLK are pulled high/low respectively</title><link>https://devzone.nordicsemi.com/thread/405678?ContentTypeID=1</link><pubDate>Thu, 19 Jan 2023 13:09:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b58b93e9-c967-4ac5-b3a3-4621067d040f</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do I understand the scenario correct that you&amp;#39;re sending UART data into the SWD pins?&lt;/p&gt;
&lt;p&gt;If yes, then&amp;nbsp;unwanted behavior can happen, as SWD is also a serialized bus.&lt;/p&gt;
&lt;p&gt;Please see the SW-DP specification for more information:&amp;nbsp;&lt;a href="https://developer.arm.com/documentation/ddi0413/c/debug-access-port/sw-dp/protocol-description"&gt;https://developer.arm.com/documentation/ddi0413/c/debug-access-port/sw-dp/protocol-description&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>