<?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>SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97151/sdhc-spi-send-command</link><description>Hello. 
 I have a custom board featuring nRF5340. I placed a microSD card reader in my board connected to SPI. I followed the fatfs zephyr example, but I&amp;#39;m struggling in mounting the disk. 
 I can correctly see the block count, sector size and capacity</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Apr 2023 15:03:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97151/sdhc-spi-send-command" /><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/420836?ContentTypeID=1</link><pubDate>Mon, 17 Apr 2023 15:03:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf38ffaf-da21-4da7-9ce0-631d4e6b314e</guid><dc:creator>dario.sortino</dc:creator><description>&lt;p&gt;Turns out that there was a gpio forwarder for the uart(s) interfaces that were still active, and were causing troubles because pin-clashing.&lt;/p&gt;
&lt;p&gt;I solved by adding the following line to my cpuapp_overlay.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/delete-node/ &amp;amp;{/nrf-gpio-forwarder/uart};&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/420380?ContentTypeID=1</link><pubDate>Fri, 14 Apr 2023 06:24:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d51ce492-ed95-4827-9349-d244f4786df7</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;&lt;span&gt;If you set CONFIG_BOOTLOADER_MCUBOOT=y in the prj.conf of you application, the mcuboot will get added as a child image and you will have a multi image build (the partition manager will also get enabled and used to partition the flash).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/420160?ContentTypeID=1</link><pubDate>Thu, 13 Apr 2023 09:38:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b33aec8e-33ff-40ec-8255-57103bbb51ab</guid><dc:creator>dario.sortino</dc:creator><description>&lt;p&gt;I just tried to enable CONFIG_BT in the fat_fs sample and I see the same erroneous behaviour.&lt;/p&gt;
&lt;p&gt;About MCUBoot, can you provide to me a reference on how to build with MCUBoot enabled?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/419921?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2023 10:32:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd603fe7-a160-4192-904a-a9f6b8e875bc</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;By multicore, do you mean the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/multicore/hello_world/README.html"&gt;multicore sample&lt;/a&gt;&amp;nbsp;available here? If yes, do you see the same issue if you let CONFIG_BT enable the net core in the fat_fs sample?&lt;/p&gt;
&lt;p&gt;Try to build with MCUBoot enabled instead of both cores, and see if that still works (MCUBoot enables the partition manager).&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: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/419184?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2023 08:33:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f25c62dc-78e7-4e83-9efc-9fa5145e288c</guid><dc:creator>dario.sortino</dc:creator><description>&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;p&gt;I made some tests:&lt;br /&gt;- I run the fat_fs example in my custom board, using the above _cpuapp.overlay. It works fine&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/5700.IMG1.png" /&gt;&lt;/p&gt;
&lt;p&gt;- I use the fat_fs example in my custom board in the multicore example running in the APPCORE. I wrote an empty NETCORE fw. Attached you will find the project. Card is not recognized&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/1108.IMG2.png" /&gt;&lt;/p&gt;
&lt;p&gt;This seems absurd to me and it seems that I don&amp;#39;t have any margin of making it work in a multicore application&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/testmulticore.zip"&gt;devzone.nordicsemi.com/.../testmulticore.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/416718?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2023 08:58:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e73de157-caab-4a07-b2bf-30d102d9067a</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;That is a correct response &amp;quot;illegal command + idle state&amp;quot; from an SD card to a CMD5. SD cards don&amp;#39;t typically support CMD5.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve seen cards that need a power cycle when they receive unsupported commands.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/416712?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2023 08:06:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:415a6fee-8591-4e51-ae21-37508ae1e820</guid><dc:creator>dario.sortino</dc:creator><description>&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;p&gt;Hi simonr,&lt;/p&gt;
&lt;p&gt;for sure. Right now I&amp;#39;m building for nrf5340dk_nrf5340_cpuapp, with the same structure of the multicore sample, using the following overlay for appcore and netcore&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0116.nrf5340dk_5F00_nrf5340_5F00_cpunet.overlay"&gt;devzone.nordicsemi.com/.../0116.nrf5340dk_5F00_nrf5340_5F00_cpunet.overlay&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6283.nrf5340dk_5F00_nrf5340_5F00_cpuapp.overlay"&gt;devzone.nordicsemi.com/.../6283.nrf5340dk_5F00_nrf5340_5F00_cpuapp.overlay&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I opened the ticket, I was building only for the appcore using the following board devicetree&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/board.dts"&gt;devzone.nordicsemi.com/.../board.dts&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/416699?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2023 07:30:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:544a77d0-ed68-4a89-9bc0-f2abfd8a9fa9</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi can you share some details on what changes you made&amp;nbsp;when changing the sample to also build for the NET core? Can you upload this overlay file so we can take a look?&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: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/416275?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2023 13:08:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d40a3912-3501-41d2-b196-4c126ad6ce5c</guid><dc:creator>dario.sortino</dc:creator><description>&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;p&gt;I can imagine it&amp;#39;s not an easy and fast task, don&amp;#39;t worry.&lt;/p&gt;
&lt;p&gt;- I cannot report the SD size anymore&lt;/p&gt;
&lt;p&gt;- The SD size never shows in the devicetree.&lt;/p&gt;
&lt;p&gt;The card is powered at 3.336V (measured with a multimeter)&lt;/p&gt;
&lt;p&gt;One thing I want to mention is that when I was able to retrieve the SD size, I was using a custom dts for my board, that was building only for the APPCORE. Due to the need of building also for the NETCORE, I started using it to build for nrf5340dk and used an overlay file to define my hardware.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/416248?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2023 12:30:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:929fc475-fe81-4b2c-bdd0-16a7ddaba5df</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The only reasons for error -134 (ENOTSUP) should be that the SD card is not recognized (likely due to incorrect setup) or that the SD card you&amp;#39;re using is not supported which I don&amp;#39;t think is the case with the SD cards you&amp;#39;ve mentioned using. Unfortunately I will need some time to set up something like this to test on my end, so I can&amp;#39;t guarantee getting back to you with a tested solution any time soon. Some things you can check on your end:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Is the SD card reader powered sufficiently, maybe it is set to too low a voltage and thus browns out after reporting the SD size for example?&lt;/li&gt;
&lt;li&gt;Is the SD size reported by the actual SD card, or is the size perhaps reported by the&amp;nbsp;device tree?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Without knowing what bytes we should expect return data on it&amp;#39;s very hard to gather something from these scope traces, as it only seems to be empty data (FF) from the SD card reader except that 05 value.&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: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/415957?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 10:45:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e298adc5-804c-42d9-9f83-1be968b2d856</guid><dc:creator>dario.sortino</dc:creator><description>&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;p&gt;Same return error also trying with a SanDisk Ultra microSDXC 128Gb.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think it&amp;#39;s a problem of the SD I&amp;#39;m using, since as the original post says, I was able at least to retrieve the SD size&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/415914?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 08:58:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e243b3bd-8912-49e6-bca3-0fab48ee5569</guid><dc:creator>dario.sortino</dc:creator><description>&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;p&gt;Some investigation led me to understand where it arises the -134 error.&lt;/p&gt;
&lt;p&gt;It happens when the system checks the sd card type (either SDIO or SDMMC). The function sd_test_sdio returns -134.&lt;/p&gt;
&lt;p&gt;Inside of that, we try to send a sdhc command with opcode 5 and response type 85.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is the scope trace of that transaction is the following&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/4314.tek00000.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/415792?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 16:11:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:344aa64c-e91e-4de4-a4d3-bf682c67dfe6</guid><dc:creator>dario.sortino</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/5037.tek00000.png" /&gt;&lt;/p&gt;
&lt;p&gt;This is instead sdhc_request when the SD card is in the slot. I honestly have no idea of what&amp;#39;s happening.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/415768?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 14:56:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b834837b-6056-4e44-9934-88bcb3654410</guid><dc:creator>dario.sortino</dc:creator><description>&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;p&gt;Here you have a scope trace of the SPI pins (SD card not placed) when I call sdhc_request&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/tek00076.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I know that MISO is stale because there is no SD (I&amp;#39;ll try get a scope trace also with the SD in), but how does the rest look?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/415737?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 13:51:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b153762b-2131-4606-8941-2f4db031e407</guid><dc:creator>dario.sortino</dc:creator><description>&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;p&gt;I was debugging where the ENOTSUP -134 error is originating, and I can see that it comes from&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;ret&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;sdhc_request&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;card&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;sdhc&lt;/span&gt;&lt;span&gt;, &amp;amp;&lt;/span&gt;&lt;span&gt;cmd&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;NULL&lt;/span&gt;&lt;span&gt;);&amp;nbsp; (sd.c)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Apparently, the cmd structure will contain information about the response of the SD card. In my case, the field response of the structure sdhc_command cmd is 0, hence it returns -134.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;At this point I need to check if I see something from the logic analyzer when the sdhc_request is sent. I&amp;#39;ll post updates soon&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/415717?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 13:07:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72a96ab3-5453-4533-8b3a-8ec82a7fedbb</guid><dc:creator>dario.sortino</dc:creator><description>&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;p&gt;As you can see from the snippet above, i directly print the return value of disk_access_init.&lt;/p&gt;
&lt;p&gt;If I keep in the DTS the following part&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;		mmc {
			compatible = &amp;quot;zephyr,sdmmc-disk&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
		};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then it returns ENOTSUP (-134)&lt;/p&gt;
