<?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>How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16769/how-to-store-float-array-in-nrf51-using-fds</link><description>hi NORDIC, 
 is it possible to store float array in fds. i am able to store intrger values but unable to store float values. i am using example in this link :- github.com/.../nRF52-fds-example 
 i am writing float m_deadbeef[20][3]; //////(LIKE this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Oct 2016 11:23:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16769/how-to-store-float-array-in-nrf51-using-fds" /><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64143?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2016 11:23:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac2e256a-2c61-43c1-ac0f-1879f5658976</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Each int16_t will take two bytes, but as you specify the length in words (&lt;code&gt;record_chunk.length_words&lt;/code&gt;) you will have to round up  to the closest word length. One word is 4 bytes.&lt;/p&gt;
&lt;p&gt;So if you have an array of 3 int16_t values (int16_t data[3]) the length have to be 2, so it will occupy 8 bytes, even though the array itself is only 6 bytes. The 2 bytes that are not used will be garbage.&lt;/p&gt;
&lt;p&gt;If you have an array of 4 int16_t values (int16_t data[4]) the length also have to be 2 and it will occupy 8 bytes.&lt;/p&gt;
&lt;p&gt;In addition for every record you will have a 12 bytes header, see &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.0.0/lib_fds_format.html?cp=4_0_0_3_31_1"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64142?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2016 10:29:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:436c4299-4709-4b57-b9bf-04254a6fd588</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;hi,
how much size it will take if i write int16_t value in to the flash using FDS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64147?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2016 10:29:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de2e5e11-ffa9-4665-a08e-65a33d7faa51</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;hi,
how much size it will take if i write int16_t value in to the flash using FDS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64146?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2016 12:32:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffb6d7e9-9b1a-4f20-bc04-a86f8890cdb2</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Indeed - that&amp;#39;s what I was trying to tell him all along, that his version of printf probably didn&amp;#39;t do anything with floats and why I suggested casting to ints to print, because that always works and would have proved it was just the output was an issue.&lt;/p&gt;
&lt;p&gt;Never mind.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64145?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2016 12:28:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d01e6be9-8b69-4bf4-abd4-447f30624d32</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;So, RK&amp;#39;s idea was actually correct - it was problem with compiled version of printf, that has to bo float-enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64144?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2016 12:21:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abc5d6f4-32b8-4a8b-a00c-6e77930120b3</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;Found the solution. The problem is here i am able to write the float array[20][3]; and also able to read. but while printing  Termite is not printing Float values through UART.&lt;/p&gt;
&lt;p&gt;by placing&lt;/p&gt;
&lt;p&gt;LDFLAGS += --specs=nano.specs -lc -lnosys  &lt;strong&gt;-u _printf_float&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;in the Make file  i am able to print float array.&lt;/p&gt;
&lt;p&gt;Anyway &lt;strong&gt;thanks RK, Ole Bauck&lt;/strong&gt;  for helping me&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64141?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 12:54:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e124995-50ef-4af4-89a6-2f3a63a15d5c</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Have you tried what I suggested yet? Changing&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_LOG_PRINTF(&amp;quot;%f &amp;quot;,data[i]);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_LOG_PRINTF(&amp;quot;%d &amp;quot;,(int(data[i]*1000));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or even ... use an actual debugger and go look at the values instead of logging them. There&amp;#39;s a reason debuggers were invented.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64140?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 12:51:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbdedc8e-24be-4e44-a23b-8bf51530026d</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;i even unable to store and read this value&lt;/p&gt;
&lt;p&gt;static float const m_deadbeef[1] = {1.23};&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64132?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 11:37:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:129e6229-c2ec-4503-a286-051b573f9d4f</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I didn&amp;#39;t suggest not STORING floats, I suggested convering them to integers to print them in your test because there are some instances of printf() which do not deal with floats.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64131?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 11:35:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08a5c362-301a-412a-a658-c945b061b74c</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;@RK :- It will definitely work but my requirement is i need to store only floats.&lt;/p&gt;
&lt;p&gt;and also there is so many values like this  0.0234, 0.2,35.002, -0.005. it is not possible to multiply with 1000.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64133?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 11:24:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb36bb75-1274-4983-b7fa-ef0677d2c144</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Does your printf() actually print floats properly? Some don&amp;#39;t. Try multiplying by 1000, casting to an integer and printing with %d to see if you get anything different.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64130?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 11:19:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa0d22f0-d570-4e96-a0e3-4f3b9f36469a</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;here is my main.c&lt;/p&gt;
&lt;p&gt;&lt;a href="https://drive.google.com/open?id=0ByjgT_Zt3YyJMUV5MzJVaFBZNVk"&gt;drive.google.com/open&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64129?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 11:13:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a92e2e1-a8e0-49a4-9cf1-583a35cef3ce</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;@Ole Bauck :-
i commented my m_deadbeef float array above. can u try with that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64128?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 11:10:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a51cd37-d394-4dfe-a637-3a9e18853616</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;@Alex:- same issue i am facing even i replace record_chunk.length_words = sizeof(m_deadbeef)/sizeof(uint32_t);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64127?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 11:10:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d802277-ba51-45bb-ace8-d8b7f243b6c5</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;I can&amp;#39;t figure out what is wrong. I test with the same code and it is working fine. Can you just try to print out the content of m_deadbeef to see if that works?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64126?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 11:08:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64caf3a8-f6f8-4a6a-ae06-cf091053965f</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;let me try&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64139?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 11:07:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69089152-dfc4-4b32-85ce-4a13c6b45f2f</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Are you sure m_deadbeef[0][0] has size of word? I would try something like record_chunk.length_words = sizeof(m_deadbeef)/sizeof(uint32_t);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64138?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 11:00:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa22349d-ddf8-48b8-b80e-32d07b226565</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;if i write integer array m_deadBeef[20][3]&lt;/p&gt;
&lt;p&gt;it is working fine and also i am able to read it back....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64137?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 10:58:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0089ebfa-7961-47ac-9b9b-9a303385c391</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;here the info the terminal is giving.&lt;/p&gt;
&lt;p&gt;Writing Record ID = 1&lt;/p&gt;
&lt;p&gt;Start searching...&lt;/p&gt;
&lt;p&gt;Found Record ID = 1&lt;/p&gt;
&lt;p&gt;Data =&lt;/p&gt;
&lt;p&gt;may be these are emty space char&amp;#39;s&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64136?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 10:51:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a827b6ac-7a21-404b-9730-bcf87ae4eb59</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;yes i defined it globally&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64135?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 10:49:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76efaac3-09f5-45e0-986e-8142c31adbea</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;What is the output you are seeing in the terminal?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64134?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 10:48:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffac867c-f9a7-4b35-b524-d969f546c57e</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;This should work, I don&amp;#39;t see what is wrong. m_deadbeef is defined globally (outside the fds_test_write function)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64125?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 10:43:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4b7430f-f9ba-4cb3-a048-ba76ce96a7ae</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;here is my float data:------&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;float m_deadbeef[20][3] = {

		{2.002139,      4.295340,       12.436197,      },

		{2.575441,      4.983300,       12.436197,      },

		{2.804763,      4.753978,       12.206882,      },

		{2.690099,      4.524662,       12.436197,      },

		{3.034079,      4.295340,       11.748239,      },

		{3.263401,      4.066018,       11.977560,      },

		{3.148742,      4.066018,       12.550861,      },

		{2.919421,      3.836702,       13.009499,      },

		{2.804763,      3.722038,       13.124157,      },

		{2.919421,      3.492722,       13.009499,      },

		{3.263401,      3.722038,       12.665519,      },

		{3.492722,      4.409998,       13.582801,      },

		{1.887481,      3.951360,       13.124157,      },

		{2.346119,      4.409998,       12.206882,      },

		{1.658159,      4.180682,       12.436197,      },

		{1.887481,      4.180682,       12.780177,      },

		{2.690099,      3.951360,       12.550861,      },

		{3.263401,      3.722038,       12.321539,      },

		{3.836702,      3.722038,       12.206882,      },

		{3.148742,      3.263401,       12.665519,      },
};
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64124?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 10:40:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aed090fc-8834-4d98-8049-9cc84fe3aab5</guid><dc:creator>saiteja</dc:creator><description>&lt;p&gt;hi
can u check my write function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store Float array in nRF51 using FDS</title><link>https://devzone.nordicsemi.com/thread/64123?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 10:33:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa2179e1-55b9-4671-ae31-e208bdd15207</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;It should work with floats as well, could you post the write function in your question also?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>