<?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>SDK 14.2: NRF_LOG prefix is garbage</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29870/sdk-14-2-nrf_log-prefix-is-garbage</link><description>Hello all
I am trying to get out some debug messages from my custom Firmware (and board) but the log looks like this: 
 &amp;lt;info&amp;gt; &amp;#181;“&amp;#176;8$M&amp;#173;&amp;#248;@&amp;#241;&amp;#168;&amp;#243;&amp;#185;)F&amp;#168;: NRF_LOG initialized
 
 I am fiddling around in SDK-config.h for a while now, but can&amp;#39;t find a solution</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Mar 2018 08:29:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29870/sdk-14-2-nrf_log-prefix-is-garbage" /><item><title>RE: SDK 14.2: NRF_LOG prefix is garbage</title><link>https://devzone.nordicsemi.com/thread/122959?ContentTypeID=1</link><pubDate>Tue, 06 Mar 2018 08:29:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ea206f2-cc86-4c34-bdcb-89691448936f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Do you mean that this issue is present in the SDK examples? I can&amp;#39;t find this issue in any of the linker files in SDK 14.2. Could you give an example of a file that have this issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 14.2: NRF_LOG prefix is garbage</title><link>https://devzone.nordicsemi.com/thread/122664?ContentTypeID=1</link><pubDate>Fri, 02 Mar 2018 19:24:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79cabe3a-31d0-446b-b70f-181f7944f82b</guid><dc:creator>Lee Daniel Crocker</dc:creator><description>&lt;p&gt;I ran into this problem as well. It caused nrf_log_init() to overwrite the .bss section--very bad.&lt;/p&gt;
&lt;p&gt;There are 431 .ld files in SDK14.2; I did a random sampling and found the error in about 1/3 of them.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 14.2: NRF_LOG prefix is garbage</title><link>https://devzone.nordicsemi.com/thread/118750?ContentTypeID=1</link><pubDate>Sat, 27 Jan 2018 04:21:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9ed2904-e811-49a4-b6e2-fa9e1a6ea219</guid><dc:creator>blueshifting</dc:creator><description>&lt;p&gt;@carlosderseher yes that fixed the issue for me too. Thanks to you and @joh2 for the explanation!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 14.2: NRF_LOG prefix is garbage</title><link>https://devzone.nordicsemi.com/thread/118749?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 10:02:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b0ce409-273e-47c7-9f2e-1c4066e79aae</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;What&amp;#39;s making the difference is the missing asterisk at the end of &lt;em&gt;.log_const_data&lt;/em&gt;/&lt;em&gt;.log_dynamic_data&lt;/em&gt;. When you name a logging module, for instance &lt;em&gt;my_module&lt;/em&gt;, it will append a section &lt;em&gt;.log_dynamic_data_my_module&lt;/em&gt; to store the logging data. In your original code you were only placing section named &lt;strong&gt;exactly&lt;/strong&gt; &lt;em&gt;.log_dynamic_data&lt;/em&gt;, while the fixed code will place all sections &lt;strong&gt;starting with&lt;/strong&gt; &lt;em&gt;.log_dynamic_data&lt;/em&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 14.2: NRF_LOG prefix is garbage</title><link>https://devzone.nordicsemi.com/thread/118748?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 09:20:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83a7accc-8351-470e-a81d-96bc727bd490</guid><dc:creator>Carlos</dc:creator><description>&lt;p&gt;@blueshifting is your code working with this solution too?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 14.2: NRF_LOG prefix is garbage</title><link>https://devzone.nordicsemi.com/thread/118747?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 09:19:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2a0edfd-05e9-46fd-bd8c-254b1cb74f3a</guid><dc:creator>Carlos</dc:creator><description>&lt;p&gt;As I said, I tried to strip down my project to a minimum working example (MWE). When I could compile it, I didn&amp;#39;t get out any debug messages at all. So I took a look at my working bootloader, which is actually the one from the SDK examples, with a few changes for signaling through a buzzer and a main.cpp instead of main.c . There I kicked out everything but log module initialization and it still gave me debug messages. So I thought maybe the sdk_config is wrong. Copy pasting it to my MWE didn&amp;#39;t bring logs to live. Next step was to compare the Makefiles, but I couldn&amp;#39;t  find anything suspicous there. Exchanging the linker scripts though brought up debug messages and they were correct too. So I did compare those two files with notepad++ and there you go, I found the line which did the trick. As I said, I don&amp;#39;t know why this makes such a difference, maybe someone else can explain that to us?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 14.2: NRF_LOG prefix is garbage</title><link>https://devzone.nordicsemi.com/thread/118746?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2018 19:59:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b94a80a-a7f0-45ab-9536-a3684f702fe1</guid><dc:creator>blueshifting</dc:creator><description>&lt;p&gt;Thank you @CarlosDerseher (and @joh2)!! For my own curiosity and desire to become a better C/C++ developer (new to this), how did you figure this out?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 14.2: NRF_LOG prefix is garbage</title><link>https://devzone.nordicsemi.com/thread/118745?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2018 19:46:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59b93c7c-baeb-42dc-be62-8e2ed677d326</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;This is great! Thank you for reporting back the solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 14.2: NRF_LOG prefix is garbage</title><link>https://devzone.nordicsemi.com/thread/118744?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2018 19:01:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09ee154d-3a1a-464e-8631-91081d78d113</guid><dc:creator>Carlos</dc:creator><description>&lt;p&gt;I have to thank you @Jørgen Holmefjord because while trying to create this minimum working example I stumbled upon the solution. Turns out, there was an error in my linker script. I am not sure why it makes a difference, but with this setting ind the linker script everything works just fine now.
Here is the wrong part&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.log_dynamic_data :
{
    PROVIDE(__start_log_dynamic_data = .);
    KEEP(*(.log_const_data))  /*THIS LINE IS WRONG*/
    PROVIDE(__stop_log_dynamic_data = .);
} &amp;gt; RAM

