<?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>Driving WS2182 with SPIM hangs on second call when led_strip_update_rgb() is inside k_timer callback.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100947/driving-ws2182-with-spim-hangs-on-second-call-when-led_strip_update_rgb-is-inside-k_timer-callback</link><description>Background info: nrf52dk-52832 HW-v3 
 Nrf Connect SDK v2.3.0 
 .dts = 
 
 &amp;amp; spi2 { 
 compatible = &amp;quot;nordic,nrf-spim&amp;quot; ; 
 led_strip: ws2812 @ 0 { 
 compatible = &amp;quot;worldsemi,ws2812-spi&amp;quot; ; 
 
 /* SPI */ 
 reg = &amp;lt; 0 &amp;gt;; /* ignored, but necessary for SPI bindings</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Jun 2023 14:09:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100947/driving-ws2182-with-spim-hangs-on-second-call-when-led_strip_update_rgb-is-inside-k_timer-callback" /><item><title>RE: Driving WS2182 with SPIM hangs on second call when led_strip_update_rgb() is inside k_timer callback.</title><link>https://devzone.nordicsemi.com/thread/432060?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2023 14:09:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d919834-394d-4231-931f-547b8af9243f</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Good to know that it is working and the problem is resolved.&lt;/p&gt;
&lt;p&gt;Best wishes,&lt;/p&gt;
&lt;p&gt;Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Driving WS2182 with SPIM hangs on second call when led_strip_update_rgb() is inside k_timer callback.</title><link>https://devzone.nordicsemi.com/thread/431840?ContentTypeID=1</link><pubDate>Mon, 19 Jun 2023 17:26:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a73c15df-62b0-4097-a5c9-0adbf536ccd8</guid><dc:creator>Caver110</dc:creator><description>&lt;p&gt;Switching to using k_work_submit() inside my timer callback worked perfectly. LED module is continuously updating correctly on timer expiration. Thank you&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Driving WS2182 with SPIM hangs on second call when led_strip_update_rgb() is inside k_timer callback.</title><link>https://devzone.nordicsemi.com/thread/431789?ContentTypeID=1</link><pubDate>Mon, 19 Jun 2023 13:14:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33ebce46-e2ac-42e4-aead-6e7e5ffab0ee</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hi Spencer,&lt;/p&gt;
&lt;p&gt;Thank you for contacting DevZone at NordicSemi.&lt;/p&gt;
&lt;p&gt;I am not 100% sure what is happening in your case. However, this could be related to thread &amp;amp; ISR priorities or conditional execution (or deadlocks) in your led_update_output() function.&lt;/p&gt;
&lt;p&gt;An ISR or callback should be designed to carry out simple and quick tasks and the time consuming (or detailed) processing should be offloaded so that kernel&amp;#39;s interrupt handling is robust.&lt;/p&gt;
&lt;p&gt;This &lt;a href="https://docs.zephyrproject.org/latest/kernel/services/timing/timers.html#:~:text=%2C%20NULL)%3B-,Using%20a%20Timer%20Expiry%20Function,-%C2%B6"&gt;sample code&lt;/a&gt; of using timer to submit work in the workqueue should work if you modify your code accordingly.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;BR,&lt;br /&gt;Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>