<?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 Card, FATFS, nRF52832 -&amp;gt; Can&amp;#39;t initialize if first initialization fails.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43233/sd-card-fatfs-nrf52832---can-t-initialize-if-first-initialization-fails</link><description>Hello, 
 I&amp;#39;m currently working on a project that requires data to be stored to an microSD. I&amp;#39;m using a custom board with the nRF52832 chipset and a Molex micro SD card holder. I can successfully initialize the SD card via FATFS once the firmware boots</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 01 Feb 2019 17:55:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43233/sd-card-fatfs-nrf52832---can-t-initialize-if-first-initialization-fails" /><item><title>RE: SD Card, FATFS, nRF52832 -&gt; Can't initialize if first initialization fails.</title><link>https://devzone.nordicsemi.com/thread/169118?ContentTypeID=1</link><pubDate>Fri, 01 Feb 2019 17:55:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b747192-1ccd-457c-8c84-24b049fcc8dd</guid><dc:creator>DGraham</dc:creator><description>&lt;p&gt;This solved the problem.&amp;nbsp; I should&amp;#39;ve mentioned I&amp;#39;m currently using SDK 14.2.0, but I found the corresponding lines to fix (nrf_drv_spi.c -&amp;gt; nrf_drv_spi_uninit and diskio_blkdev.c-&amp;gt; disk_initialize).&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;Edit: It stopped working a few days later and it took me a little while to figure out why. The SD card isn&amp;#39;t the only peripheral on the bus, and at some point the pull configuration changed.&amp;nbsp; In the sdk_config.h you need to set the NRF_SPI_DRV_MISO_PULLUP_CFG flag to 3 (pullup). If you use NOPULL or PULLDOWN it won&amp;#39;t work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD Card, FATFS, nRF52832 -&gt; Can't initialize if first initialization fails.</title><link>https://devzone.nordicsemi.com/thread/169088?ContentTypeID=1</link><pubDate>Fri, 01 Feb 2019 14:02:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cc3b6bc-3dc1-4ffa-ad74-c63a1d4a81b9</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have reproduced this on my side as well using DK 15.2. It seems the internal state of&amp;nbsp;nrf_block_dev_sdc.c (m_active_sdc_dev) becomes invalid, as it is not uninitialized. Therefore, it will always return&amp;nbsp;NRF_ERROR_BUSY after the first unsuccessful attempt. The following two minor diffs shows what seems like a quick fix:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-6e44b551d0494f5b8b5cec3b440efc66/diskio_5F00_blkdev.c.diff"&gt;devzone.nordicsemi.com/.../diskio_5F00_blkdev.c.diff&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-6e44b551d0494f5b8b5cec3b440efc66/nrfx_5F00_spim.c.diff"&gt;devzone.nordicsemi.com/.../nrfx_5F00_spim.c.diff&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I will report this internally as a bug.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>