.log_const_data :
{
    PROVIDE(__start_log_const_data = .);
    KEEP(*(.log_const_data))  /*THIS LINE IS WRONG*/
    PROVIDE(__stop_log_const_data = .);
} &amp;gt; FLASH
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I had to change it to:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.log_dynamic_data :
{
    PROVIDE(__start_log_dynamic_data = .);
    KEEP(*(SORT(.log_dynamic_data*)))  /*CORRECT*/
    PROVIDE(__stop_log_dynamic_data = .);
} &amp;gt; RAM

.log_const_data :
{
    PROVIDE(__start_log_const_data = .);
    KEEP(*(SORT(.log_const_data*)))  /*CORRECT*/
    PROVIDE(__stop_log_const_data = .);
} &amp;gt; FLASH
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I&amp;#39;ll attach my complete linker script as a reference here:
&lt;a href="https://devzone.nordicsemi.com/attachment/6757991351606a78093e338f8a1ea6cb"&gt;gcc_nrf52.ld&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And also my akefile from the minimum working example:
&lt;a href="https://devzone.nordicsemi.com/attachment/202e4e1c7b8752f9164b26c44b35c7e7"&gt;Makefile&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And here my main.cpp from the minimum working example:
&lt;a href="https://devzone.nordicsemi.com/attachment/e3f4dc00be46f1f2b442d908237aeb60"&gt;main.cpp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And here the sdk_config.h:
&lt;a href="https://devzone.nordicsemi.com/attachment/ba49a83244499b50a69f08b6bd37a848"&gt;sdk_config.h&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your input, I hope this helps some people from loosing their hair :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 14.2: NRF_LOG prefix is garbage</title><link>https://devzone.nordicsemi.com/thread/118743?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2018 20:16:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd43f3ed-304b-444e-8655-70a517cd4079</guid><dc:creator>blueshifting</dc:creator><description>&lt;p&gt;I&amp;#39;m also having this issue. Something about using C++?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>