<?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>SD is not initialized</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81870/sd-is-not-initialized</link><description>Hello everyone, 
 i want to use the 52810 to write into a SD -card, i use a slightly modified fatfs example. 
 The problem is, the SD card will not initialize as the p_event-&amp;gt;result gets the value: SDC_ERROR_DATA. 
 I am using the SPM_0 instance for SPI</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 Nov 2021 10:27:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81870/sd-is-not-initialized" /><item><title>RE: SD is not initialized</title><link>https://devzone.nordicsemi.com/thread/340006?ContentTypeID=1</link><pubDate>Mon, 22 Nov 2021 10:27:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c2fcc7b-009c-495d-854d-95c701223b6d</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Just to make sure, you have set the SPI instance used&amp;nbsp;to communicate with the SD card to use instance 0, right? The pins you&amp;#39;re using should be okay to use, but please make sure that they&amp;#39;re not used for something else in your application as well.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Since your application works on an nRF52832, have you made the changes necessary for the project to run on an nRF52810? Please check out the Developing for&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/nrf52810_user_guide.html"&gt; nRF52810 user guide in the Infocenter&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If this doesn&amp;#39;t help either, I would suggest we do a HW review of your design, so we can make sure everything is all right there. If you&amp;#39;d like I can set this case to private mode so that only yourself and Nordic engineers will be able to see its content. Then you can upload your schematics and gerber files here, so we can do a review for you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD is not initialized</title><link>https://devzone.nordicsemi.com/thread/339830?ContentTypeID=1</link><pubDate>Fri, 19 Nov 2021 13:24:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c748f1c6-fc35-4d7c-8e9e-59e2b5b58261</guid><dc:creator>Javiehm</dc:creator><description>&lt;p&gt;Hey!&amp;nbsp;&lt;br /&gt;So i haven&amp;acute;t changed the&amp;nbsp; initialization other than the way it is called. I actually have it running on the dev board 52832 on SPI Instance 1,&amp;nbsp; for the testing we received a 52810 due to the processor scarcity... and lost the additional spi instace.&lt;/p&gt;
&lt;p&gt;The pins for the sd card were set to 0.13,0.14,0.15,0.16 (SS, Miso, mosi, clk respectively) by the board developers the 0.4/0.5,0.6,0.7,0.8 are also designed to be SPI (this would be instance 0 in the 32)&lt;/p&gt;
&lt;p&gt;The SD Card is also the same that i use in the 32 and it worked there... so i wonder if it has something to do with the pins, but i checked&amp;nbsp; the sdk.config and made sure has all spi_instance_1 set to 0. unless it is something with the 10 that is missing from the 32 i suppouse it is a HW wrong designe&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;//in main
  spiConfigLocation=spi_0_mem_str_pointer;

  gpio_init();

  initializeSD_Card_Instance(spi_0_mem_str_pointer); // the pointer to a structure with SS, MOSI,MISO CLK, tx, rx, etc
  //it enters the while, but it wont active the sdcard
  while{
  ...
  transmitToSDCard(spi_0_mem_str_pointer);
  ... 
  
  }
  
  
  
  /////////////////////////////////////////////
  ////////////////////////////////////////////
  spi_tasks.c
  
  
  /********************
***
*** InitializeSD_Card_Instance()
*** This function initializes the SPI Instance to communicate with the SD Card
***
********************/
void initializeSD_Card_Instance(spi_1_mem_str_pointer){

    uint32_t bytes_written;

    // Initialize FATFS disk I/O interface by providing the block device.
    static diskio_blkdev_t drives[] =
    {
            DISKIO_BLOCKDEV_CONFIG(NRF_BLOCKDEV_BASE_ADDR(m_block_dev_sdc, block_dev), NULL)     //no changes
    };

    diskio_blockdev_register(drives, ARRAY_SIZE(drives));

    NRF_LOG_INFO(&amp;quot;Initializing disk 0 (SDC)...&amp;quot;);
    for (uint32_t retries = 3; retries &amp;amp;&amp;amp; disk_state; --retries)
    {
        disk_state = disk_initialize(0);
    }
    if (disk_state)
    {
        NRF_LOG_INFO(&amp;quot;Disk initialization failed.&amp;quot;);
        return;
    }

    uint32_t blocks_per_mb = (1024uL * 1024uL) / m_block_dev_sdc.block_dev.p_ops-&amp;gt;geometry(&amp;amp;m_block_dev_sdc.block_dev)-&amp;gt;blk_size;
    uint32_t capacity = m_block_dev_sdc.block_dev.p_ops-&amp;gt;geometry(&amp;amp;m_block_dev_sdc.block_dev)-&amp;gt;blk_count / blocks_per_mb;
    NRF_LOG_INFO(&amp;quot;Capacity: %d MB&amp;quot;, capacity);

    NRF_LOG_INFO(&amp;quot;Mounting volume...&amp;quot;);
    ff_result = f_mount(&amp;amp;fs, &amp;quot;&amp;quot;, 1);
    if (ff_result)
    {
        NRF_LOG_INFO(&amp;quot;Mount failed.&amp;quot;);
        return;
    }

    NRF_LOG_INFO(&amp;quot;\r\n Listing directory: /&amp;quot;);
    ff_result = f_opendir(&amp;amp;dir, &amp;quot;/&amp;quot;);
    if (ff_result)
    {
        NRF_LOG_INFO(&amp;quot;Directory listing failed!&amp;quot;);
        return;
    }
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD is not initialized</title><link>https://devzone.nordicsemi.com/thread/339794?ContentTypeID=1</link><pubDate>Fri, 19 Nov 2021 10:26:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfbc6b6a-4391-46f0-b862-5423f829bcc3</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Can you explain what exactly you have modified? Have you modified the FATfs disk I/O initialization at all? Can you show me a snippet of your initialization? The SDC_ERROR_DATA points to an error with the data read or write, so it could be a HW issue as well. What GPIOs on the nRF52810 are you using to connect to the SD-card module?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>