<?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>It takes time to write to the SDHC card</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54805/it-takes-time-to-write-to-the-sdhc-card</link><description>Hello! 
 I currently want to save the sensor data obtained by SPI communication to the microSDHC card by SPI communication. 
 Writing to the SDHC card is possible without problems, but writing takes time. 
 I want to acquire and write sensor values at</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 Dec 2019 08:27:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54805/it-takes-time-to-write-to-the-sdhc-card" /><item><title>RE: It takes time to write to the SDHC card</title><link>https://devzone.nordicsemi.com/thread/223789?ContentTypeID=1</link><pubDate>Thu, 05 Dec 2019 08:27:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4acf5a3b-e8f8-46ab-acd6-18a8c195339d</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Ok, I will close the case then.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Good luck with your project &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: It takes time to write to the SDHC card</title><link>https://devzone.nordicsemi.com/thread/223769?ContentTypeID=1</link><pubDate>Thu, 05 Dec 2019 07:27:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:616fa01a-1481-4955-ba47-e4cd5b099841</guid><dc:creator>y001</dc:creator><description>&lt;p&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;Maybe solved&lt;/span&gt;&lt;br style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" /&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;Interrupted except f_write!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your cooperation&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: It takes time to write to the SDHC card</title><link>https://devzone.nordicsemi.com/thread/223217?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2019 07:49:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99f9e707-88ac-4fe5-aaeb-f43287f99770</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Do you have a specification for the flash chip used in the SanDisk card, so that you can verify the timing parameters?&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: It takes time to write to the SDHC card</title><link>https://devzone.nordicsemi.com/thread/223190?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2019 04:37:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ea58fd1-6b8a-4e89-817c-cc64e8e4f1fb</guid><dc:creator>y001</dc:creator><description>&lt;p&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;I use SanDisk&amp;#39;s 32GB SDHC card.&lt;/span&gt;&lt;br style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" /&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;Since there is no other SD card, I have not tried it.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span title=""&gt;All MPU data is necessary and cannot be reduced.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: It takes time to write to the SDHC card</title><link>https://devzone.nordicsemi.com/thread/223095?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2019 14:35:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5044e9ef-c724-483b-9391-10ae2b1e0a18</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Thanks a lot for the additional information.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The write speed of flash cards vary a lot from model to model, so without a full specification of your card it is hard to say how much speed you can expect.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What type of microSD card are you using?&lt;/p&gt;
&lt;p&gt;Have you tried to change the card for a different one to see if this could improve the communication speed?&lt;/p&gt;
&lt;p&gt;Have you investigated if you could remove or compress some of the MPU data to reduce the amount of data that you need to store to the card?&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: It takes time to write to the SDHC card</title><link>https://devzone.nordicsemi.com/thread/222479?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2019 01:46:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c79434b5-e1d1-4c0c-9c96-991b47c0ec98</guid><dc:creator>y001</dc:creator><description>&lt;p&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;Hi&lt;/span&gt;&lt;br style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" /&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;・ About the time to fill the buffer with 512 bytes&lt;/span&gt;&lt;br style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" /&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;As the flow of processing I am currently doing,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ret_code_t ret = nrf_drv_spi_xfer(&amp;amp;spi,&amp;amp;xfer_spi,flags);
if(ret == NRF_SUCCESS){
    uint32_t start_tsk_addr = nrf_drv_spi_start_task_get(&amp;amp;spi);

    for(a = 0; a &amp;lt;20;a++){
        buf[j*21+a] = mpu_buf[a];
    }
    buf[j*21+20] = time;

    if(j == 24)
    {
        f_write(&amp;amp;file, buf2,512, (UINT *) &amp;amp;bytes_written);
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;It looks like this.&lt;/span&gt;&lt;br style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" /&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;The sensor value is read into the array every 1 ms and written when 512 bytes are accumulated.&lt;/span&gt;&lt;span style="background-color:transparent;color:rgba(0, 0, 0, 0.87);float:none;font-family:&amp;#39;Roboto&amp;#39;,arial,sans-serif;font-size:18px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:28px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;"&gt; &lt;/span&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;At this time, the variable &amp;ldquo;time&amp;rdquo; is also incremented by +1 every 1 ms, and it is confirmed that there is no data loss by looking at the written data.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;When the written data is confirmed, the value of &amp;ldquo;time&amp;rdquo; continues to increase by +1 for 512 bytes, but when it reaches the next 512 bytes, the value jumps 18 milliseconds.&lt;/p&gt;
&lt;p&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;From this&lt;br style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" /&gt;21 bytes (data + time) * 24 ms = 504 bytes&lt;br style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" /&gt;I think that it is 24ms to collect 512 bytes more.&lt;br style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" /&gt;I think that it takes time for processing to be f_write of fatfs.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span title=""&gt;・ About flash writing of soft device&lt;/span&gt;&lt;br /&gt;&lt;span title=""&gt;Thank you for teaching me.&lt;/span&gt; &lt;span title=""&gt;I understood that there was no need to think about this time.&lt;/span&gt;&lt;span title=""&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span title=""&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span title=""&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;・ SPI clock speed&lt;/span&gt;&lt;br style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" /&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;The clock is set to 1MHz for both SPI0 (SDcard) and SPI1 (sensor)&lt;/span&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span title=""&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span title=""&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span title=""&gt;&lt;span title=""&gt;Is there a way to shorten the processing time of the external flash?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span title=""&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: It takes time to write to the SDHC card</title><link>https://devzone.nordicsemi.com/thread/222394?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2019 14:26:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd6004d9-8f41-4295-9949-f54c033bc4ca</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;How long does it take you to fill the 512-byte buffer?&lt;/p&gt;
&lt;p&gt;If you sample the ADC at 1000 Hz I would expect you to spend much more than 18ms to fill the 512 byte buffer?&lt;/p&gt;
&lt;p&gt;Regarding your comment that flash operation takes time with SoftDevice, keep in mind that this refers to writing to the internal flash. When you write to an external flash you don&amp;#39;t have this issue, the only question is how long time it takes to transfer the data over the SPI, and how long the external flash needs to process the data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What clock speed is the SPI running at?&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: It takes time to write to the SDHC card</title><link>https://devzone.nordicsemi.com/thread/222204?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2019 04:29:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad338d73-5f75-45a1-8f06-9cead10fb44c</guid><dc:creator>y001</dc:creator><description>&lt;p&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;Thank you for your reply.&lt;/span&gt;&lt;br style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" /&gt;&lt;span style="background-attachment:scroll;background-color:transparent;background-image:none;background-repeat:repeat;background-size:auto;color:rgba(0, 0, 0, 0.87);font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:pre-wrap;" title=""&gt;I already have data stored in a 512-byte buffer before writing.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: It takes time to write to the SDHC card</title><link>https://devzone.nordicsemi.com/thread/222002?ContentTypeID=1</link><pubDate>Tue, 26 Nov 2019 08:01:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84231cb1-a55c-4c2c-9900-c716ad07a29a</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How much data are you writing in each write operation?&lt;/p&gt;
&lt;p&gt;I assume you would get more efficient SD access if you buffer the ADC data in 512 byte&amp;nbsp;chunks so you don&amp;#39;t have to write to the card as often?&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>