<?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>fatfs example doesn&amp;#39;t work with SDHC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54164/fatfs-example-doesn-t-work-with-sdhc</link><description>Hi 
 
 I am using fafs example from SDK 15.0.0 
 It was possible to write to the SD card by SPI communication. However, using SanDisk&amp;#39;s 32GBSDHC, it became impossible to write. Do fatfsexample is not me to the discrimination of SD and SDHC automatically</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Nov 2019 07:56:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54164/fatfs-example-doesn-t-work-with-sdhc" /><item><title>RE: fatfs example doesn't work with SDHC</title><link>https://devzone.nordicsemi.com/thread/220224?ContentTypeID=1</link><pubDate>Fri, 15 Nov 2019 07:56:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:044940e1-527a-43e6-87c8-3002d0efee45</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!&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;It worked well by sending a dummy clock&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fatfs example doesn't work with SDHC</title><link>https://devzone.nordicsemi.com/thread/219825?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2019 08:45:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d7251da-32ee-4697-8b90-0665b016a71b</guid><dc:creator>ketiljo</dc:creator><description>&lt;p&gt;I think it&amp;#39;s 74 clock cycles, not bytes. That should be in the code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The CS pin is handled by the library, there shouldn&amp;#39;t be any need to change this. You just change the pin to suit your config, see &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/app_sdcard_example.html?cp=5_1_4_6_36"&gt;documentation&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fatfs example doesn't work with SDHC</title><link>https://devzone.nordicsemi.com/thread/219811?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2019 07:49:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbbf2ae0-d375-4f67-9fbe-a5a103d7ad68</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 understand.&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;I&amp;#39;ll give it a try.&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;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 have one thing to worry about,&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 think it is necessary to send 74 bytes of dummy data as the SD card initialization procedure, but this code does not find that description.&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;Where is the code to send dummy data?&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;Or do I have to write?&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 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 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;And there &amp;rsquo;s another area I &amp;rsquo;m interested in,&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;Is it not necessary to ASSERT or DEASSERT CS before and after using sdc_cmd ()?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fatfs example doesn't work with SDHC</title><link>https://devzone.nordicsemi.com/thread/219620?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2019 09:27:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c1eecb2-e386-4edb-a8d5-1a94ecce2a05</guid><dc:creator>ketiljo</dc:creator><description>&lt;p&gt;As the example code don&amp;#39;t support SDHC cards, you either have use a SD card, or change the code yourself. Use the info in the link in my first answer and check is there are more info elsewhere.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fatfs example doesn't work with SDHC</title><link>https://devzone.nordicsemi.com/thread/219579?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2019 05:57:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6f13691-91ae-4024-b24a-3a39018cebfa</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 read the program, but you&amp;#39;ve judged whether it&amp;#39;s SDHC, right?&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;What is missing to actually enable SDHC?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fatfs example doesn't work with SDHC</title><link>https://devzone.nordicsemi.com/thread/219426?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2019 10:15:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22ba17fc-1639-4c54-9684-caedacbe5966</guid><dc:creator>ketiljo</dc:creator><description>&lt;p&gt;Yes&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fatfs example doesn't work with SDHC</title><link>https://devzone.nordicsemi.com/thread/219380?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2019 05:03:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6465bf6e-4dc5-4077-a4bf-9d4ceb6127f8</guid><dc:creator>y001</dc:creator><description>&lt;p&gt;Thank you for your reply!&lt;/p&gt;
