<?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>Issue about the SPIM driver</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94334/issue-about-the-spim-driver</link><description>Dear Nordic Engineers 
 I have a problem like to aks you. I use the functions of the NCS\v1.9.1\zephyr\drivers\spi. 
 I found the PM_DEVICE_ACTION_RESUME is don&amp;#39;t has any code about spi_init. 
 The nrfx_spim_init() will be called at configuration before</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Nov 2022 08:44:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94334/issue-about-the-spim-driver" /><item><title>RE: Issue about the SPIM driver</title><link>https://devzone.nordicsemi.com/thread/398251?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2022 08:44:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9983826d-bfaf-4df9-bda4-2b913c6fc321</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Which SPIM interface are they using on the nRF5340?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Did they connect a scope or logic analyzer to the SPI bus in order to see what happens when the issue occurs, and what is different when they add this change?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you give me a bit more details I can try to reproduce the issue here.&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: Issue about the SPIM driver</title><link>https://devzone.nordicsemi.com/thread/398148?ContentTypeID=1</link><pubDate>Tue, 29 Nov 2022 14:28:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ecabc4e-1e0c-4594-a374-459a17e6820c</guid><dc:creator>Hannibalhz</dc:creator><description>&lt;p&gt;Dear Torbjorn&lt;/p&gt;
&lt;p&gt;Our customer&amp;nbsp;has a problem. They use NRF5340(SPIM) and STM32(SPIS) to transfer the data. Now, they found a problem&amp;nbsp; if they use SPIM default code. The SPIS can&amp;#39;t receive the data from SPIM, or the SPIS reception data is messy.&lt;/p&gt;
&lt;p&gt;We think this problem is that the SPIS is not ready to receive the data. So the modify the&amp;nbsp;&lt;span&gt;&amp;nbsp;nrfx_spim_init() function to the&amp;nbsp;PM_DEVICE_ACTION_RESUME case. Then, the problem disappeared.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We think the problem because of the time form start the nrfx_spim_init() to start &amp;nbsp;transfer the SPI data is too short.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you have any suggestion?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue about the SPIM driver</title><link>https://devzone.nordicsemi.com/thread/398107?ContentTypeID=1</link><pubDate>Tue, 29 Nov 2022 12:54:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a53dcef-b749-4836-9ef7-e915eb2a70eb</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Since a SPI master transaction is always initiated by the application there is no need to initialize the SPIM interface unless you actually&amp;nbsp;want to send something. Essentially the SPIM module will always be disabled in between transactions to ensure the lowest possible sleep currents, and it doesn&amp;#39;t have to be explicitly suspended.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is different for UART which is an asynchronous interface, and you might get data on the UART RX pin at any time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;TWI master is essentially the same as SPI master in that the master side always initiates communication, so in theory the TWIM driver could also be implemented in the same way.&amp;nbsp;&lt;/p&gt;
[quote user=""]1. If I modify the&amp;nbsp;nrfx_spim_init() to&amp;nbsp;PM_DEVICE_ACTION_RESUME case, does it have any problem?[/quote]
&lt;p&gt;Do you mean you want to modify the SPI driver directly?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I would not recommend this, as we haven&amp;#39;t tested it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there any particular reason why you need to change this?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you see poor performance from the driver?&amp;nbsp;&lt;/p&gt;
[quote user=""]2. What reason that &lt;span&gt;modify&lt;/span&gt; the&amp;nbsp;nrfx_spim_init(), mobile it to the&amp;nbsp;configure(const struct device *dev,const struct spi_config *spi_cfg)? I think that&amp;#39;s a little unreasonable.[/quote]
&lt;p&gt;As I explained above there&amp;nbsp;shouldn&amp;#39;t be any need to initialize the SPIM interface until you have data to send. If you use device power management the assumption is that you want the average current to be as low as possible, in which case it makes sense to keep all peripherals off as much as possible.&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>