<?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 with char array</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89486/logging-with-char-array</link><description>Environment details: 
 
 Board: Custom 
 Chip: nRF52840 
 PCA Number: PCA10056 
 SoftDevice: S140, v7.0.1 
 nRF5 SDK: Version 16.0.0 
 mdk version: 8.46.0 
 nrfjprog version: 10.15.4 external 
 JLinkARM.dll version: 7.64d 
 
 Issue: 
 I&amp;#39;d expect the following</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Jul 2022 21:56:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89486/logging-with-char-array" /><item><title>RE: Logging with char array</title><link>https://devzone.nordicsemi.com/thread/376090?ContentTypeID=1</link><pubDate>Thu, 07 Jul 2022 21:56:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:947208b4-9544-4b55-8655-6db664df8ba1</guid><dc:creator>corbin</dc:creator><description>&lt;p&gt;This does work, thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logging with char array</title><link>https://devzone.nordicsemi.com/thread/374901?ContentTypeID=1</link><pubDate>Thu, 30 Jun 2022 12:13:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c00a651c-8563-446e-98ca-92ed01e6e684</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What if you do it like this instead?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;NRF_LOG_INFO(&amp;quot;%s&amp;quot;, s);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Then I believe the string will be copied internally, and you don&amp;#39;t have to worry about the original memory being overwritten.&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: Logging with char array</title><link>https://devzone.nordicsemi.com/thread/374807?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2022 21:26:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd7bb84b-41c5-4ad6-bdf4-6bbd3201a9a5</guid><dc:creator>corbin</dc:creator><description>&lt;p&gt;Okay, my teammate just found this little nugget in &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Flib_nrf_log.html&amp;amp;cp=8_5_3_3_26_0&amp;amp;anchor=nrf_log_processing"&gt;here&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&amp;quot;Since the logs are not processed directly, it is risky to pass pointers as arguments, especially to variables that do not have static addresses, for example variables allocated on the stack. By the time the log is processed, the pointer can point to invalid data. The logger provides a mechanism to overcome this issue by enforcing a string that is copied into the internal logger buffer.&amp;quot;&lt;/p&gt;
&lt;p&gt;With the suggestion to use `NRF_LOG_PUSH()`.&lt;/p&gt;
&lt;p&gt;Thankfully, this solves the problem. I still don&amp;#39;t understand why if we can see the data is not corrupted the original did not work though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>