<?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>NRF9160 zephyr os cannot use the sscanf</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51464/nrf9160-zephyr-os-cannot-use-the-sscanf</link><description>Dear All, 
 
 I am trying to use sscanf in a project and I am getting the message that it is undefined. I am including &amp;lt;stdio.h&amp;gt;. 
 I cannot understand/find the reason of the problem. The most similar question to mine I could find was this and it didn</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Jun 2024 21:26:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51464/nrf9160-zephyr-os-cannot-use-the-sscanf" /><item><title>RE: NRF9160 zephyr os cannot use the sscanf</title><link>https://devzone.nordicsemi.com/thread/491186?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2024 21:26:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:993e7fe9-6f41-44fe-840a-f733778703de</guid><dc:creator>zsn</dc:creator><description>&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;the solution is I needed to enable it&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_NEWLIB_LIBC_FLOAT_SCANF&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 zephyr os cannot use the sscanf</title><link>https://devzone.nordicsemi.com/thread/491185?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2024 21:17:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c31f1496-c67f-4179-973c-449e9d531b8b</guid><dc:creator>zsn</dc:creator><description>&lt;p&gt;I know this is too old ticket but,&amp;nbsp; I cant use sscanf for float numbers, even though I enabled&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_NEWLIB_LIBC_FLOAT_PRINTF&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_NEWLIB_LIBC_NANO&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1719523028551v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;but sscanf works ok for&amp;nbsp;the Not a floating-point number&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="text"&gt;char input[] = &amp;quot;23.98&amp;quot;;
 float vald = 0;
 int num_parsed = sscanf(input, &amp;quot;%f&amp;quot;, &amp;amp;vald);

printk(&amp;quot;Input: %s\n&amp;quot;, input);
 printk(&amp;quot;Parsed values: %f\n&amp;quot;, (double)vald);
printk(&amp;quot;Number of values parsed: %d\n&amp;quot;, num_parsed);



return: 

Input: 23.98
Parsed values: 0.000000
Number of values parsed: 0&lt;/pre&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 zephyr os cannot use the sscanf</title><link>https://devzone.nordicsemi.com/thread/206426?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 14:35:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8aa3a4cd-3ac0-4684-aeab-325d85465adb</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The default libc is the zephyr minimal libc, which does not include a implementation of sscanf. Could you try adding&amp;nbsp;&lt;span&gt;CONFIG_NEWLIB_LIBC=y to your prj.conf and recompile?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Håkon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>