<?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>SPI communication between two nRF5340 Audio</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108762/spi-communication-between-two-nrf5340-audio</link><description>I am trying to establish SPI communication between two nRF5340 Audio DK using bitbang as a starting point. I used the third part of the code, which uses spi_transceive and checks the 
 communication by connecting MISO to MOSI. I made two codes, one for</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Mar 2024 11:33:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108762/spi-communication-between-two-nrf5340-audio" /><item><title>RE: SPI communication between two nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/474288?ContentTypeID=1</link><pubDate>Mon, 18 Mar 2024 11:33:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aec4959d-af61-4250-8192-cb71c00c83be</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Good luck &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If you run into any more issues just let me know, and I will do my best to help.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI communication between two nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/474146?ContentTypeID=1</link><pubDate>Fri, 15 Mar 2024 19:49:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f546649-dfff-45b7-98de-a54a7e551672</guid><dc:creator>Joao Colombari</dc:creator><description>&lt;p&gt;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks for the reply!&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Got it! I will check it out and clone when make any new changes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Jo&amp;atilde;o.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI communication between two nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/474024?ContentTypeID=1</link><pubDate>Fri, 15 Mar 2024 08:51:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a08db6d-4c99-43eb-b62b-5c91c7e1ea2f</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi João&lt;/p&gt;
&lt;p&gt;You shouldn&amp;#39;t need to make any changes to the code to run SPI between two devices instead of just one, you just have to connect the master interface on one side to the slave interface on the other.&amp;nbsp;&lt;/p&gt;
[quote user="Joao Colombari"]but the slave side never sees a change in the pooling signal since its changed in the master write function.&amp;nbsp;[/quote]
&lt;p&gt;This is odd, there are separate polling signals for the master and slave, so you should be able to check the status of the slave interface even if you are not sending anything on the master.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For an actual application I think it would be better to use a callback rather than a signal to inform the application that a new message has been received, using &lt;a href="https://docs.zephyrproject.org/latest/hardware/peripherals/spi.html#c.spi_transceive_cb"&gt;this function&lt;/a&gt;. Possibly I will change the example later to use callbacks rather than signals.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI communication between two nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/473927?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2024 14:49:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9275cdc9-01e6-45f4-9391-8b0711cba601</guid><dc:creator>Joao Colombari</dc:creator><description>&lt;p&gt;&lt;span&gt;Torbj&amp;oslash;rn,&amp;nbsp;&lt;br /&gt;Thank so much for your attention.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I could&amp;nbsp;&lt;/span&gt;successfully run your example. The SPI communication works just fine and you are completely right on choosing std SPI node 4 by just adding the new CS, it&amp;#39;s the most reasonable choice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Nevertheless, what I was originally trying to do is using one DK as master and one as slave, that&amp;#39;s why I started with bitbang. With your example running, i tried to delete the slave part in one side and the master in the other and communicating between the two boards, but the slave side never sees a change in the pooling signal since its changed in the master write function.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have any idea on how to adapt it in order to be able to make this communication between DKs?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Obs: I&amp;#39;m just doing this as an exercise, I know it does not make a lot of sense, but since I can&amp;#39;t do I feel like I really need to..&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jo&amp;atilde;o.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI communication between two nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/473608?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2024 11:32:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7f4955f-e9a0-4e8d-adce-a0b5926f7d26</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi João&lt;/p&gt;
&lt;p&gt;I went through the exercise of adding an overlay to the example for the audio DK, by looking at the board files and the pin map and trying to find some available pins.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For the SPI master I simply reused the existing SPI master on SPI4, but added a third chip select line on P1.08 to avoid conflict with any of the existing devices on the SPI bus.&lt;/p&gt;
&lt;p&gt;For the SPI slave I chose the UART2 pins, as I realized that those pins were not enabled in the board files, and as such were free for other purposes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I ended up with the following pin assignments:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;      SPI master - SPI slave
CS      P1.08       P1.12
SCK     P0.08       P1.13
MOSI    P0.09       P1.14
MISO    P0.10       P1.11&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;By making these connections on P3 and P4 I can run the example, and see the communication going back and forth.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I pushed my changes to the repo, and you can see the overlay for the audio DK &lt;a href="https://github.com/too1/ncs-spi-master-slave-example/blob/master/boards/nrf5340_audio_dk_nrf5340_cpuapp.overlay"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI communication between two nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/473282?ContentTypeID=1</link><pubDate>Mon, 11 Mar 2024 17:02:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b0ae6b1-5172-4544-9944-673d7153ba26</guid><dc:creator>Joao Colombari</dc:creator><description>&lt;p&gt;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;No particular reason at all. I used as a starting point in order to simplify my job.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have both tried to disable and assigned different pins. I have also just tried with port 1 pins from 12 to 15, disabling original 1.15 function in the devicetree, and no success (same -22 error, including this last rev file&amp;nbsp;in this reply.)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Jo&amp;atilde;o.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/spi_5F00_mine_5F00_slave.zip"&gt;devzone.nordicsemi.com/.../spi_5F00_mine_5F00_slave.zip&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI communication between two nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/471708?ContentTypeID=1</link><pubDate>Fri, 01 Mar 2024 08:31:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31816eba-ba7f-4b36-8b59-5678c532204e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi João&lt;/p&gt;
&lt;p&gt;Any particular reason you are using the bit_bang example as a starting point?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is no need to use the bit_bang driver unless you need a non standard SPI configuration that our SPIM peripheral doesn&amp;#39;t support, but if you want to communicate with another nRF device in SPI slave mode then this should not be necessary.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The pins you have chosen for the SPI master/slave interfaces are already assigned to the&amp;nbsp;UART2 &amp;nbsp;interface in the audio DK, as can be seen from the pin map &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf5340_audio/UG/nrf5340_audio/hw_pin_maps.html?cp=15_4_2_3"&gt;here&lt;/a&gt;. Have you tried to use other pins?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You could try to disable the uart1 device tree node in order to use the UART2 pins, but this might have unintended side effects if you want to run the audio example.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>