<?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>Scheduling Issues Between SPIM and NUS Integration</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114247/scheduling-issues-between-spim-and-nus-integration</link><description>I am programming with the nRF52840DKs. [Toolchain Manager: v1.3.0, IDE: Visual Studio Code (VSCode), SDK: ncs v2.6.0, window11 pro] 
 I am currently working on integrating &amp;#39;NUS_peripheral&amp;#39; and &amp;#39;SPIM&amp;#39;. 
 My goal: communicate with the ADC via SPIM and transmit</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 27 Aug 2024 21:05:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114247/scheduling-issues-between-spim-and-nus-integration" /><item><title>RE: Scheduling Issues Between SPIM and NUS Integration</title><link>https://devzone.nordicsemi.com/thread/500076?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 21:05:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00a854d9-c23c-402d-aa77-a2379134c90c</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I suggest to check out some of the devacademy tutorials that indirectly covers this a bit:&lt;br /&gt;&lt;a href="https://academy.nordicsemi.com/"&gt;https://academy.nordicsemi.com/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I notice you are using nrfx directly to trigger spim transfers at a regular interval, this can work if you are careful with what you do, but&amp;nbsp;the intention is that you should be using the zephyr api, where you simply have a thread that execute the spi transfer at given intervals.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scheduling Issues Between SPIM and NUS Integration</title><link>https://devzone.nordicsemi.com/thread/500003?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 13:08:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aae25ef2-f245-4e9b-aaba-868afd04ffa7</guid><dc:creator>seongmincho</dc:creator><description>&lt;p&gt;Thank you for your advice!! &lt;br /&gt;However, it seems that my question was not clearly conveyed. I apologize for the confusion, and I&amp;#39;d like to rephrase my questions:&lt;/p&gt;
&lt;p&gt;1. In my situation, is it appropriate to execute &lt;code&gt;nus_send&lt;/code&gt; through a separate thread?&lt;/p&gt;
&lt;p&gt;2-1. If it is appropriate, how should I schedule the thread for NUS&amp;nbsp;alongside the spim tasks?&lt;/p&gt;
&lt;p&gt;2-2. If it is not appropriate, is there an alternative method other than using a thread?&lt;br /&gt;&lt;br /&gt;Cho&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scheduling Issues Between SPIM and NUS Integration</title><link>https://devzone.nordicsemi.com/thread/499985?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 12:37:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9066325e-aeb3-4764-a423-6ef09fe81f68</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Do pass data between threads and interrupt you may want to check out message queue:&lt;br /&gt;&lt;a href="https://docs.zephyrproject.org/latest/kernel/services/data_passing/message_queues.html"&gt;https://docs.zephyrproject.org/latest/kernel/services/data_passing/message_queues.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scheduling Issues Between SPIM and NUS Integration</title><link>https://devzone.nordicsemi.com/thread/499959?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 11:26:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee801f07-8bcc-4b6b-81ec-5b10372ea5b4</guid><dc:creator>seongmincho</dc:creator><description>&lt;p&gt;When running the current code, only spim operates. This suggests that there may be an issue with my scheduling method, as it seems I have implemented it incorrectly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;I used a timer to transmit spim consistently, and the timer&amp;#39;s interval is set to be very short(15us~ 60us).&amp;nbsp;To alleviate the load on the spim handler, I attempted to handle nus send using a thread. However, I have determined that this approach may not be appropriate. This is the main issue.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scheduling Issues Between SPIM and NUS Integration</title><link>https://devzone.nordicsemi.com/thread/499956?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 11:07:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9774d73-0e6a-4baa-9504-e1b99b6b4d09</guid><dc:creator>Kenneth</dc:creator><description>[quote user=""]Currently, I am attempting the following approach, but it is not yielding the desired results:[/quote]
&lt;p&gt;Can you elaborate a bit what works, and what you encounter does not work?&lt;/p&gt;
&lt;p&gt;Kenenth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>