&lt;p&gt;So should I change the sdc_cmd in the code from line 510 to line 634 of &amp;quot;app_sdcard.c&amp;quot;?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static PT_THREAD(sdc_pt_identification(uint8_t * p_rx_data,
                                       uint8_t rx_length,
                                       sdc_result_t * p_exit_code))
{
    uint8_t r1   = p_rx_data[0];
    uint32_t rsp = ((uint32_t)p_rx_data[1] &amp;lt;&amp;lt; 24)
                   | ((uint32_t)p_rx_data[2] &amp;lt;&amp;lt; 16)
                   | ((uint32_t)p_rx_data[3] &amp;lt;&amp;lt; 8)
                   | ((uint32_t)p_rx_data[4]);
    uint32_t arg;
    ret_code_t err_code;
    sdc_result_t sub_exit_code;

    PT_BEGIN(SDC_PT);
    while (1)
    {
        err_code = sdc_cmd(CMD0, 0, SDC_R1);
        APP_ERROR_CHECK(err_code);
        PT_YIELD(SDC_PT);
        err_code = sdc_cmd(CMD0, 0, SDC_R1);
        APP_ERROR_CHECK(err_code);
        PT_YIELD(SDC_PT);

        SDC_RESP_CHECK(SDC_PT, r1);
        // Send CMD8 with fixed argument - 0x01AA.
        err_code = sdc_cmd(CMD8, 0x1AA, SDC_R7);
        APP_ERROR_CHECK(err_code);
        PT_YIELD(SDC_PT);

        if (!(r1 &amp;amp; SDC_FLAG_ILLEGAL_COMMAND))
        {
            // CMD8 was accepted - SD v2 card.
            m_cb.info.type.version = SDC_TYPE_SDV2;
            SDC_RESP_CHECK(SDC_PT, r1);
        }

        m_cb.state.retry_count = 0;
        arg = (m_cb.info.type.version == SDC_TYPE_SDV2) ? SDC_HCS_FLAG_MASK : 0;
        err_code = sdc_cmd(ACMD41, arg, SDC_R3);
        APP_ERROR_CHECK(err_code);
        PT_YIELD(SDC_PT);

        if (r1 &amp;amp; SDC_FLAG_ILLEGAL_COMMAND)
        {
            // ACMD41 was rejected - MMC card.
            m_cb.info.type.version = SDC_TYPE_MMCV3;
            r1 &amp;amp;= ~SDC_FLAG_ILLEGAL_COMMAND;

            do
            {
                ++m_cb.state.retry_count;
                if (m_cb.state.retry_count &amp;gt; SDC_MAX_RETRY_COUNT_INIT)
                {
                    SDC_BREAK(SDC_PT, SDC_ERROR_TIMEOUT);
                }

                err_code = sdc_cmd(CMD1, 0, SDC_R3);
                APP_ERROR_CHECK(err_code);
                PT_YIELD(SDC_PT);
                SDC_RESP_CHECK(SDC_PT, r1);
            }
            while (r1 &amp;amp; SDC_FLAG_IN_IDLE_STATE);
        }
        else
        {
            // SDv1 or SDv2 card. Send CMD58 or retry ACMD41 if not ready.
            SDC_RESP_CHECK(SDC_PT, r1);

            while (r1 &amp;amp; SDC_FLAG_IN_IDLE_STATE)
            {
                ++m_cb.state.retry_count;
                if (m_cb.state.retry_count &amp;gt; SDC_MAX_RETRY_COUNT_INIT)
                {
                    SDC_BREAK(SDC_PT, SDC_ERROR_TIMEOUT);
                }

                arg = (m_cb.info.type.version == SDC_TYPE_SDV2) ? SDC_HCS_FLAG_MASK : 0;
                err_code = sdc_cmd(ACMD41, arg, SDC_R3);
                APP_ERROR_CHECK(err_code);
                PT_YIELD(SDC_PT);
                SDC_RESP_CHECK(SDC_PT, r1);
            }

            err_code = sdc_cmd(CMD58, 0, SDC_R3);
            APP_ERROR_CHECK(err_code);
            PT_YIELD(SDC_PT);
            SDC_RESP_CHECK(SDC_PT, r1);

            if (rsp &amp;amp; SDC_HCS_FLAG_MASK)
            {
                m_cb.info.type.sdhc = 1;
            }
        }

        if (m_cb.info.type.version != SDC_TYPE_SDV2)
        {
            // Set block length to 512 (SDv1 and MMC cards only.)
            err_code = sdc_cmd(CMD16, SDC_SECTOR_SIZE, SDC_R1);
            APP_ERROR_CHECK(err_code);
            PT_YIELD(SDC_PT);
            SDC_RESP_CHECK(SDC_PT, r1);
        }

        // Setup the read operation and get the contents of 128-bit CSD register.
        m_cb.state.rw_op.buffer = m_cb.work_buf;
        m_cb.state.rw_op.block_count = 1;

        err_code = sdc_cmd(CMD9, 0, SDC_R1);
        APP_ERROR_CHECK(err_code);
        PT_YIELD(SDC_PT);
        SDC_RESP_CHECK(SDC_PT, r1);

        p_rx_data += SDC_R1_LEN;
        rx_length -= SDC_R1_LEN;
        PT_SPAWN(SDC_PT, SDC_PT_SUB, sdc_pt_sub_data_read(p_rx_data, rx_length, \
                                                          16, &amp;amp;sub_exit_code));
        SDC_RESULT_CHECK(SDC_PT, sub_exit_code);

        m_cb.info.num_blocks = sdc_calculate_size(m_cb.work_buf);
        m_cb.info.block_len  = SDC_SECTOR_SIZE;

        SDC_BREAK(SDC_PT, SDC_SUCCESS);
    }
    PT_END(SDC_PT)
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fatfs example doesn't work with SDHC</title><link>https://devzone.nordicsemi.com/thread/219315?ContentTypeID=1</link><pubDate>Fri, 08 Nov 2019 14:36:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4dc9619-d805-4a21-a4b5-225cfcb0fadf</guid><dc:creator>ketiljo</dc:creator><description>&lt;p&gt;There are &lt;a href="https://stackoverflow.com/questions/8080718/sdhc-microsd-card-and-spi-initialization"&gt;differences in the initialization&lt;/a&gt; of SD and SDHC cards. SDHC is not currently supported by the fatfs example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>