<?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>SPI dependent on softdevice?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10221/spi-dependent-on-softdevice</link><description>Hi, I am trying to combine SPI, microESB and BLE. BLE and microESB will not be combined in realtime, but rather be two distinct modes, and not run at the same time, and therefore entirely separated. 
 My question is: What should I watch out for? I have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 17 Nov 2015 10:27:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10221/spi-dependent-on-softdevice" /><item><title>RE: SPI dependent on softdevice?</title><link>https://devzone.nordicsemi.com/thread/37936?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2015 10:27:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88494fae-2ea7-4786-bdb7-cca2f2d0f3de</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Explicitly enabling them means that you need to explicitly power them down. So Yes&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI dependent on softdevice?</title><link>https://devzone.nordicsemi.com/thread/37935?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2015 10:17:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:045355b3-f0bf-4c93-b617-117669ff11bb</guid><dc:creator>Emil</dc:creator><description>&lt;p&gt;Now both SPI and ESB work, when I initialized both HF and LF clock. My question then is should I power them down when powering off?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_CLOCK-&amp;gt;LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal &amp;lt;&amp;lt; CLOCK_LFCLKSRC_SRC_Pos);

NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;
while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0);

NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED = 0;
NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1;
while (NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI dependent on softdevice?</title><link>https://devzone.nordicsemi.com/thread/37933?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 10:54:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7048971-d7f2-40ce-adb7-6c9004737f41</guid><dc:creator>Emil</dc:creator><description>&lt;p&gt;I did not initialize sd, that is the whole point. Because I don&amp;#39;t want softdevice involved when working with microESB, because then I would need timeslot API.&lt;/p&gt;
&lt;p&gt;I upgraded to SDK 10, and now SPI works without softdevice, but microESB does not.&lt;/p&gt;
&lt;p&gt;sd_ functions cannot be called if the softdevice is not initialize, and you can&amp;#39;t use NRF_ stuff directly when the softdevice is enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI dependent on softdevice?</title><link>https://devzone.nordicsemi.com/thread/37934?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 07:40:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81778f3b-7e47-496c-900b-ac6540fb252e</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;SPI and softdevice are not doing anything with each other.
SPI slave will not work along with softdevice, because softdevice will interrupt SPI slave handling which Master will not know and hence there will be loss of data.&lt;/p&gt;
&lt;p&gt;SPI Master with softdevice should work OK, because it is master that is driving the clock, so it should be ok even if softdevice interrupts its handling.&lt;/p&gt;
&lt;p&gt;You code cannot configure LFCLK while using softdevice, because that clock is will be owned by SD.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Seems like
APP_ERROR_CHECK(sd_nvic_ClearPendingIRQ(p_spi_instance-&amp;gt;irq_type));
is the one in spi_master.c&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;What is the error code? did you initialize SD before that? did it return without errors?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>