<?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>nRF5340 SPI Master example code</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91300/nrf5340-spi-master-example-code</link><description>Hi, 
 I tried configure and run SPI master interface on nRF 5340 DK board using several examples for nRF 5340 but I had some compile errors or they did not work. Is there any example that will allow me to run SPI master interface at 16MHz or more using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Sep 2022 09:16:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91300/nrf5340-spi-master-example-code" /><item><title>RE: nRF5340 SPI Master example code</title><link>https://devzone.nordicsemi.com/thread/386792?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 09:16:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2e48ed9-8c6e-49c6-a5b0-dcdecbdd730c</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can look at the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_hr_coded/README.html"&gt;Bluetooth: Peripheral Heart Rate Monitor with Coded PHY&lt;/a&gt;&amp;nbsp;in NCS, it uses work queue. I suggest to also read the documentation I shared in my previous reply.&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 SPI Master example code</title><link>https://devzone.nordicsemi.com/thread/386487?ContentTypeID=1</link><pubDate>Fri, 16 Sep 2022 04:31:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13415e70-c9cb-43ae-be90-bee0b897d65a</guid><dc:creator>Franci</dc:creator><description>&lt;p&gt;Hi Jared,&lt;/p&gt;
&lt;p&gt;Could you provide some examples of a work queue. This SPI read and write operation is time sensitive and it must occur at a specific interval (in my application that interval is 1us).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Franci&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 SPI Master example code</title><link>https://devzone.nordicsemi.com/thread/386383?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2022 11:58:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c59b056d-0f0b-43f7-b8f0-05637f018bb8</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Ok, but I think the end result is somewhat the same as you&amp;#39;re calling it in the timer handler. Could you instead try to offload it to a &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/kernel/services/threads/workqueue.html?highlight=work+queue#c.k_work_init"&gt;work queue&lt;/a&gt; every time the callback handler is called?&lt;/p&gt;
&lt;p&gt;regards&lt;br /&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 SPI Master example code</title><link>https://devzone.nordicsemi.com/thread/386078?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 04:44:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e81fc725-c932-44bf-b7e3-67d7ddd4b602</guid><dc:creator>Franci</dc:creator><description>&lt;p&gt;Hi Jared,&lt;/p&gt;
&lt;p&gt;No, I am trying to call spi_write_test(). I am not attempting to use&amp;nbsp;SOC integrated ADC. I am using an external ADC. Please see lines 527-535 in main.c.&lt;/p&gt;
&lt;p&gt;I added timer0 functionality and SPI master to the central_and_perpheral_hr example. Moreover, I will need two master SPI interfaces. One for external DAC and one for external ADC. The ADC and the DAC will operate at a same time.&lt;/p&gt;
&lt;p&gt;Timer0 elapsed event works as expected but every time when spi_write_test() is called the soc resets.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;void timer0_elapsed(struct k_timer *timer_id)&lt;br /&gt; {&lt;/p&gt;
&lt;p&gt;value = !value;&lt;br /&gt; dk_set_led(DK_LED2, value);&lt;br /&gt; //spi_write_test_msg();&lt;br /&gt; spi_write_test();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Franci&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 SPI Master example code</title><link>https://devzone.nordicsemi.com/thread/386004?ContentTypeID=1</link><pubDate>Tue, 13 Sep 2022 13:51:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:216988f4-ca89-46fa-9043-bd519669bc76</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;Are you able to run the example without any modifications? And what modifications did you do to&amp;nbsp;the project? The program is asserting &lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/b10c52635237495c27623cd50b7f3d636d25e58a/kernel/sem.c#L121"&gt;here&lt;/a&gt;, is there a chance that you&amp;#39;re trying to call the adc_sample from the timer callback as in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/74617/config_assert-cause-code-to-crash"&gt;this &lt;/a&gt;case?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 SPI Master example code</title><link>https://devzone.nordicsemi.com/thread/384610?ContentTypeID=1</link><pubDate>Mon, 05 Sep 2022 13:47:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c205b66d-ffcd-4fc7-ba19-717f65836d39</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi Franci, sorry you have not heard from us. The case is at least open now. We will get back to you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 SPI Master example code</title><link>https://devzone.nordicsemi.com/thread/384439?ContentTypeID=1</link><pubDate>Sat, 03 Sep 2022 03:01:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00d6dd5a-3f8f-46c3-8aaa-7d3df9d3004b</guid><dc:creator>Franci</dc:creator><description>&lt;p&gt;I see that this ticket is closed but I did not get any answer.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 SPI Master example code</title><link>https://devzone.nordicsemi.com/thread/383801?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2022 07:46:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f3318a8-3e88-4243-89d2-304c33dd8cbc</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi Franci,&lt;/p&gt;
&lt;p&gt;I have taken over this case as Jared is out of office. I will look into this and get back to you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 SPI Master example code</title><link>https://devzone.nordicsemi.com/thread/383574?ContentTypeID=1</link><pubDate>Mon, 29 Aug 2022 04:46:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:093df1af-6c8c-47e6-8337-86f6ff5013d0</guid><dc:creator>Franci</dc:creator><description>&lt;p&gt;Hi Derek,&lt;/p&gt;
&lt;p&gt;I attempted to use your example and combine it with my code. I need only master SPI driver since my peripheral devices are ADC and DAC. For now, I am trying to make ADC work.&amp;nbsp; I am using timer to start SPI transmit and receive operations. Eventually I will need two SPI master interfaces because ADC and DAC must operate simultaneously.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am able to run timer at desired frequency and initialize SPI interface without any error message but every time when I attempt to send or receive data using SPI the board (nRF5340 DK) reboots.&lt;/p&gt;
&lt;p&gt;Zephyr RTOS is new to me, and I have difficulties to find what is the cause of the problem.&lt;/p&gt;
&lt;p&gt;Below is the debug terminal screenshot and my link to my code is &lt;a title="Combined Example Timer and SPI" href="https://1drv.ms/u/s!AuO0SAGTMwk2jYBeB6H6x9LkApDZyg?e=q7S6rM"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/2870.Error.PNG" /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 SPI Master example code</title><link>https://devzone.nordicsemi.com/thread/383258?ContentTypeID=1</link><pubDate>Thu, 25 Aug 2022 11:42:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd9dc0c5-5ccc-4d17-bd32-f4224027b004</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you try &lt;a href="https://github.com/too1/ncs-spi-master-slave-example"&gt;this &lt;/a&gt;example? You still need to change the frequency though.&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>