<?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>PRINTK over SWD</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112124/printk-over-swd</link><description>How can I properly set up the SWD interface for printk on a custom PCB? I have to build my project example and see the message printed on the VS Code console. My custom hardware does not have a UART connection broken out and I am programming my custom</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 14 Jun 2024 17:19:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112124/printk-over-swd" /><item><title>RE: PRINTK over SWD</title><link>https://devzone.nordicsemi.com/thread/488915?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2024 17:19:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5464e1ea-342b-4f10-bfd9-44fd4865f5b8</guid><dc:creator>Nyameaama</dc:creator><description>&lt;p&gt;So I was able to fix my issue. For my design I had not set up an external LRFC oscillator so I added some things to my prj.conf file to enable to internal oscillator. I added these lines:&lt;/p&gt;
&lt;div&gt;&lt;span&gt;CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_LF_ALWAYS_ON&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PRINTK over SWD</title><link>https://devzone.nordicsemi.com/thread/488913?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2024 16:53:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a56f6742-991a-4ac2-b153-7cf998a2eaa7</guid><dc:creator>Nyameaama</dc:creator><description>&lt;p&gt;Would you be able to test my configuration on your side?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PRINTK over SWD</title><link>https://devzone.nordicsemi.com/thread/488912?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2024 16:53:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:634aff22-81c2-4a8a-880f-ff619ce3be2d</guid><dc:creator>Nyameaama</dc:creator><description>&lt;p&gt;This is the output from the RTT Terminal:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;SEGGER J-Link V7.88j - Real time terminal output
SEGGER J-Link (unknown) V1.0, SN=1050051574
Process: JLinkExe&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PRINTK over SWD</title><link>https://devzone.nordicsemi.com/thread/488892?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2024 13:45:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07c84615-cc38-4035-a16f-8e5eae4e5c9f</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;In that case, i think i would recommend that you use logs instead of print, and use &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_LOG_BACKEND_RTT"&gt;CONFIG_LOG_BACKEND_RTT&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Or you can simply use that along with &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_LOG_PRINTK"&gt;CONFIG_LOG_PRINTK&lt;/a&gt; to not even have to change your printks to logs.&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/test_and_optimize/logging.html#logging-in-ncs"&gt;Logging in nRF Connect SDK&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PRINTK over SWD</title><link>https://devzone.nordicsemi.com/thread/488875?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2024 13:02:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73ee307b-6fe5-43c8-a5c2-1f1df67c0e12</guid><dc:creator>Nyameaama</dc:creator><description>&lt;p&gt;Okay so I would like to debug and print statements to the console using printk.&amp;nbsp;&lt;span&gt;I have a custom board featuring nRF5340 and a programming interface that I connect to the DK in order to program it, using SWDIO, SWDCLK and RESET.&amp;nbsp;I would like to print via&amp;nbsp;SWDIO using RTT. I tried to follow this solution:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/105053/setting-up-console-over-swd-interface"&gt;Setting up console over SWD interface&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;However my configuration just does not work&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PRINTK over SWD</title><link>https://devzone.nordicsemi.com/thread/488865?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2024 12:44:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fe8949b-7f42-4857-bc8f-968fe0888f0d</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Can you specify what you mean by &amp;quot;printk over SWD&amp;quot;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PRINTK over SWD</title><link>https://devzone.nordicsemi.com/thread/488854?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2024 12:11:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:599aeca0-90ba-44b5-9f74-90b225c1a2dc</guid><dc:creator>Nyameaama</dc:creator><description>&lt;p&gt;Hello, I&amp;rsquo;m sorry but a forgot to add my pinctrl file. Everything builds and works I am just not able to use printk over SWD&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;pinctrl.dtsi&lt;/p&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;p&gt;&amp;amp;pinctrl {&lt;br /&gt; i2c0_default: i2c0_default {&lt;br /&gt; group1 {&lt;br /&gt; psels = &amp;lt;NRF_PSEL(TWIM_SCL, 1, 12)&amp;gt;, &amp;lt;NRF_PSEL(TWIM_SDA, 1, 14)&amp;gt;;&lt;br /&gt; };&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;i2c1_default: i2c1_default {&lt;br /&gt; group1 {&lt;br /&gt; psels = &amp;lt;NRF_PSEL(TWIM_SDA, 0, 5)&amp;gt;, &amp;lt;NRF_PSEL(TWIM_SCL, 1, 2)&amp;gt;;&lt;br /&gt; };&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;spi4_default: spi4_default {&lt;br /&gt; group1 {&lt;br /&gt; psels = &amp;lt;NRF_PSEL(SPIM_MISO, 1, 9)&amp;gt;,&lt;br /&gt; &amp;lt;NRF_PSEL(SPIM_MOSI, 1, 8)&amp;gt;,&lt;br /&gt; &amp;lt;NRF_PSEL(SPIM_SCK, 1, 7)&amp;gt;;&lt;br /&gt; };&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;uart2_default: uart2_default {&lt;br /&gt; group1 {&lt;br /&gt; psels = &amp;lt;NRF_PSEL(UART_RX, 0, 24)&amp;gt;, &amp;lt;NRF_PSEL(UART_TX, 0, 25)&amp;gt;;&lt;br /&gt; };&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;uart3_default: uart3_default {&lt;br /&gt; group1 {&lt;br /&gt; psels = &amp;lt;NRF_PSEL(UART_RX, 0, 21)&amp;gt;, &amp;lt;NRF_PSEL(UART_TX, 0, 19)&amp;gt;;&lt;br /&gt; };&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;qspi_default: qspi_default {&lt;br /&gt; group1 {&lt;br /&gt; psels = &amp;lt;NRF_PSEL(QSPI_CSN, 0, 18)&amp;gt;,&lt;br /&gt; &amp;lt;NRF_PSEL(QSPI_IO0, 0, 13)&amp;gt;,&lt;br /&gt; &amp;lt;NRF_PSEL(QSPI_IO1, 0, 14)&amp;gt;,&lt;br /&gt; &amp;lt;NRF_PSEL(QSPI_IO2, 0, 15)&amp;gt;,&lt;br /&gt; &amp;lt;NRF_PSEL(QSPI_IO3, 0, 16)&amp;gt;,&lt;br /&gt; &amp;lt;NRF_PSEL(QSPI_SCK, 0, 17)&amp;gt;;&lt;br /&gt; };&lt;br /&gt; };&lt;br /&gt;};&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PRINTK over SWD</title><link>https://devzone.nordicsemi.com/thread/488817?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2024 09:03:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8aa06ebc-855a-48e8-a029-9a69243be45b</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;span style="margin:0;padding:0;text-align:left;"&gt;I recommend the &lt;a href="https://academy.nordicsemi.com/" rel="noopener noreferrer" target="_blank"&gt;Nordic Developer Academy&lt;/a&gt; as an excellent place to start learning the nRF Connect SDK. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="margin:0;padding:0;text-align:left;"&gt;For how to change pins for your board, you need pinctrl.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="margin:0;padding:0;text-align:left;"&gt;Here is what our AI says about pinctrl:&lt;/span&gt;&lt;/p&gt;
&lt;div style="margin-bottom:8px;margin-top:8px;"&gt;The &lt;code style="margin-bottom:8px;margin-top:8px;white-space:pre;" dir="ltr"&gt;pinctrl&lt;/code&gt; (pin control) is a feature used in Nordic Semiconductor&amp;#39;s nRF Connect SDK to manage the pin configurations of various peripherals on the device. It allows you to assign different pins to the peripherals based on states. The two standard states are &lt;code style="margin-bottom:8px;margin-top:8px;white-space:pre;" dir="ltr"&gt;default&lt;/code&gt; and &lt;code style="margin-bottom:8px;margin-top:8px;white-space:pre;" dir="ltr"&gt;sleep&lt;/code&gt;.&lt;/div&gt;
&lt;div style="margin-bottom:8px;margin-top:8px;"&gt;In the &lt;code style="margin-bottom:8px;margin-top:8px;white-space:pre;" dir="ltr"&gt;pinctrl&lt;/code&gt; node, pin configurations are organized in groups within each sub-node. Each group specifies a list of pin function selections in the &lt;code style="margin-bottom:8px;margin-top:8px;white-space:pre;" dir="ltr"&gt;psels&lt;/code&gt; property. For example, a group could specify the pin configurations for &lt;code style="margin-bottom:8px;margin-top:8px;white-space:pre;" dir="ltr"&gt;UART_TX&lt;/code&gt; and &lt;code style="margin-bottom:8px;margin-top:8px;white-space:pre;" dir="ltr"&gt;UART_RTS&lt;/code&gt;. A group can also specify shared pin properties common to all specified pins.&lt;/div&gt;
&lt;div style="margin-bottom:8px;margin-top:8px;"&gt;Here&amp;#39;s an example of how pin configurations are being applied in the TWIM driver:&lt;/div&gt;
&lt;div style="margin-bottom:8px;margin-top:8px;white-space:pre;"&gt;&lt;/div&gt;
&lt;div style="margin-bottom:8px;margin-top:8px;white-space:pre;"&gt;
&lt;div dir="ltr"&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {
 i2c0_default_alt: i2c0_default_alt {
 group1 {
 psels = &amp;lt;NRF_PSEL(TWIM_SDA, 1, 13)&amp;gt;,
 &amp;lt;NRF_PSEL(TWIM_SCL, 1, 15)&amp;gt;;
 };
 };
 i2c0_sleep_alt: i2c0_sleep_alt {
 group1 {
 psels = &amp;lt;NRF_PSEL(TWIM_SDA, 1, 13)&amp;gt;,
 &amp;lt;NRF_PSEL(TWIM_SCL, 1, 15)&amp;gt;;
 low-power-enable;
 };
 };
};&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="margin-bottom:8px;margin-top:8px;"&gt;In this example, the &lt;code style="margin-bottom:8px;margin-top:8px;white-space:pre;" dir="ltr"&gt;i2c0_default_alt&lt;/code&gt; and &lt;code style="margin-bottom:8px;margin-top:8px;white-space:pre;" dir="ltr"&gt;i2c0_sleep_alt&lt;/code&gt; nodes define the pin configurations for the I2C peripheral in its default and sleep states, respectively. The &lt;code style="margin-bottom:8px;margin-top:8px;white-space:pre;" dir="ltr"&gt;psels&lt;/code&gt; property in each group specifies the function (SDA or SCL) and pin number for each pin.&lt;/div&gt;
&lt;div style="margin-bottom:8px;margin-top:8px;"&gt;For more information, you can refer to the &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/87790/ncs-1-9-99-how-to-set-sda-and-scl-pins-for-i2c?ReplyFilter=Answers&amp;amp;ReplySortBy=Answers&amp;amp;ReplySortOrder=Descending" rel="noopener noreferrer" target="_blank"&gt;Nordic Semiconductor&amp;#39;s DevZone forum&lt;/a&gt; and &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-2-reading-buttons-and-controlling-leds/topic/devicetree/#devicetree-example" rel="noopener noreferrer" target="_blank"&gt;Nordic Semiconductor&amp;#39;s Academy Course&lt;/a&gt;.&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>