&lt;p&gt;I tried different combinations of possible configurations based on what I can find online, but it seems to be something very unclear.&lt;/p&gt;
&lt;p&gt;At the moment it seems that it&amp;#39;s not a problem of the SD itself, neither of the SPI bus, but an hardware configuration that somehow is not working.&lt;br /&gt;&lt;br /&gt;By receiving -22 (EINOTVAL), I think that I miss the link between the const char disk name, and the device registered in the dts/prj.conf&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/415687?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 12:05:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15e9586b-8887-4a09-9cc5-17dbee50f6f0</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Error message -22 means that there is an invalid argument in that function. The disk_access_init() only input parameter should be the Disk name as a &lt;strong&gt;const char&lt;/strong&gt;, so are you sure that is the function returning this error?&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: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/415420?ContentTypeID=1</link><pubDate>Wed, 15 Mar 2023 11:17:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d7fd50f-50f9-4f5b-8f6d-85e82236cc8c</guid><dc:creator>dario.sortino</dc:creator><description>&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;p&gt;I call the following function in my main&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void mount_disk(){

	do {
		static const char *disk_pdrv = &amp;quot;SD&amp;quot;;
		uint64_t memory_size_mb;
		uint32_t block_count;
		uint32_t block_size;

		if (disk_access_init(disk_pdrv) != 0) {
			printk(&amp;quot;Storage init ERROR %d!\n&amp;quot;,disk_access_init(disk_pdrv));
			break;
		}

		if (disk_access_ioctl(disk_pdrv,
				DISK_IOCTL_GET_SECTOR_COUNT, &amp;amp;block_count)) {
			printk(&amp;quot;Unable to get sector count&amp;quot;);
			break;
		}
		printk(&amp;quot;Block count %u&amp;quot;, block_count);

		if (disk_access_ioctl(disk_pdrv,
				DISK_IOCTL_GET_SECTOR_SIZE, &amp;amp;block_size)) {
			printk(&amp;quot;Unable to get sector size&amp;quot;);
			break;
		}
		printk(&amp;quot;Sector size %u\n&amp;quot;, block_size);

		memory_size_mb = (uint64_t)block_count * block_size;
		printk(&amp;quot;Memory Size(MB) %u\n&amp;quot;, (uint32_t)(memory_size_mb &amp;gt;&amp;gt; 20));
	} while (0);

	mp.mnt_point = disk_mount_pt;

	int res = fs_mount(&amp;amp;mp);

	if (res == FR_OK) {
		printk(&amp;quot;Disk mounted.\n&amp;quot;);
		lsdir(disk_mount_pt);
	}
	else {
		printk(&amp;quot;Error mounting disk.\n&amp;quot;);
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The first if(disk_access_init..) returns -22.&lt;/p&gt;
&lt;p&gt;If I jump in disk_access_init, I then enter in disk_access_get_di, and I can see that it returns 0&lt;/p&gt;
&lt;p&gt;This fails to let me enter in the following if, thus returning -22.&lt;/p&gt;
&lt;p&gt;I am quite sure that it is a configuration problem of the SPI device, just because in my first tests I could at least print the Memory Size. Now I encounter this problem for every spi-max-freq that I set (1Mhz, 4Mhz, 8Mhz, 16Mhz)&lt;/p&gt;
&lt;p&gt;I&amp;#39;m planning to attach some logic analyzer probes asap, but I&amp;#39;m expecting to see no data being exchanged because of above.&lt;/p&gt;
&lt;p&gt;I tried to get rid of the mmc definition in the dts, but that didn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;About the proj.conf, here there are the related config&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_DISK_DRIVER_SDMMC=y
CONFIG_DISK_ACCESS=y
CONFIG_FILE_SYSTEM=y
CONFIG_FAT_FILESYSTEM_ELM=y
CONFIG_SPI=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Is there anything that I&amp;#39;m missing? Is there anything that can create conflict?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/415241?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2023 14:04:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83ad0964-1b58-4e77-890a-252e064ec96e</guid><dc:creator>Simonr</dc:creator><description>[quote user="dario.sortino"]I now encounter the storage init error[/quote]
&lt;p&gt;What error exactly is this? What function returns the error, and what error code do you see? Did you &lt;span&gt;try to set the frequency even lower (1MHz for example) to see if you still see the storage init ERROR with that frequency setting as well.&amp;nbsp;&lt;/span&gt;If possible,&amp;nbsp;can you&amp;nbsp;get a scope trace of the SPI pins to see that the expected data is output on them, and what exactly happens before and as the device resets.&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: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/414595?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 11:19:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:777184b2-0d90-47af-b98e-88bed6b6c761</guid><dc:creator>dario.sortino</dc:creator><description>&lt;p&gt;I updated the overlay as it follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
&amp;amp;spi1 {
	compatible = &amp;quot;nordic,nrf-spim&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	cs-gpios = &amp;lt; &amp;amp;gpio0 7 GPIO_ACTIVE_LOW &amp;gt;;
	pinctrl-0 = &amp;lt;&amp;amp;spi1_default&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;;
	sdhc0: sdhc@0 {
		compatible = &amp;quot;zephyr,sdhc-spi-slot&amp;quot;;
		reg = &amp;lt;0&amp;gt;;
		status = &amp;quot;okay&amp;quot;;
		label = &amp;quot;SDHC0&amp;quot;;
		mmc {
			compatible = &amp;quot;zephyr,sdmmc-disk&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
		};
		spi-max-frequency = &amp;lt;16000000&amp;gt;;		
	};	
};

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Using pinctrl as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;spi1_default: spi1_default{
	group1 {
		psels = &amp;lt;NRF_PSEL(SPIM_SCK, 0, 8)&amp;gt;,
			&amp;lt;NRF_PSEL(SPIM_MISO, 0, 10)&amp;gt;,
			&amp;lt;NRF_PSEL(SPIM_MOSI, 0, 9)&amp;gt;;
	};

};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With this setting (16MHz), I now encounter the storage init error, so there is something odd.&lt;/p&gt;
&lt;p&gt;I do not have a uSD slot that I can plug into the devkit, so It would be&amp;nbsp;prone to errors to unsolder my socket and hand soldering all the connections to the dk pins.&lt;/p&gt;
&lt;p&gt;Should I init in some way the SPI in my code? Even tough in the example there is not any kind of initialization&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/412949?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2023 10:17:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ed2d4dd-1122-4304-9852-be9e98198169</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Hmm, that&amp;#39;s very strange, a few more things you can try:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have you tested this on a Development kit yet. That way we can narrow this down to whether it&amp;#39;s a HW or SW issue at least.&lt;/li&gt;
&lt;li&gt;You can also try to set the frequency even lower (1MHz for example) to see if you still see the storage init ERROR with that frequency setting as well.&lt;/li&gt;
&lt;li&gt;Another thing I noticed is that you&amp;#39;re using a deprecated way of setting your pins on. Please try using the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/pin_control/index.html#pin-control"&gt;pin control&lt;/a&gt;&amp;nbsp;to set the SPI pins. You can see how it can be done in this &lt;a href="https://github.com/too1/ncs-spi-master-slave-example/blob/master/nrf5340dk_nrf5340_cpuapp.overlay"&gt;SPI example&lt;/a&gt; by my colleague Torbjørn.&lt;/li&gt;
&lt;li&gt;If possible, it could also be helpful to get a scope trace of the SPI pins to see that the expected data is output on them, and what exactly happens before and as the device resets.&lt;/li&gt;
&lt;/ul&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: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/412713?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2023 10:59:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b56cb321-f97d-4bd2-b6cb-fa7406d9a73a</guid><dc:creator>dario.sortino</dc:creator><description>&lt;p&gt;Hi Simonr.&lt;/p&gt;
&lt;p&gt;I tried to lower the SPI freq to 8M, and this time I cannot even see the size of the SD. If you take into consideration the fat_fs example, with 8M I enter this control&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;disk_access_init&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;disk_pdrv&lt;/span&gt;&lt;span&gt;) != &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;printk&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;Storage init ERROR!&lt;/span&gt;&lt;span&gt;\n&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;break&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;While with 16M I successfully skip that and while debugging it ends up to the first&amp;nbsp;sdhc_spi_send_cmd that it encounters deep down to the function fs_mount inside functions, showing no errors but rebooting the&amp;nbsp;MCU.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;My SDK is NCS 2.2.0.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDHC SPI Send Command</title><link>https://devzone.nordicsemi.com/thread/412700?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2023 10:22:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8e3b0a5-53bf-4da2-88f0-b48a991d19e4</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I see that you&amp;#39;ve set the SPI max frequency to 16MHz, but the SPI1 instance in the nRF5340 does not support higher data rates than 8Mbps, so can you try lowering the &lt;strong&gt;spi-max-frequency&lt;/strong&gt; down to 8000000?&lt;/p&gt;
&lt;p&gt;What SDK version are you using for development? When debugging, do you see any kinds of error codes as when the application moves into fs_mount(), or where does the debugging session end up?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>