<?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 nRF52832 BLE + SPI + FreeRTOS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23590/problem-with-nrf52832-ble-spi-freertos</link><description>Hi everybody. 
 I encountered issues with the formentioned setup. In my project I&amp;#39;m using latest SDK 13.1, softdevice S132 v.4.0.2. I&amp;#39;m compiling the project with latest GCC. 
 I have two tasks: 
 
 LCD driver communicating over SPI 
 BLE task configured</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Jul 2017 09:07:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23590/problem-with-nrf52832-ble-spi-freertos" /><item><title>RE: problem with nRF52832 BLE + SPI + FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/92696?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 09:07:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff6a0679-a022-4a62-aa78-7505bfc1d895</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Ok, let us know when you have investigated this further.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with nRF52832 BLE + SPI + FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/92697?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 08:59:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54dac88d-91d2-4f2b-bb8b-5757c1b2bb8d</guid><dc:creator>segFault</dc:creator><description>&lt;p&gt;Initially I thought it helped. But now I see that the issue just got more intermittent. I need some time to check everything. And I think it only happnes in scan mode. After establishing a connection I haven&amp;#39;t seen any issues so far.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with nRF52832 BLE + SPI + FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/92695?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 08:55:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:500e2cde-fb93-427d-98e2-c1ae6f090850</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;@segFault: Did you resolve the issue by providing an event handler when calling  &lt;code&gt;nrf_drv_spi_init()&lt;/code&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with nRF52832 BLE + SPI + FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/92688?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 06:53:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33343664-6eaf-4d65-9410-ab785406cb7a</guid><dc:creator>gkovelman_tap</dc:creator><description>&lt;p&gt;Maybe it&amp;#39;s a task priority issue. Anyway, if you can, try to use the GPIOTE &amp;amp; interrupts for detecting GPIO events. Same with SPI, use semapores/signals to send messages between the interrupts and the tasks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with nRF52832 BLE + SPI + FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/92687?ContentTypeID=1</link><pubDate>Wed, 19 Jul 2017 22:07:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33776188-1bb5-40d4-a244-508fc3a38197</guid><dc:creator>segFault</dc:creator><description>&lt;p&gt;It sort of worked. I had some other code that was also causing issues in the display task (polling for button connected to a GPIO) and after adding a handler and removing the button code it seems to work reliably now.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure if it wasn&amp;#39;t also caused by a very short vTaskDelay(2) which I used for fast checking the GPIO.&lt;/p&gt;
&lt;p&gt;So, yes. If anybody wants to use SPI + BLE, passing a handler to the init function is the way to go.&lt;/p&gt;
&lt;p&gt;Thanks gkovelman_tap for help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with nRF52832 BLE + SPI + FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/92693?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2017 14:19:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72ac7931-c3ac-4646-b88e-1719b201c46d</guid><dc:creator>segFault</dc:creator><description>&lt;p&gt;Thank you, I&amp;#39;ll give it a try later today.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with nRF52832 BLE + SPI + FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/92692?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2017 14:13:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1fa5754-030d-4a1f-9e18-c4b6ad07dcc1</guid><dc:creator>gkovelman_tap</dc:creator><description>&lt;p&gt;Yes, and use semaphores.
&lt;code&gt;xSemaphoreTake&lt;/code&gt; right after transmitting and&lt;/p&gt;
&lt;p&gt;&lt;code&gt;if (xSemaphoreGiveFromISR (semaphore_id, &amp;amp;taskWoken) != pdTRUE) { return osErrorOS; } portEND_SWITCHING_ISR (taskWoken);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;in the handler (since it&amp;#39;s in interrupt context)&lt;/p&gt;
&lt;p&gt;**example copied from CMSIS_OS&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with nRF52832 BLE + SPI + FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/92691?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2017 13:29:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d741fd8b-e856-43d1-8f7d-77003b4e89e6</guid><dc:creator>segFault</dc:creator><description>&lt;p&gt;No, but I gave it a quick try earlier. Maybe I didn&amp;#39;t code it right. I&amp;#39;ll have some time in the evening to rewrite and test it.&lt;/p&gt;
&lt;p&gt;Do I need to call a portYIELD_FROM_ISR from such handler in case of using it with FreeRTOS?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with nRF52832 BLE + SPI + FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/92694?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2017 13:17:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e93fe6a-ddc7-41c7-9d98-ad0cf7a9d77d</guid><dc:creator>gkovelman_tap</dc:creator><description>&lt;p&gt;the SPI driver shouldn&amp;#39;t busy wait. do you have a callback handler that was supplied to the nrf_drv_spi_init?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with nRF52832 BLE + SPI + FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/92690?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2017 12:57:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3eaae6f3-34b8-4be8-8fa4-06a374a2b2ce</guid><dc:creator>segFault</dc:creator><description>&lt;p&gt;Sorry, I forgot to mention that. Yes, I&amp;#39;m using SPI0 channel with EasyDMA.&lt;/p&gt;
&lt;p&gt;I did a couple of checks and I think that it may have nothing to do with FreeRTOS. I moved it out of the way and the problem still exists. That&amp;#39;s &amp;quot;good&amp;quot;, since there are more examples of BLE + peripheral than OS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with nRF52832 BLE + SPI + FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/92689?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2017 12:52:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e3d712a-3bba-4788-96c6-69c1668e7b0b</guid><dc:creator>gkovelman_tap</dc:creator><description>&lt;p&gt;Are you using the SPI driver with EasyDMA?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>