<?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>NRF52832 FatFS and other SPI slave devices</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25734/nrf52832-fatfs-and-other-spi-slave-devices</link><description>Hi, 
 I have built a prototype that has two SPI slave devices connected to it and it works perfectly. I have now tried to add an SPI SD card aswell by following the FatFS example in SDK 12.3 but this seems to be in conflict with my existing initialisation</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Aug 2020 09:42:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25734/nrf52832-fatfs-and-other-spi-slave-devices" /><item><title>RE: NRF52832 FatFS and other SPI slave devices</title><link>https://devzone.nordicsemi.com/thread/265923?ContentTypeID=1</link><pubDate>Mon, 24 Aug 2020 09:42:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0708804-2b71-4b21-836f-94cb8b7fd07c</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes, a separate SPI bus, with its own MOSI/MISO/CLK pins. The nRF52832 supports up to 3 SPIM &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/memory.html#topic"&gt;instances&lt;/a&gt;&amp;nbsp;(SPIM0-SPIM2). The SD-Card libraries are initializing the SPI instance internally and do not provide any API to pass an existing SPI instance to the library. This could be achieved by rewriting the libraries, but it is not supported out of the box.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 FatFS and other SPI slave devices</title><link>https://devzone.nordicsemi.com/thread/263491?ContentTypeID=1</link><pubDate>Thu, 06 Aug 2020 16:41:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cea88699-fad2-4a43-91dc-b254a1c4c211</guid><dc:creator>jgvillap</dc:creator><description>&lt;p&gt;What do you mean by separate SPI interface? Like a different SPI Bus with different MOSI/MISO/SCLK? Is there no easy way to share the same bus with SD card?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 FatFS and other SPI slave devices</title><link>https://devzone.nordicsemi.com/thread/101385?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2017 14:57:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29c7125d-3f46-462e-9523-5b3b0e59c06c</guid><dc:creator>YYZ</dc:creator><description>&lt;p&gt;Ah OK! Thanks Jorgen - I will see if I can move the SD card to a separate instance...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 FatFS and other SPI slave devices</title><link>https://devzone.nordicsemi.com/thread/101384?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2017 12:44:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0543a105-290a-4739-aede-a44420de47e4</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t see any way you can solve this without modifying the SDK code. You could modify app_sdcard function &lt;code&gt;app_sdc_init&lt;/code&gt; to take a SPI instance as parameter, and only initialize the SPI driver if this parameter is set to NULL, and else use the instance passed in the parameter. This would require you to relay the SPI instance through all blockdev function calls if you are using the FatFS example. You would also have to expose the spi_handler in app_sdcard through the header files, and relay SPI events related to SDCard, from default SPI handler to the app_sdcard spi_handler. app_sdcard also control CS pin manually, so his should not be conflicting with your other devices. The frequency of the SPI interface can be changed using the SPI HAL function &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.3.0/group__nrf__spi__hal.html#gad45cd4c222855136995ef1fbe01cc562"&gt;&lt;code&gt;nrf_spi_frequency_set()&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Do you not have more available serial instances for addind a separate SPI interface for the SD card? That would propably be the simplest solution.&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></channel></rss>