<?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>SPIM Read fails when using Zephyr WorkQueue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/125927/spim-read-fails-when-using-zephyr-workqueue</link><description>Hi, 
 
 Im using an SPI device and also the SPIM NRF driver. This device is not always on, but the overall flow is: 
 
 Power On the device on boot and do basic info readings to check if the device is ok 
 Turn off the device 
 Start the delayable Zephyr</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Dec 2025 15:35:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/125927/spim-read-fails-when-using-zephyr-workqueue" /><item><title>RE: SPIM Read fails when using Zephyr WorkQueue</title><link>https://devzone.nordicsemi.com/thread/556155?ContentTypeID=1</link><pubDate>Wed, 03 Dec 2025 15:35:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e6eaf08-5349-4776-825a-5e0966e10de0</guid><dc:creator>Miguel Ferreira</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Sorry I figure out the issue, in recent updates to the project the ADC channel on the DTS change to AIN2 and AIN2 is the MISO of the SPI device. Thanks for the help again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM Read fails when using Zephyr WorkQueue</title><link>https://devzone.nordicsemi.com/thread/556113?ContentTypeID=1</link><pubDate>Wed, 03 Dec 2025 13:09:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d63e61b-546e-4ed5-9191-c38614d7178a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Miguel,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you tell what priority you run your workqueue on ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;At&lt;em&gt; Step 1 Power On the device on boot and do basic info readings to check if the device is ok&lt;/em&gt;, do you read from the SPIS device ? Do you have the correct reading ?If after 1 minute of sleeping, you do the same thing , do you see the same result or just 0x00 ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;My understanding is that on the MISO line you still see correct data output from the SPIS but the reading from the SPIM result 0 ?&amp;nbsp;&lt;br /&gt;Could you add some breakpoint/log in SPIM library and check why it&amp;#39;s returned 0 ? Please check if any issue with the RX buffer.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM Read fails when using Zephyr WorkQueue</title><link>https://devzone.nordicsemi.com/thread/556041?ContentTypeID=1</link><pubDate>Tue, 02 Dec 2025 16:50:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75055597-56fe-4e70-8fbc-e6cf1a1c3d20</guid><dc:creator>Miguel Ferreira</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/hungbui"&gt;Hung Bui&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;By turn off I mean disabling the VDD signal. Another note on this, Im using NRF connect 2.4.3 and at this point sadly I can t upgrade it... Im also not using system workqueue, Im using my own workqueue (k_work_queue_init).&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I ran the logical analyzer and the data seems ok:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;These signals are from the init of the device, in this situations the data is read correctly (see the logs) and it appears as expected in the MISO line.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:02.000,701] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:00:02.000,732] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:00:02.000,793] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 22
[00:00:02.000,854] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 22
[00:00:02.000,885] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 22
[00:00:02.000,915] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 84
[00:00:02.001,007] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 84
[00:00:02.001,037] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 84
[00:00:02.001,098] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 17
[00:00:02.001,129] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 17
[00:00:02.001,190] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 17
[00:00:02.001,220] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 04
[00:00:02.001,281] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 04
[00:00:02.001,312] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 04
[00:00:02.001,373] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 0c
[00:00:02.001,434] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 0c
[00:00:02.001,464] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 0c
[00:00:02.001,495] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 20
[00:00:02.001,586] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 20
[00:00:02.001,617] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 20
[00:00:02.001,647] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 22
[00:00:02.001,800] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 22
[00:00:02.001,831] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 22
[00:00:02.001,861] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.004,028] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.004,058] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.004,089] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.006,256] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.006,286] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.006,347] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.008,483] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.008,514] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.008,544] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.010,711] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.010,742] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.010,772] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 22
[00:00:02.010,833] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 22
[00:00:02.010,864] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 22
[00:00:02.010,925] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 22
[00:00:02.011,047] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 22
[00:00:02.011,077] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 22
[00:00:02.011,138] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.013,275] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.013,305] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.013,336] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.015,502] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.015,533] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.015,563] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.017,730] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.017,761] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.017,791] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 20
[00:00:02.019,958] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.019,989] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.020,019] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.022,186] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.022,216] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 21
[00:00:02.022,247] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 22&lt;/pre&gt;&lt;br /&gt;&lt;img style="max-height:640px;max-width:800px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1600x1280/__key/communityserver-discussions-components-files/4/Screenshot-from-2025_2D00_12_2D00_02-16_2D00_42_2D00_26.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;These signals are from the work, as we can see I have simillar data as the one received during the init. However, from the logs we only have 0s being read.&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:01:22.975,738] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.975,799] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.977,966] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.977,996] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.978,027] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.980,194] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.980,224] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.980,255] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.982,421] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.982,452] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.982,513] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.982,666] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.982,696] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.982,727] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.984,893] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.984,924] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.984,985] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.987,121] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.987,152] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.987,182] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.989,349] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.989,379] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.989,410] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.991,577] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.991,607] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.991,638] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.993,804] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.993,835] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.993,896] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.996,032] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.996,063] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.996,093] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.998,260] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.998,291] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:22.998,321] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.000,488] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.000,518] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.000,579] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.002,716] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.002,746] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.002,777] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.004,943] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.004,974] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.005,004] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.007,171] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.007,202] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.007,263] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.009,399] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.009,429] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.009,490] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00
[00:01:23.011,657] &amp;lt;err&amp;gt; spi_nrfx_spim: Received content of rx buffer 00&lt;/pre&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img style="max-height:620px;max-width:800px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1600x1240/__key/communityserver-discussions-components-files/4/Screenshot-from-2025_2D00_12_2D00_02-16_2D00_42_2D00_44.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;At first glance seems to me that the signals are ok. Do you have any clue if modifications were done to the SPIM driver to be used in multithread scenarios ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thanks again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM Read fails when using Zephyr WorkQueue</title><link>https://devzone.nordicsemi.com/thread/556013?ContentTypeID=1</link><pubDate>Tue, 02 Dec 2025 13:34:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e19962e7-3717-46df-a290-716234448606</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Miguel,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you explain what do you mean by Turn off and Turn on the device ? Do you control VDD to the SPIS device ? Could you test without turn off and on the device ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;As far as I know system work queue should have higher priority than main thread, by default. So it&amp;#39;s quite strange that it worked in main thread but not in system work queue.&amp;nbsp;&lt;br /&gt;But I know that BLE use system work queue to perform BLE task. So it may have some interference here. But you mentioned even without any BLE activity you still see the problem. Please check if the CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE has enough.&amp;nbsp;&lt;br /&gt;I think the logic analyzer trace will really help here.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>