<?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>I have a problem!!!</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25328/i-have-a-problem</link><description>Hello. 
 This is my code to &amp;quot;wait until micro sd card is pluged&amp;quot;. 
 while(1)
{
	disk_state =disk_initialize(0); 
	if(disk_state==RES_OK) 
	{
 NRF_LOG_INFO(&amp;quot;Initialize Successful \r\n&amp;quot;);
 break;
	}
	else
	{
 disk_uninitialize(0);
 disk_state</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Sep 2017 15:48:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25328/i-have-a-problem" /><item><title>RE: I have a problem!!!</title><link>https://devzone.nordicsemi.com/thread/99813?ContentTypeID=1</link><pubDate>Fri, 22 Sep 2017 15:48:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05dddc51-9f49-4c2c-9b50-380925364697</guid><dc:creator>MainOFF</dc:creator><description>&lt;p&gt;Nordic support team is so enthusiastic. I hope this solution will be added in an other SDK version . Thanks you again!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have a problem!!!</title><link>https://devzone.nordicsemi.com/thread/99812?ContentTypeID=1</link><pubDate>Fri, 22 Sep 2017 15:38:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83c5fd55-d9c1-4c40-920c-ee14de0c97d3</guid><dc:creator>MainOFF</dc:creator><description>&lt;p&gt;thanks you for your support! I was implemented your code and my project was run correctly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have a problem!!!</title><link>https://devzone.nordicsemi.com/thread/99811?ContentTypeID=1</link><pubDate>Fri, 22 Sep 2017 02:00:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3f0b5ff-e27e-49a1-b4e1-9253292756b4</guid><dc:creator>MainOFF</dc:creator><description>&lt;p&gt;Thanks you for your suggestion. I am going to test it when I go home and report my result for you. if you have any other solution please tell me!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have a problem!!!</title><link>https://devzone.nordicsemi.com/thread/99810?ContentTypeID=1</link><pubDate>Thu, 21 Sep 2017 19:09:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52b43c2f-e889-4e66-81a3-c969426f847a</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The issue seems to be related to the SD card initialization and the communication between &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.0.0/group__nrf__block__dev__sdc.html?cp=4_0_0_6_10_2_4"&gt;nrf_block_dev_sdc&lt;/a&gt; and &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.0.0/group__app__sdcard.html?cp=4_0_0_6_10_37"&gt;app_sdcard&lt;/a&gt;. When you call &lt;code&gt;disk_initialize()&lt;/code&gt;, &lt;code&gt;block_dev_sdc_init()&lt;/code&gt; will be called, which again calls &lt;code&gt;app_sdc_init()&lt;/code&gt;. This call will succeed the first time, as the SPI interface is only initialized and a transfer is started, before a success error code is returned. app_sdcard will try to initialize the card, and when this fails, it will uninit itself. Unfortunately, no event is passed to nrf_block_dev_sdc to signalize this, so this module is still initialized. This will result in &lt;code&gt;m_active_sdc_dev&lt;/code&gt; being set, even though no SD card is enabled, giving wrong error code returns when you have connected the SD card.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[EDIT:]&lt;/strong&gt; After talking to the developer, we came up with a better solution to this issue. There is in fact an event passed from app_sdcard to nrf_block_dev_sdc when the init of the SD card fails. This event contains an error code/result field, but block_dev_sdc is not uninitialized if field containt an error. The error is however passed to block_dev, where an error reported back to your &lt;code&gt;disk_initialize&lt;/code&gt;call. The result of this is block_dev_sdc will be left inited even if an error occurred, causing the issue you are seeing.&lt;/p&gt;
&lt;p&gt;To solve this issue, you need to do the following changes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Between line 83 and 84 of the file &lt;em&gt;nrf_block_dev_sdc.c&lt;/em&gt;, add the following code:&lt;/p&gt;
&lt;p&gt;if(p_event-&amp;gt;result != SDC_SUCCESS)
{
nrf_block_dev_t const * block_dev = &amp;amp;(p_sdc_dev-&amp;gt;block_dev);
ret_code_t err_code = block_dev_sdc_uninit(block_dev);
APP_ERROR_CHECK(err_code);
}&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In file &lt;em&gt;app_sdcard.c&lt;/em&gt;, remove the call to &lt;code&gt;APP_ERROR_CHECK(app_sdc_uninit());&lt;/code&gt; on line 951.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I will report this bug internally to have it fixed in future SDK releases.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have a problem!!!</title><link>https://devzone.nordicsemi.com/thread/99809?ContentTypeID=1</link><pubDate>Thu, 21 Sep 2017 14:51:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c22f423-93ac-4bfe-81ae-2c66ecf64657</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Which SDK version are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have a problem!!!</title><link>https://devzone.nordicsemi.com/thread/99808?ContentTypeID=1</link><pubDate>Wed, 20 Sep 2017 12:32:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e7aca87-f54c-44e9-af5d-6bdf0081e90d</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;What seems to not work? Could you give a more detailed explanation on what happens when you use this code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>