<?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 via RTT will not work, but printf does</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87303/printk-via-rtt-will-not-work-but-printf-does</link><description>Hello there, 
 I have looked through all of the various other related questions, but still cannot resolve this issue. I am trying to use RTT versus a UART for the console. I have confirmed that the printf operation works, but not printk. I have looked</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 May 2022 08:12:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87303/printk-via-rtt-will-not-work-but-printf-does" /><item><title>RE: printk via RTT will not work, but printf does</title><link>https://devzone.nordicsemi.com/thread/366620?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 08:12:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc0198b6-85de-487d-a34e-d3e17d56d666</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Pam&lt;/p&gt;
&lt;p&gt;It&amp;#39;s good to hear you were able to get this to an acceptable state.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The CONFIG_THREAD_MONITOR option is documented &lt;a href="https://docs.zephyrproject.org/3.0.0/reference/kconfig/CONFIG_THREAD_MONITOR.html"&gt;here&lt;/a&gt;.&lt;br /&gt;If you are unable to change it it probably means that one of the configurations listed in the &amp;quot;Symbols that select this symbol&amp;quot; have also been selected, then CONFIG_THREAD_MONITOR will be enabled implicitly, and you are unable to disable it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The best of luck with your project &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printk via RTT will not work, but printf does</title><link>https://devzone.nordicsemi.com/thread/366345?ContentTypeID=1</link><pubDate>Thu, 05 May 2022 04:48:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d190958-05a5-4d22-8a0e-ef62caf7cf8e</guid><dc:creator>Pamela Keiles</dc:creator><description>&lt;p&gt;I think I have the RTT working now, but only with the Segger RTT Client program. Using the NRF Terminal within Visual Studio doesn&amp;#39;t work, but that&amp;#39;s okay. It seems like using the Kconfig menu is not a good option most of the time since any changes are erased when a pristine build occurs. In any case, for the moment I have created a custom board for our application and am using the dev board config files as reference. I will submit another case if I have any more issues or questions.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for all your help and regards,&lt;/p&gt;
&lt;p&gt;Pam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printk via RTT will not work, but printf does</title><link>https://devzone.nordicsemi.com/thread/366321?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 17:20:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bef872d0-0371-4d74-88c5-78c8a2f7beb3</guid><dc:creator>Pamela Keiles</dc:creator><description>&lt;p&gt;Also, I&amp;#39;m thinking the issue with the RTT as the console output might be because I am using the NRF52DK development board and the&amp;nbsp;CONFIG_UART_CONSOLE is set to &amp;quot;y&amp;quot; in the default board configuration file. I just need to over-ride that since I am using the UART on that board another way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printk via RTT will not work, but printf does</title><link>https://devzone.nordicsemi.com/thread/366319?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 16:41:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:701b5a8c-04d0-4b1f-a60a-0afd612a2f9b</guid><dc:creator>Pamela Keiles</dc:creator><description>&lt;p&gt;Hi &lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yes I&amp;#39;ve gone through all the tutorials and videos, unfortunately they don&amp;#39;t help with some of the details for working with all these config items. I will check them again though to be sure, unless you have a specific one to recommend on this subject.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As for using the &amp;quot;Save to file&amp;quot; option, I didn&amp;#39;t see a difference in the zephyr .config file outcome. I just get an error message in the lower corner of Visual Studio stating &amp;quot;No changes to save&amp;quot;. So I have no idea where the changes are being saved when I use this editor and why they are not &amp;quot;sticking&amp;quot;. Currently I am just trying to change the &amp;quot;thread awareness support&amp;quot; under &amp;quot;Debugging Options&amp;quot;, I was trying to get the&amp;nbsp;CONFIG_THREAD_MONITOR define to not be grayed out so I could turn it off, I&amp;#39;m guessing these 2 options are related?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks and regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Pam&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printk via RTT will not work, but printf does</title><link>https://devzone.nordicsemi.com/thread/366169?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 10:46:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb202b16-b848-4637-b9b3-10c0ff685396</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Pam&lt;/p&gt;
[quote user="pkeiles"]For example, I changed a bunch of settings in the Kconfig Actions menu, but then when I do a pristine build they are reset back to their original settings. I even try to over-ride some of these settings within the prj.conf file and it doesn&amp;#39;t effect the outcome for some of the settings[/quote]
&lt;p&gt;Could you try to use the &amp;quot;Save to file&amp;quot; option in the Kconfig configurator rather than the &amp;quot;Save&amp;quot; option?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then the changes you make should be stored in the prj.conf file, which means they will be added permanently to the project configuration, and will remain even if you do a pristine build. The other advantage is that you see immediately how the changes in the GUI get represented in the config file.&amp;nbsp;&lt;/p&gt;
[quote user="pkeiles"]I find&amp;nbsp;it is hard to get anything&amp;nbsp;done with this system, any way I can get this mess to work with IAR tools?[/quote]
&lt;p&gt;The nRF Connect SDK is not supported in IAR unfortunately. It does work with Segger Embedded Studio, which provides a more IAR like experience, but the main focus going forward is the VSCode integration and that is what we recommend.&amp;nbsp;&lt;/p&gt;
[quote user="pkeiles"]I am currently playing around with trying to get optimization setting changed, but it won&amp;#39;t &amp;quot;stick&amp;quot;, any suggestions on how to get these config settings to work correctly would be greatly appreciated.[/quote]
&lt;p&gt;Which option have you set? Could you try the &amp;#39;Save to file&amp;#39; option like I mentioned earlier?&lt;/p&gt;
&lt;p&gt;As a general tip to help you get started with the nRF Connect SDK and the associated tools I would recommend going through the&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial"&gt;nRF Connect SDK tutorial series&lt;/a&gt;, and the newly released &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/"&gt;nRF Connect SDK Fundamentals course&lt;/a&gt; on the Nordic Academy.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printk via RTT will not work, but printf does</title><link>https://devzone.nordicsemi.com/thread/366073?ContentTypeID=1</link><pubDate>Tue, 03 May 2022 21:12:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a89e39f-8133-44a2-8f9d-63d4ac99363e</guid><dc:creator>Pamela Keiles</dc:creator><description>&lt;p&gt;Hi &lt;span&gt;Torbj&amp;oslash;rn&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;It seems like the whole behavior is inconsistent. I&amp;#39;m sure part of it is due to me learning the IDE and SDK design, but it also seems to be due to the nature of the configuration control and generation.&amp;nbsp;I am using the latest Windows 11 Pro, and the Segger JLink version 7.58b.&lt;/p&gt;
&lt;p&gt;For example, I changed a bunch of settings in the Kconfig Actions menu, but then when I do a pristine build they are reset back to their original settings. I even try to over-ride some of these settings within the prj.conf file and it doesn&amp;#39;t effect the outcome for some of the settings. As a firmware developer with over 30 years of experience, this approach is way too complicated and very difficult to use. I find&amp;nbsp;it is hard to get anything&amp;nbsp;done with this system, any way I can get this mess to work with IAR tools?&lt;/p&gt;
&lt;p&gt;I am currently playing around with trying to get optimization setting changed, but it won&amp;#39;t &amp;quot;stick&amp;quot;, any suggestions on how to get these config settings to work correctly would be greatly appreciated.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Pam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printk via RTT will not work, but printf does</title><link>https://devzone.nordicsemi.com/thread/365533?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2022 08:23:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbbe9432-c32d-4e4a-97be-4a804dc3a739</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Pam&lt;/p&gt;
&lt;p&gt;I must admit I don&amp;#39;t have a lot of experience using the RTT interface in the nRF Terminal or Ozone, but I was able to get it working without obvious issues.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I made a small modification to one of the Bluetooth examples to print to the RTT log every second, and can see it appear consistently.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Which operating system and version are you running on your PC?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you know which version of the JLink DLL you are using?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printk via RTT will not work, but printf does</title><link>https://devzone.nordicsemi.com/thread/365262?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2022 17:19:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:243cdc3b-265c-4c2c-806d-20d243c4eb1b</guid><dc:creator>Pamela Keiles</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I see what part of the issue might be. I am able to see all the printk statements (as well as log statements I believe) using the Segger RTT Client program. But they are not showing consistently in either the NRF Terminal window within Visual Studio, or the Terminal window within the Ozone debugger. I was occasionally able to see some statements, then nothing. Resetting the processor within the debugger doesn&amp;#39;t help, nor does exiting and re-downloading the image. It appears to be very random when it works in those terminal windows, which is rarely.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Pam&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printk via RTT will not work, but printf does</title><link>https://devzone.nordicsemi.com/thread/365210?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2022 13:14:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1fb0c94-4b33-4a5e-805c-7448a2609761</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Pam&lt;/p&gt;
&lt;p&gt;Is there any particular reason you need to set &lt;em&gt;CONFIG_LOG_PRINTK=n&lt;/em&gt; ?&lt;/p&gt;
&lt;p&gt;I was able to route the printk message to RTT in the peripheral_uart sample by adding the following configurations only:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;CONFIG_UART_RTT=y&lt;br /&gt;CONFIG_RTT_CONSOLE=y&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;Best regards&lt;br /&gt;Torbjørn&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printk via RTT will not work, but printf does</title><link>https://devzone.nordicsemi.com/thread/365019?ContentTypeID=1</link><pubDate>Tue, 26 Apr 2022 16:51:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae024639-46af-42ab-b0ff-f6b24d1a68e2</guid><dc:creator>Pamela Keiles</dc:creator><description>&lt;p&gt;Hi &lt;span&gt;Torbj&amp;oslash;rn&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;Unfortunately that didn&amp;#39;t help. I&amp;#39;m thinking the problem might be related to not being able to set CONFIG_LOG_PRINTK=n. I am getting a build error when I try to set it to &amp;quot;n&amp;quot; in the prj.conf file. Also, I think I am not allowed to set it within the Kconfig menu, the option is greyed out. Here is the build error I am seeing:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;warning: LOG_PRINTK (defined at c:\Soberlink\soberlink_sfw\trunk_NordicBLE\peripheral_uart\build\subsys\logging\Kconfig.processing:8) was assigned the value &amp;#39;n&amp;#39; but&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;got the value &amp;#39;y&amp;#39;. See &lt;a href="http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_LOG_PRINTK.html"&gt;docs.zephyrproject.org/.../CONFIG_LOG_PRINTK.html&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;and/or look up LOG_PRINTK in the menuconfig/guiconfig interface. The Application Development Primer,&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;helpful too.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The reason I think the issue might be related to this logging feature is that when I single step through the printk() routine,&amp;nbsp;the code then branches to the routine log_printk() versus vprintk().&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Pam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printk via RTT will not work, but printf does</title><link>https://devzone.nordicsemi.com/thread/364904?ContentTypeID=1</link><pubDate>Tue, 26 Apr 2022 10:33:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94d5cab5-5287-4862-a7a2-2c7ca799c634</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Pam&lt;/p&gt;
&lt;p&gt;Could you try to add the following config as well?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;CONFIG_UART_RTT=y&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This should fix the issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>