<?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 write uint8_t some_array via FDS ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/31990/how-to-write-uint8_t-some_array-via-fds</link><description>Hello everyone, 
 I use sdk14.2 softdevice S132. I want to write &amp;quot;uint8_t some_array [7] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06};&amp;quot; with use fds_write and read the array from the memory location and store the array into another array. Prosses like this;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 09 May 2018 10:45:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/31990/how-to-write-uint8_t-some_array-via-fds" /><item><title>RE: How to write uint8_t some_array via FDS ?</title><link>https://devzone.nordicsemi.com/thread/131478?ContentTypeID=1</link><pubDate>Wed, 09 May 2018 10:45:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4260a778-2f8b-45e7-b459-90f7466934f7</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;I am glad to hear you found a solution &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to write uint8_t some_array via FDS ?</title><link>https://devzone.nordicsemi.com/thread/124481?ContentTypeID=1</link><pubDate>Thu, 15 Mar 2018 04:54:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd315dd1-1f28-4f86-bd5e-83a652035d1e</guid><dc:creator>purgoufr</dc:creator><description>&lt;p&gt;I still have not figured out how to do it using FDS, but fStorage does work. Thank you&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to write uint8_t some_array via FDS ?</title><link>https://devzone.nordicsemi.com/thread/124303?ContentTypeID=1</link><pubDate>Wed, 14 Mar 2018 09:09:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:923b4ee4-3d38-48c8-b87f-16641070a738</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;1) No, you can remove the CLI library if you like. This is just included to provide a command line interface when running the example. If you delete all the cli_xxx functions from main.c the library should no longer be used.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2) The m_hello_world variable is a char array, which is almost the same as a uint8_t array (the only difference is that char is signed, while uint8_t is unsigned).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can modify line 292 in main.c to write your some_array instead of m_hello_world:&lt;br /&gt; rc = nrf_fstorage_write(&amp;amp;fstorage, 0x3f000, some_array, sizeof(some_array), NULL);&lt;br /&gt; APP_ERROR_CHECK(rc);&lt;/p&gt;
&lt;p&gt;The read function works almost exactly the same, and you can use that to read the data into another array:&lt;/p&gt;
&lt;p&gt;rc = nrf_fstorage_read(&amp;amp;fstorage, 0x3f000, second_array, sizeof(second_array));&lt;br /&gt;APP_ERROR_CHECK(rc);&lt;/p&gt;
&lt;p&gt;If you just want to move data from one RAM buffer to another you can also use memcpy(..), but you&amp;nbsp;probably know this already.&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: How to write uint8_t some_array via FDS ?</title><link>https://devzone.nordicsemi.com/thread/124192?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2018 14:23:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47e65c1d-56ff-472d-94f5-6e3657edcb27</guid><dc:creator>purgoufr</dc:creator><description>&lt;p&gt;Hi ovrebekk, thanks for your answer. I have a few questions;&lt;/p&gt;
&lt;p&gt;Q-1&amp;nbsp;Do I have to use the Cli.c library? If no, how to read array and then&amp;nbsp; store&amp;nbsp;it&amp;nbsp;&lt;span&gt;into another array ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Q-2&amp;nbsp;Is there an example of FDS that I have described above (uint8_t some_array [7])?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I looked the&amp;nbsp;&lt;a href="https://github.com/hubuhubu/nRF52-fds-example/blob/master/main.c"&gt;LINK&lt;/a&gt;, but it wrote &amp;quot;&lt;span class="pl-k"&gt;static&lt;/span&gt; &lt;span class="pl-c1"&gt;uint32_t&lt;/span&gt; &lt;span class="pl-k"&gt;const&lt;/span&gt; m_deadbeef[&lt;span class="pl-c1"&gt;2&lt;/span&gt;] = {&lt;span class="pl-c1"&gt;0xDEADBEEF&lt;/span&gt;,&lt;span class="pl-c1"&gt;0xBAADF00D&lt;/span&gt;};&amp;quot;&amp;nbsp;&amp;nbsp;This is not exactly what I want to learn.&amp;nbsp;&amp;quot;uint8_t some_array [7] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06};&amp;quot; I want to save it and read it, then copy it to another array.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to write uint8_t some_array via FDS ?</title><link>https://devzone.nordicsemi.com/thread/124181?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2018 13:45:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2022f47-6194-494d-9100-816c29356282</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ugur&lt;/p&gt;
&lt;p&gt;Have you had a look at the fstorage example in the SDK?&lt;/p&gt;
&lt;p&gt;If you are looking for a simple library to read and write one or more bytes to flash I think fstorage is the better choice. FDS is more sophisticated, but&amp;nbsp;might be a bit overkill for what you are trying to do.&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></channel></rss>