<?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>Two SD card interfaces over SPI.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63676/two-sd-card-interfaces-over-spi</link><description>I have a working code to get FatFs running with SD card over SPI0 interface on a nRF52840 DK. I wanted to know if it is possible to add another SD card with FatFs on SPI2 interface and access the cards in the same firmware. The file, nrf_block_dev_sdc</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 19 Jul 2020 11:10:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63676/two-sd-card-interfaces-over-spi" /><item><title>RE: Two SD card interfaces over SPI.</title><link>https://devzone.nordicsemi.com/thread/260702?ContentTypeID=1</link><pubDate>Sun, 19 Jul 2020 11:10:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cda9398f-e572-495b-adf8-d96197e05f88</guid><dc:creator>Sreejit</dc:creator><description>&lt;p&gt;Hi Edvin.&lt;/p&gt;
&lt;p&gt;Thanks for your answer. I went ahead and duplicated the files, app_sdcard.c/.h and nrf_block_dev_sdc.c/.h and other data structures in nrf_block_dev.h . It seems to work fine for now. This will need some thorough testing though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two SD card interfaces over SPI.</title><link>https://devzone.nordicsemi.com/thread/260146?ContentTypeID=1</link><pubDate>Wed, 15 Jul 2020 12:40:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bfe0c32-9325-40be-9db4-a20f033a2dca</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;It is not certain you need to do this. Perhaps you should either use one instance of nrf_block_dev_sdc_t and switch it between the SD card readers that you are using?&lt;/p&gt;
&lt;p&gt;I think I would start by expanding:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    // 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)
    };&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;To contain twi DISKIO_BLOCKDEV_CONFIG().&lt;/p&gt;
&lt;p&gt;Then, in order to use the other disk, you would e.g. call&amp;nbsp;disk_initialize(1), which will point to the other disk.&lt;/p&gt;
&lt;p&gt;But from there I am not certain. The fatfs is an external library, so I am not familiar with it. It looks like one instance of FATFS fs, which is used in f_mount(&amp;amp;fs, ...) mounts one drive, so you need to figure out how to make this mount drive 1 instead of drive 0. I see that FATFS has a member called drv, but I don&amp;#39;t see how this opens drive 0 by default.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two SD card interfaces over SPI.</title><link>https://devzone.nordicsemi.com/thread/259787?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 05:29:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a404a57e-d388-4d7d-b859-a71c0321863e</guid><dc:creator>Sreejit</dc:creator><description>&lt;p&gt;Alright. The spi instance is selected in the file app_sdcard.c. So I was thinking of duplicating this file and separating all the enums, structs and the functions.&amp;nbsp; Lemme know what you think.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two SD card interfaces over SPI.</title><link>https://devzone.nordicsemi.com/thread/259739?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2020 15:14:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9ae0239-1a22-46c8-8d70-f824164d4c84</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Due to summer holidays we are very short staffed these weeks. I have not had time to handle all my cases. I will get back to you as soon as possible. Hopefully tomorrow.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;A genera hint: Perhaps you need to use only one instance, but switch it between the two SD card readers?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>