<?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>Logging functions disabled for nRF52 DK board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105583/logging-functions-disabled-for-nrf52-dk-board</link><description>I have the nRF52 DK board and I am loading the peripheral_uart example. All works fine I can compile and flash and connect to iPhone. There is no problem with the application. I just want to be able to turn on logging. there is a line in log.h as shown</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Nov 2023 20:38:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105583/logging-functions-disabled-for-nrf52-dk-board" /><item><title>RE: Logging functions disabled for nRF52 DK board</title><link>https://devzone.nordicsemi.com/thread/456785?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2023 20:38:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c124760f-4394-49cb-ae82-1c47766302e8</guid><dc:creator>Burt</dc:creator><description>&lt;p&gt;My bad. Actually __CDT_PARSER__ is defined by nRF Connect for VS Code to calm down Intellisense from trying to parse complicated logging macros (which Intellisense is not&amp;nbsp;capable of doing) from the C/C++ VS Code extension, but it is only used by Intellisense. It has no bearing on the actual build--only what you THINK the build is based on Intellisense and hovering over __CDT_PARSER__ in a file. It does not affect logging, therefore.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logging functions disabled for nRF52 DK board</title><link>https://devzone.nordicsemi.com/thread/456553?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2023 22:01:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac2956d8-8b84-4c38-8450-dc409b1cc9f0</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Noted!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logging functions disabled for nRF52 DK board</title><link>https://devzone.nordicsemi.com/thread/456538?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2023 19:04:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52d86e7a-6b18-4b49-bf02-da90cdab54e1</guid><dc:creator>Timothy</dc:creator><description>&lt;p&gt;this can be closed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logging functions disabled for nRF52 DK board</title><link>https://devzone.nordicsemi.com/thread/456057?ContentTypeID=1</link><pubDate>Fri, 17 Nov 2023 00:28:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8044dac0-2352-4854-9359-95b31e581e4f</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry Timothy, my last reply was a bit nonsensical - I missed the printf on the very last line, and so got the impression that logging was partially working.&lt;/p&gt;
&lt;p&gt;Burt is right in that looking at a lot of the underlying code won&amp;#39;t always make sense as Zephyr makes heavy use of macros and compile time configuration of the implementation files. So if your editor thinks __CDT_PARSER__ is defined, I wouldn&amp;#39;t worry too much about it.&lt;/p&gt;
&lt;p&gt;I would still recommend you to consult the Dev Academy to get some basic printing and logging set up over uart/rtt. I wasn&amp;#39;t able to spot any issues with the config you shared.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logging functions disabled for nRF52 DK board</title><link>https://devzone.nordicsemi.com/thread/455440?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2023 03:07:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11d0e806-89aa-4804-9f50-85773e5a5252</guid><dc:creator>Burt</dc:creator><description>&lt;p&gt;Tim,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know what gave you the idea that __CDT_PARSER__ is defined. You are not using Eclipse so that explains why you cannot find it defined. The nRF Connect SDK documentation describes every sample application in the SDK and shows you how to get a logging console for the sample you are working with. There is a lot of Zephyr code included in the logging subsystem; apparently the printf function which is a C library function bypasses all that and goes directly to UART. All we have to know is that there is a bunch of logging subsystem code--the easiest way to deal with that is to simply follow the directions in the sample in which case we never have to know anything much about that logging subsystem. Maybe it helps to know that it has separate &amp;quot;backends&amp;quot; for UART and for RTT. Definitely for you and I who have come from a nRF9160 background it is unexpected that printf and LOG messages go to different places, but it is what it is!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Burt&lt;/p&gt;
&lt;p&gt;10/23/2025: please see my correction further down!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logging functions disabled for nRF52 DK board</title><link>https://devzone.nordicsemi.com/thread/455403?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2023 18:38:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b990c5d-c032-417d-a599-e22997e4ef78</guid><dc:creator>Timothy</dc:creator><description>&lt;p&gt;the LOG_INF is NOT printing. my printf statement is printing. none of the LOG_XXX are printing as I show above. I am using VS Code for all development. the&amp;nbsp;&lt;span&gt;__CDT_PARSER__ is defined somewhere which cause all of the logging statement to be NULL (0). I have no idea where that is defined and why it is blocking things.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;this is my code shown below.&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;printf&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;V %d.%02d %s%s&lt;/span&gt;&lt;span&gt;\r\n&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,VERSION_MAJOR, VERSION_MINOR, VERSION_DATE,VERSION_DATE_EXT);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;LOG_INF&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;Bluetooth initialized INF&amp;quot;&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;LOG_WRN&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;Bluetooth initialized WRN&amp;quot;&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;LOG_ERR&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;Bluetooth initialized ERR&amp;quot;&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;printf&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;Bluetooth initialized&lt;/span&gt;&lt;span&gt;\r\n&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logging functions disabled for nRF52 DK board</title><link>https://devzone.nordicsemi.com/thread/455402?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2023 18:32:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad9a4495-a7c7-4683-a9bf-90a765b2570e</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;Which IDE are you using? Are you actually using CLion? Or just VS Code with our extension?&lt;/p&gt;
[quote user="tjm1"]&lt;div&gt;&lt;span&gt;this is what is printed&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;V 0.01 Temp/Humidity BLE Sensor 11/11/23 (Bd 1.0 DK)&lt;br /&gt;Bluetooth initialized&lt;/span&gt;&lt;/div&gt;[/quote]
&lt;p&gt;Thanks for sharing. It looks to me like your LOG_INF statement is actually printing, so that&amp;#39;s a good sign.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But just to be clear, is it cutting off the &amp;quot;INF&amp;quot; at the end of that log statement? And is it not printing the other two statements? Or did you just give me an excerpt?&lt;/p&gt;
&lt;p&gt;I need to understand exactly what issue you are seeing.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, have you tried logging with UART? Or do you have to use RTT?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logging functions disabled for nRF52 DK board</title><link>https://devzone.nordicsemi.com/thread/455371?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2023 15:21:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6781053-ba3a-459f-8d20-a685da31740a</guid><dc:creator>Timothy</dc:creator><description>&lt;p&gt;Raoul&lt;/p&gt;
&lt;p&gt;thanks for the quick reply. I am not new to NCS. I have been using NCS with the V1.7.0 and nRF9160 for several years.&lt;/p&gt;
&lt;p&gt;I am new to nrf52 and V2.5.0. I have the following in&amp;nbsp; my prj.conf file. I have details below. what am I doing wrong.&lt;/p&gt;
&lt;p&gt;# Config logger&lt;br /&gt;CONFIG_LOG=y&lt;br /&gt;CONFIG_USE_SEGGER_RTT=y&lt;br /&gt;CONFIG_LOG_BACKEND_RTT=y&lt;br /&gt;CONFIG_LOG_BACKEND_UART=n&lt;br /&gt;#CONFIG_LOG_PRINTK=n&lt;br /&gt;CONFIG_LOG_PRINTK=y&lt;/p&gt;
&lt;p&gt;I have the following in my code&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;printf&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;V %d.%02d %s%s&lt;/span&gt;&lt;span&gt;\r\n&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,VERSION_MAJOR, VERSION_MINOR, VERSION_DATE,VERSION_DATE_EXT);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;LOG_INF&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;Bluetooth initialized INF&amp;quot;&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;LOG_WRN&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;Bluetooth initialized WRN&amp;quot;&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;LOG_ERR&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;Bluetooth initialized ERR&amp;quot;&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;printf&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;Bluetooth initialized&lt;/span&gt;&lt;span&gt;\r\n&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;this is what is printed&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;V 0.01 Temp/Humidity BLE Sensor 11/11/23 (Bd 1.0 DK)&lt;br /&gt;Bluetooth initialized&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logging functions disabled for nRF52 DK board</title><link>https://devzone.nordicsemi.com/thread/455256?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2023 10:04:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bd31fc2-208e-4d06-8e1b-0fc62078a254</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi Timothy,&lt;/p&gt;
&lt;p&gt;In the nRF Connect SDK, Logging is enabled and configured through the appropriate Kconfig options.&lt;/p&gt;
&lt;p&gt;For example to enable logging, you add&lt;/p&gt;
&lt;p&gt;CONFIG_LOG=y&lt;/p&gt;
&lt;p&gt;to your prj.conf.&lt;/p&gt;
&lt;p&gt;I assume you&amp;#39;re new to NCS. I would therefore strongly recommend you to start with the NCS fundamentals course on our Developer Academy:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/"&gt;https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It covers logging as well, if you want to skip straight to that:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-3-printing-messages-to-console-and-logging/topic/exercise-2-4/"&gt;https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-3-printing-messages-to-console-and-logging/topic/exercise-2-4/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>