<?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>async SPI example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118147/async-spi-example</link><description>Dear all, 
 
 I tried this example regarding async SPI: 
 https://github.com/too1/ncs-spi-master-slave-example 
 
 I also wrote overlay for this example to work on nrf52840 dongle: 
 &amp;amp;pinctrl { spi_master_default: spi_master_default { group1 { psels </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Jan 2025 11:20:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118147/async-spi-example" /><item><title>RE: async SPI example</title><link>https://devzone.nordicsemi.com/thread/520539?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2025 11:20:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b3e40f2-a5d6-414e-b963-d5086ecb18a1</guid><dc:creator>Ivo H</dc:creator><description>&lt;p&gt;Thank you very much.But as I have already written it is resolved.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: async SPI example</title><link>https://devzone.nordicsemi.com/thread/520534?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2025 10:24:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8247bf9-e90c-497c-b30f-c7cf964e3631</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;I see, and we&amp;#39;ll try to help you as best we can. But at this point I think we should wait for Susheel to return. He should be back on Friday and be able to take a better look at this as he&amp;#39;s better versed in Zephyr than me.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: async SPI example</title><link>https://devzone.nordicsemi.com/thread/520339?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2025 10:58:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:173b2a4a-b01b-43bc-9048-af9a4b69dbef</guid><dc:creator>Ivo H</dc:creator><description>&lt;p&gt;I am using vanilla Zephyr,the other person who is included in unresolved issues on github repository raised an issue in 2023 experiencing the same symptoms and he was using NRF SDK.&lt;/p&gt;
&lt;p&gt;Anyway,despite one more bug in the example,the solution was to update to up to date Zephyr version. Zephyr 3.6.99 is probably too old,maybe from 2023?&lt;/p&gt;
&lt;p&gt;I am using nrf hardware because I find it excellent,but I prefer vanilla Zephyr,I still think many people benefit from resolving pure Zephyr issues as many things are shared across Zephyr and NRF SDK and to top it all still buying nrf boards or bare nrf chips.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: async SPI example</title><link>https://devzone.nordicsemi.com/thread/520333?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2025 10:05:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ddd40b7-9196-4a25-bfcd-d5327e624b28</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Just to make sure, you said in your first reply to Susheel that you&amp;#39;re not using the nRF Connect SDK, but &lt;span&gt;Zephyr version 3.6.99. Can you confirm that you&amp;#39;re not using the nRF Connect SDK at all or please let us know what version you&amp;#39;re using. The sample you link to was made for and tested on nRF Connect SDK v2.5.2, and has not been tested on vanilla Zephyr. Maybe the Zephyr discord channel is a better place to ask about these issues.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: async SPI example</title><link>https://devzone.nordicsemi.com/thread/520055?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2025 22:11:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b741c7fe-d5b7-4cbe-b1a3-8fc85cf2662b</guid><dc:creator>Ivo H</dc:creator><description>&lt;p&gt;Actually, here is the github repository of the async-spi-master-slave-communication example with one person raising an issue with very simmilar problem I face:&lt;/p&gt;
&lt;p&gt;&lt;a id="" href="https://github.com/too1/ncs-spi-master-slave-example/issues/2"&gt;https://github.com/too1/ncs-spi-master-slave-example/issues/2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That person seems doing everything right just according to the description of the example with no success running the code.&lt;/p&gt;
&lt;p&gt;One of Nordic engineers recommends this example as a reference at the end of this conversation&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/109586/spi-chip-select-in-device-tree-overlay-in-zephyr"&gt;devzone.nordicsemi.com/.../spi-chip-select-in-device-tree-overlay-in-zephyr&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So I would really consider it as a reference:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s dive to the chip select functionality.In the code there is reference to chip select PIN for master configured this way:&lt;/p&gt;
&lt;p&gt;DTS:&lt;/p&gt;
&lt;p&gt;cs-gpios = &amp;lt;&amp;amp;gpio0 15 GPIO_ACTIVE_LOW&amp;gt;;&lt;br /&gt; reg_my_spi0: spi-dev-a@0 {&lt;br /&gt; reg = &amp;lt;0&amp;gt;;&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;C code:&lt;/p&gt;
&lt;p&gt;.cs = {.gpio = MY_SPI_MASTER_CS_DT_SPEC, .delay = 0},&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What is rather confusing for me is how the chip select for a slave ibeing set in the main.c.&lt;/p&gt;
&lt;p&gt;I am fully aware of the fact that chip select of a slave is somehow mentioned in DTS file via &amp;lt;NRF_PSEL(SPIS_CSN, 1, 15)&amp;gt;;&lt;/p&gt;
&lt;p&gt;But how is the chip select specified for slave in C code?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I only see spi configuration for slave in C code this way:&lt;/p&gt;
&lt;p&gt;static const struct spi_config spi_slave_cfg = {&lt;br /&gt; .operation = SPI_WORD_SET(8) | SPI_TRANSFER_MSB |&lt;br /&gt; SPI_MODE_CPOL | SPI_MODE_CPHA | SPI_OP_MODE_SLAVE,&lt;br /&gt; .frequency = 4000000,&lt;br /&gt; .slave = 0,&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;But how does the program recognizes that the slave should receive chip select signal on pin 1.15 being sent from gpio master chip 0.15?&lt;/p&gt;
&lt;p&gt;Is it linked to the slave automatically somehow via DTS or do I have to specify it for slave&amp;nbsp; explicitly via code in struct spi_config the same way it is specified for master?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the example code, there is no need to specify the CS for slave, but the example does not work for me nor for the other guy. I really do not know, what I am doing wrong.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: async SPI example</title><link>https://devzone.nordicsemi.com/thread/519747?ContentTypeID=1</link><pubDate>Thu, 23 Jan 2025 12:20:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8857a9a1-a01a-472b-86f0-68ccb27b4706</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Susheel is currently out of office, so I&amp;#39;m taking care of this ticket while he&amp;#39;s away. You say you have connected some of the GPIOs together, so have you made sure that these pins don&amp;#39;t have conflicting roles at all. P0.09 and P0.10 being one such conflict, but it could also be that any of these other pins are defined as something else in your project too, so please double check that.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: async SPI example</title><link>https://devzone.nordicsemi.com/thread/519651?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2025 20:58:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50272104-fc01-4dac-a870-d7f4211fbc2e</guid><dc:creator>Ivo H</dc:creator><description>&lt;p&gt;Actually I think the pins are configured properly, all the devices in default ~/zephyrproject/zephyr/boards/nordic/nrf52840dongle/nrf52840dongle_nrf52840-pinctrl.dts with pin numbers which are now used in my SPI configuration were disabled in my nrf52840_dongle.overlay and some of the pin were just swapped fro m spi0 to spi1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: async SPI example</title><link>https://devzone.nordicsemi.com/thread/519290?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 12:38:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6601bd41-698b-4bba-ae2c-28f12521b317</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;It is not an official example but a plaground sample done by one of my ex-colleague and I see that it is not being tested with dongle. I do not have any working dongle to even attempt to test this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you are using VSCode extension for nrf connect, try to double check if the pins are indeed assigned to SPI. For some other sample I used to compile for the nrf54840 dongle, it looks something like this&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1737463056064v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;You get the option of device tree when you clock the project under build as shown in red below&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1737463130210v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: async SPI example</title><link>https://devzone.nordicsemi.com/thread/519202?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 08:12:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67dce813-47a0-4bcd-bcf0-5e38ea54dbab</guid><dc:creator>Ivo H</dc:creator><description>&lt;p&gt;According to other resolved issues with this async SPI communication, it seems like:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/too1/ncs-spi-master-slave-example"&gt;https://github.com/too1/ncs-spi-master-slave-example&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;is official example. It compiles with Zephyr version: 3.6.99 very well, so I assume there is something I am missing.&lt;/p&gt;
&lt;p&gt;The only change I made was I wanted to rewrite the DTS in order to fit nrf52840_dongle.&lt;/p&gt;
&lt;p&gt;The example compiles, runs, but no data is being transferred even though it seems to be sent.&lt;/p&gt;
&lt;p&gt;I have all the wires connected directly without any resistor only internals (whether there are any while communicating on SPI) no capacitors so I hope there is not crossover over the cables, but those issues would be rather random I guess.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: async SPI example</title><link>https://devzone.nordicsemi.com/thread/519169?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 21:28:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:282f9adc-d6ad-4d16-99b7-51718f7d6c09</guid><dc:creator>Ivo H</dc:creator><description>&lt;p&gt;Dear sir, &lt;/p&gt;
&lt;p&gt;thank you, actually, I set different pins instead of 0.9 and 0.10, but no change.&lt;/p&gt;
&lt;p&gt;I also tried this: CONFIG_NFCT_PINS_AS_GPIOS which is already DEPRECATED&lt;/p&gt;
&lt;p&gt;This also makes no change:&lt;/p&gt;
&lt;p&gt;&amp;amp;uicr {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nfct-pins-as-gpios;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;Anyway, I was using these pins as GPIOs in my previous projects with no necessity to manually set this:&lt;/p&gt;
&lt;p&gt;&amp;amp;uicr {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nfct-pins-as-gpios;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am not using NCSDK v 2.9.0, I am using Zephyr version: 3.6.99.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: async SPI example</title><link>https://devzone.nordicsemi.com/thread/519034?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 10:57:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee1b6833-2eac-4df0-81c1-baeb391bb9ea</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;The mangled data might be influence by NFC, P0.09 and P0.10 are used by NFC on nRF52840. Either use different pins than that or disable NFC&amp;nbsp;and set the below in your overlay file (assuming you are using NCSDKv2.9.0)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uicr {
    nfct-pins-as-gpios;
};&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>