<?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>Problem with SPI slave, getting 0xAA on first transaction</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3933/problem-with-spi-slave-getting-0xaa-on-first-transaction</link><description>I&amp;#39;m using NRF51822 as SPI slave and STM32 as SPI master. Everything works fine except the first SPI transaction after resetting both boards. 
 On the first transaction I&amp;#39;m receiving 0xAA on STM while SPI slave on NRF falls into waiting for transmitting</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Sep 2014 14:44:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3933/problem-with-spi-slave-getting-0xaa-on-first-transaction" /><item><title>RE: Problem with SPI slave, getting 0xAA on first transaction</title><link>https://devzone.nordicsemi.com/thread/14154?ContentTypeID=1</link><pubDate>Mon, 29 Sep 2014 14:44:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eaaa8236-a0f4-4a39-8698-c1c9f3d91113</guid><dc:creator>tetiana</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;Have you tried the communicaton with other SPI master than STM32?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;No, I haven&amp;#39;t and I&amp;#39;m afraid this is hardly possible in the nearby future...&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Please include information on what version of the chip you are using (the chip markings) and the nRF51 SDK version&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;SDK version 6.0.0.43681
Chip QFAAGO&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with SPI slave, getting 0xAA on first transaction</title><link>https://devzone.nordicsemi.com/thread/14153?ContentTypeID=1</link><pubDate>Mon, 29 Sep 2014 14:29:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55e78474-0c0d-45a9-810e-6e61878c9e14</guid><dc:creator>tetiana</dc:creator><description>&lt;p&gt;Hi, Stefan!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Can you create the fake transaction by letting the STM32 toggle the CSN line before sending the actual data?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yes, that&amp;#39;s how I&amp;#39;ve fixed it for now, though it really doesn&amp;#39;t seem like a real fix, and I still wonder about the root cause&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Are you using the SPI slave example from the SDK unmodified?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;There are some modifications, the SPI slave example is integrated into something bigger, but the main logic is the same.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Are you using softdevice by any chance?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yes, I&amp;#39;m using SoftDevice 110. To make SPIS working with SD I&amp;#39;ve changed SPIS&amp;#39;s priority from low to high (APP_IRQ_PRIORITY_HIGH). Otherwise interrupts never came at all. SPIS initialization with NVIC_ is made prior to SD init (though I tried initing SPI the other way, after sd init and via sd calls, too).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with SPI slave, getting 0xAA on first transaction</title><link>https://devzone.nordicsemi.com/thread/14152?ContentTypeID=1</link><pubDate>Mon, 29 Sep 2014 13:28:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7892dbc1-da37-4a4a-a307-9aff40045429</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Tetiana&lt;br /&gt;
Can you create the fake transaction by letting the STM32 toggle the CSN line before sending the actual data? The 0xAA character is the DEF_CHARACTER and is usually clocked out when the semaphore is not available to the SPIS peripheral and is occupied by the CPU. I immediately do not see any difference between the failing signals and the successful signals. Are you using the SPI slave example from the SDK unmodified? Are you using softdevice by any chance? Have you tried the communicaton with other SPI master than STM32?  Please include information on what version of the chip you are using (the chip markings) and the nRF51 SDK version&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with SPI slave, getting 0xAA on first transaction</title><link>https://devzone.nordicsemi.com/thread/14151?ContentTypeID=1</link><pubDate>Sat, 27 Sep 2014 13:05:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9254398e-e732-41e7-9443-6f7a272245e6</guid><dc:creator>tetiana</dc:creator><description>&lt;p&gt;The key details on the lower level are: for the first transaction second interrupt in the SPI state SPI_BUFFER_RESOURCE_CONFIGURED  and EVENTS_END being set never comes up. I can see the first interrupt with SPI state SPI_BUFFER_RESOURCE_REQUESTED which arrives when I set the buffers but the second interrupt appears only with the second try from SPI master.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with SPI slave, getting 0xAA on first transaction</title><link>https://devzone.nordicsemi.com/thread/14150?ContentTypeID=1</link><pubDate>Fri, 26 Sep 2014 14:17:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c039bb2-8f7f-4682-ad7d-05c84879d6da</guid><dc:creator>tetiana</dc:creator><description>&lt;p&gt;Asbjørn, thanks for your comment. Pins look to be in the same states. Here are screen-shots from the failing transaction, from the most general view to closer:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://postimg.org/image/ajdjf2wpl/"&gt;link text&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://postimg.org/image/ribeg0epv/"&gt;link text&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://postimg.org/image/dbiyys28d/"&gt;link text&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and the next successful one:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://postimg.org/image/z39a321j9/"&gt;link text&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Time between resets doesn&amp;#39;t matter. And restart is not so important here - I can make second transaction run successfully without restarts just by adding some fake transaction before needed one.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with SPI slave, getting 0xAA on first transaction</title><link>https://devzone.nordicsemi.com/thread/14149?ContentTypeID=1</link><pubDate>Fri, 26 Sep 2014 13:11:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d051c24c-fe4f-470b-9fbe-ffac8bbf110d</guid><dc:creator>Asbj&amp;#248;rn</dc:creator><description>&lt;p&gt;I would check the state of the GPIOs used for the SPI interface after the reset. It sounds like they might have different startup time and hence could respond unpredictably initially until you&amp;#39;ve gained control over both of them. Especially since this only occurs if you reset both of them at the same time. How long after the reset before you start sending/using the SPI interface? Do you still see the same behavior if you wait longer and are sure that both sides are initialized and are ready?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>