<?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>Cannot print more than two values in a single command line using NRF_LOG_FLOAT_MARKER</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38703/cannot-print-more-than-two-values-in-a-single-command-line-using-nrf_log_float_marker</link><description>Hi, 
 I have been trying to print out the float values using the NRF_LOG_FLOAT_MARKER, and i am only able to print 2 values in a single NRF_LOG_INFO line. Is there a way to print 3 values in a single line? 
 Currently this is what i have been using to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Jul 2019 15:04:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38703/cannot-print-more-than-two-values-in-a-single-command-line-using-nrf_log_float_marker" /><item><title>RE: Cannot print more than two values in a single command line using NRF_LOG_FLOAT_MARKER</title><link>https://devzone.nordicsemi.com/thread/200802?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 15:04:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10387512-c6fd-4b51-ad2d-8e231f0da9f0</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;I would suggest&amp;nbsp; to take a fresh example from the SDK. You may have changed something in your code and you can to remember it. Next do the following&lt;/p&gt;
&lt;p&gt;1) Modify the printf/scanf options as mentioned before&lt;/p&gt;
&lt;p&gt;2) Create a character array (i.e. char my_array[50] = {&amp;#39;\0&amp;#39;} ) and a float variable(i.e. x=3.14).&lt;/p&gt;
&lt;p&gt;2) use sprintf since it is the most straight forward choice (in my opinion)&lt;/p&gt;
&lt;pre class="prettyprint notranslate prettyprinted"&gt;&lt;span class="pln"&gt;  sprintf&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;str&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;quot;Value of Pi = %f&amp;quot;&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; x&lt;/span&gt;&lt;span class="pun"&gt;);&lt;br /&gt;&lt;br /&gt;3)Open the CMSIS Configuration wizard. Under nrf_log enable NRF_LOG_ENABLED and BACKEND_RTT&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;4) Write something on the segger serial port. Also enable RTT J-link view&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot print more than two values in a single command line using NRF_LOG_FLOAT_MARKER</title><link>https://devzone.nordicsemi.com/thread/200784?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 13:39:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b87decf-17b0-4262-a83d-2fb57d3182a8</guid><dc:creator>awneil</dc:creator><description>[quote userid="74601" url="~/f/nordic-q-a/38703/cannot-print-more-than-two-values-in-a-single-command-line-using-nrf_log_float_marker/176578"] I&amp;nbsp; checked &lt;span class="user-name"&gt;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/joh2"&gt;Jørgen&lt;/a&gt;&lt;/span&gt;&amp;#39;s solution and it works fine Here is an example[/quote]
&lt;p&gt;Actually, that is &lt;em&gt;&lt;strong&gt;not&lt;/strong&gt; &lt;/em&gt;an example of what&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/joh2"&gt;Jørgen Holmefjord&lt;/a&gt;&amp;nbsp;said at all!&lt;/p&gt;
&lt;p&gt;The whole point of the&amp;nbsp;&lt;span&gt;NRF_LOG_FLOAT_MARKER is that it lets you print floats &lt;em&gt;&lt;strong&gt;without&lt;/strong&gt; &lt;/em&gt;using %f - and the extra library code which that requires.&lt;/span&gt;&lt;/p&gt;
[quote userid="78088" url="~/f/nordic-q-a/38703/cannot-print-more-than-two-values-in-a-single-command-line-using-nrf_log_float_marker/200711"]Thanks for the solution[/quote]
&lt;p&gt;&lt;span&gt;Unfortunately, it was wrong!&lt;/span&gt;&lt;/p&gt;
[quote userid="78088" url="~/f/nordic-q-a/38703/cannot-print-more-than-two-values-in-a-single-command-line-using-nrf_log_float_marker/200711"] &amp;quot;%f&amp;quot; does not work[/quote]
&lt;p&gt;Indeed - as&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/masterlee"&gt;masterLee&lt;/a&gt;&amp;nbsp;says, you need additional library support to use %f.&lt;/p&gt;
&lt;p&gt;See also:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50243/pca10056-and-float"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/50243/pca10056-and-float&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot print more than two values in a single command line using NRF_LOG_FLOAT_MARKER</title><link>https://devzone.nordicsemi.com/thread/200770?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 12:40:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a17713f-ce6f-4a59-aece-06683e43ee5a</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;This sounds to me like you have not enabled the float option in the project printf/scanf options.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1564144839197v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot print more than two values in a single command line using NRF_LOG_FLOAT_MARKER</title><link>https://devzone.nordicsemi.com/thread/200711?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 09:55:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d1d1d1b-d3e5-4765-8b65-cab13e30caea</guid><dc:creator>GT</dc:creator><description>&lt;p&gt;Thanks for the solution. Unfortunately &amp;quot;%f&amp;quot; does not work. Nothing gets updated on the array pointer. Do you know what needs to be done to enable %f output? Though&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__nrf__log.html#ga51024b65418ae9a0e6d79fe285479b9c"&gt;NRF_LOG_FLOAT_MARKER&lt;/a&gt;&amp;nbsp;works but that doesn&amp;#39;t use %f.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot print more than two values in a single command line using NRF_LOG_FLOAT_MARKER</title><link>https://devzone.nordicsemi.com/thread/176578?ContentTypeID=1</link><pubDate>Sun, 17 Mar 2019 20:07:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35c87319-2005-49b7-8ef2-7d823edef002</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;Hi, I&amp;nbsp; checked &lt;span class="user-name"&gt;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/joh2"&gt;J&amp;oslash;rgen&lt;/a&gt;&lt;/span&gt;&amp;#39;s solution and it works fine Here is an example&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;          
main(){
    char array[100] = {0};
    ...
    ... // whatever your code is
    ...
    sprintf(array,&amp;quot;%.2f %.2f %.2f %.2f&amp;quot;, floatVal_A, floatVal_B, floatVal_C, floatVal_D);
    NRF_LOG_INFO( &amp;quot; Float Values are: %s&amp;quot;, array);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot print more than two values in a single command line using NRF_LOG_FLOAT_MARKER</title><link>https://devzone.nordicsemi.com/thread/149567?ContentTypeID=1</link><pubDate>Thu, 20 Sep 2018 08:37:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:776665c6-3074-4755-acf9-457049a89ca7</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Unfortunately, nRF Logger is only implemented for 0 to 6 arguments.&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__nrf__log.html#ga51024b65418ae9a0e6d79fe285479b9c"&gt;NRF_LOG_FLOAT_MARKER&lt;/a&gt;&lt;span&gt;&amp;nbsp;use 3 arguments to print one float (&amp;quot;%s%d.%02d&amp;quot;). You can use &lt;a href="https://www.tutorialspoint.com/c_standard_library/c_function_sprintf.htm"&gt;sprintf&lt;/a&gt; to print more floats to a string, and pass this string to NRF_LOG afterwards.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>