<?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>Trying to initiate SPI calls SystemReset</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6771/trying-to-initiate-spi-calls-systemreset</link><description>Hello, 
 I am currently trying to write my frist few lines of code.. I started with the ble_uart example and then mixed in some code from the spi_master example.. I wanted to try to communicate with a Sensor over SPI and to make sure it works, use UART</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Apr 2015 13:51:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6771/trying-to-initiate-spi-calls-systemreset" /><item><title>RE: Trying to initiate SPI calls SystemReset</title><link>https://devzone.nordicsemi.com/thread/23789?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2015 13:51:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a06d92e-ec80-4183-86b2-e0817725e08e</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;It did not give any errors to me. This is strange when you say other people has faced this. Anyways I will close this case for now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to initiate SPI calls SystemReset</title><link>https://devzone.nordicsemi.com/thread/23791?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2015 07:45:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2291b75c-f079-45ee-b750-024293f099d7</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;RK is right, I do not see any dependencies between these either unless you are using protected peripheral. I will try your example out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to initiate SPI calls SystemReset</title><link>https://devzone.nordicsemi.com/thread/23790?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2015 05:44:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81fc62a2-af05-4d7e-a17c-2425b636b47a</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I don&amp;#39;t understand in what way the spi master and ble_init are related. And I read that other thread and it does state that the ble init must be called before setting up the spi master and I still don&amp;#39;t understand why.&lt;/p&gt;
&lt;p&gt;spi master doesn&amp;#39;t need BLE, BLE doesn&amp;#39;t use the SPI master, they are unrelated. Quickly looking at the ble init I don&amp;#39;t see what it would do to mess up a previously setup spi master nor what&amp;#39;s required from ble init to make spi master work.&lt;/p&gt;
&lt;p&gt;Anyone care to shed light on WHY these two unrelated things have a dependency on each other?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to initiate SPI calls SystemReset</title><link>https://devzone.nordicsemi.com/thread/23787?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2015 19:30:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be9d6a1b-0d28-4066-b65b-78de3d844724</guid><dc:creator>muhkuhns</dc:creator><description>&lt;p&gt;Thanks. I wrapped  &amp;quot;if (m_transfer_completed)&amp;quot; around it. My Slave only returns FF no matter what I try.. I also tried &lt;a href="https://devzone.nordicsemi.com/question/17797/spi-master-not-working-with-flash/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt; the stop condition solution from there :( The Sensor&amp;#39;s Slave Select Pin is Active Low... And so does the SPI here work, doesn&amp;#39;t it? Well maybe the sensor is corrupt..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to initiate SPI calls SystemReset</title><link>https://devzone.nordicsemi.com/thread/23786?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2015 19:18:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7afdd303-7a48-4d77-9282-7b1c344d4a7a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;maybe you are reading too early into the RXD registers?
for the &amp;#39;u&amp;#39; thing read &lt;a href="http://stackoverflow.com/questions/4380691/meaning-of-u-suffix"&gt;this&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to initiate SPI calls SystemReset</title><link>https://devzone.nordicsemi.com/thread/23785?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2015 19:07:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76a0382a-512b-46b7-8641-4d95edeaa2d6</guid><dc:creator>muhkuhns</dc:creator><description>&lt;p&gt;To test the SPI without the sensor I just connected MISO with MOSI, that should give me everything on RX what I sent on TX, correct? But when I reset the nRF51-DK it randomly gives me 0 instead of the 1E I sent. And what does the &amp;quot;u&amp;quot; behind &amp;quot;#define TX_RX_BUF_LENGTH         8u&amp;quot; means?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to initiate SPI calls SystemReset</title><link>https://devzone.nordicsemi.com/thread/23788?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2015 18:19:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e5cbc2c-24ed-4c80-9752-6c2b110165d9</guid><dc:creator>muhkuhns</dc:creator><description>&lt;p&gt;I set optimisation to the lowest possible level (0) and now the last line before the reset is:&lt;/p&gt;
&lt;p&gt;APP_ERROR_CHECK(sd_nvic_ClearPendingIRQ(p_spi_instance-&amp;gt;irq_type));&lt;/p&gt;
&lt;p&gt;I searched and searched and looked into my code and finally I found this question here: &lt;a href="https://devzone.nordicsemi.com/question/33873/spi-master-on-nrf5122/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Looks like it has to be initialised AFTER ble_init. At least the ble_uart example part is working again now ;-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to initiate SPI calls SystemReset</title><link>https://devzone.nordicsemi.com/thread/23784?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2015 17:13:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35e710c5-15ef-441a-b0c5-3200b85088fc</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;The default behavior if APP_ERROR_CHECK has failed is SystemReset. I do not think that Keil is pointing at the right place when this happens, i would suggest to remove your optimizations and then you can step by step debug to find out where it is failing.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;p_spi_instance-&amp;gt;p_nrf_spi-&amp;gt;EVENTS_READY = 0;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above instruction cannot generate a system reset, in the worst case maybe a bus-error and a hardfault maybe, but never a system reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>