<?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>log message printing problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67238/log-message-printing-problem</link><description>Hello, 
 There is a problem printing the log message. I am using SDK12.3, keil compiler and segger J-Link. After modifying the project a little, normal log output is not available, but I can&amp;#39;t find which part of the change has occurred. 
 
 #define DOOR_LOCK_DEST</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Oct 2020 10:01:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67238/log-message-printing-problem" /><item><title>RE: log message printing problem</title><link>https://devzone.nordicsemi.com/thread/275307?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 10:01:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45f3c737-4136-488c-9e37-cd5a977fd17a</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2845._5F00_Insert-Code-_2D00_-Nordic-2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: log message printing problem</title><link>https://devzone.nordicsemi.com/thread/275278?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 08:25:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53779164-c581-491e-9ea2-7e7d474b44e1</guid><dc:creator>air</dc:creator><description>&lt;p&gt;The result is same.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;char *p_test = &amp;quot;Testing string&amp;quot;;&lt;/p&gt;
&lt;p&gt;NRF_LOG_PROC(&amp;quot;*** system start ***\r\n&amp;quot;); &lt;br /&gt; NRF_LOG_PROC(&amp;quot;* target : %s\r\n&amp;quot;, (uint32_t)p_test); // DOOR_LOCK_DEST);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;****************************&lt;/p&gt;
&lt;p&gt;00&amp;gt; *** system start ***&lt;/p&gt;
&lt;p&gt;00&amp;gt; * target : s&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: log message printing problem</title><link>https://devzone.nordicsemi.com/thread/275224?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 00:16:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5222413e-4d4e-48b8-a991-d96a2d5400a0</guid><dc:creator>air</dc:creator><description>&lt;p&gt;&amp;nbsp;Hellow,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I used (uint32_t) before and got desirable results in other projects.&lt;/p&gt;
&lt;p&gt;Sure, there were no warning and error.&lt;/p&gt;
&lt;p&gt;Below is the code and compile results.&lt;/p&gt;
&lt;p&gt;They are same as other projects.&lt;/p&gt;
&lt;p&gt;Is there any setting parameter I don&amp;#39;t know?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;****************************************************************************************&lt;/p&gt;
&lt;p&gt;#define NRF_LOG_PROC NRF_LOG_RAW_INFO&lt;/p&gt;
&lt;p&gt;#define DOOR_LOCK_DEST &amp;quot;ELEVATOR CONTROL&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;#ifdef MSG_DEVICE_INFO&lt;br /&gt;void displayDeviceInfo1(void)&lt;br /&gt;{&lt;br /&gt;// NRF_LOG_INIT(NULL);&lt;br /&gt; NRF_LOG_PROC(&amp;quot;*** system start ***\r\n&amp;quot;); &lt;br /&gt; NRF_LOG_PROC(&amp;quot;* target : %s\r\n&amp;quot;, (char *)DOOR_LOCK_DEST); // (uint32_t)&lt;br /&gt; NRF_LOG_PROC(&amp;quot;* doorlock type : %d\r\n&amp;quot;, DOORLOCK_TYPE);&lt;br /&gt; NRF_LOG_PROC(&amp;quot;* HW version : %d\r\n&amp;quot;, HW_REV);&lt;br /&gt; NRF_LOG_PROC(&amp;quot;* FW version : %d.%02d\r\n&amp;quot;, FW_MAJOR, FW_MINOR);&lt;br /&gt; NRF_LOG_PROC(&amp;quot;* build date : %s %s\r\n&amp;quot;, (char *)__DATE__, (char *)__TIME__);&lt;br /&gt; #ifdef DFU_SUPPORT&lt;br /&gt; NRF_LOG_PROC(&amp;quot;DFU_SUPPORT\r\n&amp;quot;);&lt;br /&gt; #endif&lt;/p&gt;
&lt;p&gt;// NRF_LOG_FLUSH();&lt;br /&gt;// NRF_LOG_PROC(&amp;quot;* flash - global paramter addr : 0x%08X\r\n&amp;quot;, PSTORAGE_DEVICE_GLOBAL_ADDR);&lt;br /&gt;// NRF_LOG_PROC(&amp;quot;* flash - cbook header addr : 0x%08X\r\n&amp;quot;, PSTORAGE_DEVICE_CDB_HEAD_ADDR);&lt;br /&gt;// NRF_LOG_PROC(&amp;quot;* flash - cbook addr : 0x%08X\r\n&amp;quot;, PSTORAGE_DEVICE_CODEBOOK_ADDR);&lt;br /&gt;// NRF_LOG_PROC(&amp;quot;* flash - log addr : 0x%08X\r\n&amp;quot;, PSTORAGE_DEVICE_LOG_ADDR);&lt;br /&gt;// NRF_LOG_PROC(&amp;quot;* flash - swap addr : 0x%08X\r\n&amp;quot;, PSTORAGE_DEVICE_SWAP_ADDR);&lt;br /&gt;// NRF_LOG_PROC(&amp;quot;* flash - bootloader addr : 0x%08X\r\n&amp;quot;, BOOTLOADER_ADDRESS);&lt;br /&gt;// NRF_LOG_FLUSH();&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;void displayDeviceInfo2(void)&lt;br /&gt;{&lt;br /&gt;// uint32_t err_code __attribute__((unused));&lt;br /&gt;// bool IsReset;&lt;br /&gt;// ble_date_time_t bdt;&lt;/p&gt;
&lt;p&gt;// err_code = drv_rtc_date_time_read(&amp;amp;bdt, &amp;amp;IsReset);&lt;br /&gt;// NRF_LOG_PROC(&amp;quot;* time : %04u.%02u.%02u %02u:%02u:%02u\r\n&amp;quot;, \&lt;br /&gt;// bdt.year, bdt.month, bdt.day, bdt.hours, bdt.minutes, bdt.seconds);&lt;/p&gt;
&lt;p&gt;print_mac_addr(m_MAC_Address[0]);&lt;br /&gt; print_mac_addr(m_MAC_Address[1]);&lt;br /&gt; NRF_LOG_PROC(&amp;quot;* %s start!\r\n&amp;quot;, (char *)DEVICE_NAME);&lt;br /&gt;}&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;****************************************************************************************&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;* compile result&lt;/p&gt;
&lt;p&gt;compiling main.c...&lt;br /&gt;..\main.c(442): error: #167: argument of type &amp;quot;char *&amp;quot; is incompatible with parameter of type &amp;quot;uint32_t&amp;quot;&lt;br /&gt; &lt;br /&gt;RF_LOG_PROC&lt;br /&gt;&amp;quot;* target : %s\r\n&amp;quot;, (char *)DOOR_LOCK_DEST); // (uint32_t)&lt;br /&gt;..\main.c(446): error: #167: argument of type &amp;quot;char *&amp;quot; is incompatible with parameter of type &amp;quot;uint32_t&amp;quot;&lt;br /&gt; &lt;br /&gt;RF_LOG_PROC&lt;br /&gt;&amp;quot;* build date : %s %s\r\n&amp;quot;, (char *)__DATE__, (char *)__TIME__);&lt;br /&gt;..\main.c(446): error: #167: argument of type &amp;quot;char *&amp;quot; is incompatible with parameter of type &amp;quot;uint32_t&amp;quot;&lt;br /&gt; &lt;br /&gt;RF_LOG_PROC&lt;br /&gt;&amp;quot;* build date : %s %s\r\n&amp;quot;, (char *)__DATE__, (char *)__TIME__);&lt;br /&gt;..\main.c(473): error: #167: argument of type &amp;quot;char *&amp;quot; is incompatible with parameter of type &amp;quot;uint32_t&amp;quot;&lt;br /&gt; &lt;br /&gt;RF_LOG_PROC&lt;br /&gt;&amp;quot;* %s start!\r\n&amp;quot;, (char *)DEVICE_NAME);&lt;br /&gt;..\main.c: 0 warnings, 4 errors&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: log message printing problem</title><link>https://devzone.nordicsemi.com/thread/275150?ContentTypeID=1</link><pubDate>Thu, 15 Oct 2020 14:37:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30e183e1-ab0f-4778-ab13-241e9428923d</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;OK, I see.&lt;/p&gt;
&lt;p&gt;But, from that link:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;NRF_LOG_INFO() stores a pointer to the string and not a copy of the string.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;maybe&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/air"&gt;air&lt;/a&gt;&amp;nbsp;is falling foul of (something like)&amp;nbsp; that?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;@air - have you tried stepping into the code to see what&amp;#39;s happening?&lt;/p&gt;
&lt;p&gt;(since the NRF_LOG_... are all macros, you may want to view the preprocessor output)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: log message printing problem</title><link>https://devzone.nordicsemi.com/thread/275149?ContentTypeID=1</link><pubDate>Thu, 15 Oct 2020 14:26:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:346041c0-21ee-49b9-af10-3ca41ff3cfc9</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;NRF_LOG_PROC does not seem to be part of nRF5 SDK v12.3.0 from what I can tell. (I did not find it using a global text search over the full SDK folder.) Can you try with one of the documented logger macros instead? E.g. NRF_LOG_INFO()?&lt;/p&gt;
&lt;p&gt;Alternatively, share the definition of NRF_LOG_PROC from your project?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: log message printing problem</title><link>https://devzone.nordicsemi.com/thread/275148?ContentTypeID=1</link><pubDate>Thu, 15 Oct 2020 14:24:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f48ef87-c1e7-4fee-86f3-d640aa00056b</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Not a char* in our logger module: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/22647/nrf_log_info-how-to-print-log-with-string-parameter"&gt;NRF_LOG_INFO how to print log with string parameter&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: log message printing problem</title><link>https://devzone.nordicsemi.com/thread/275030?ContentTypeID=1</link><pubDate>Thu, 15 Oct 2020 10:10:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c4febb7-d35f-4148-9082-ae07eaf09603</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Why are you casting the strings to be (uint32_t) ?&lt;/p&gt;
&lt;p&gt;Surely, &amp;quot;%s&amp;quot; requires a &lt;em&gt;string&lt;/em&gt; - which is a (char*) ?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;EDIT: No, that&amp;#39;s not it - see below.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>