<?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>SPIS not working with nrf_pwr_mgmt_run</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72423/spis-not-working-with-nrf_pwr_mgmt_run</link><description>Hey all 
 
 In my current project I could set up an SPI communication, where the SPI-slave is on the nordic side. This works fine when I have __WFE() in my main loop, however when I replace __WFE() by nrf_pwr_mgmt_run() no SPI data is received anymore</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Mar 2021 10:01:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72423/spis-not-working-with-nrf_pwr_mgmt_run" /><item><title>RE: SPIS not working with nrf_pwr_mgmt_run</title><link>https://devzone.nordicsemi.com/thread/299199?ContentTypeID=1</link><pubDate>Thu, 11 Mar 2021 10:01:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0e788f8-4aa3-4751-b1eb-79a89c3ddf84</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;In our SPIS example project, we enable constant latency mode on startup in order to mitigate this (see snippet below). It should also be&amp;nbsp;okay to add a delay of ~10us between CS low and the first clock cycle for instance.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    // Enable the constant latency sub power mode to minimize the time it takes
    // for the SPIS peripheral to become active after the CSN line is asserted
    // (when the CPU is in sleep mode).
    NRF_POWER-&amp;gt;TASKS_CONSTLAT = 1;&lt;/pre&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: SPIS not working with nrf_pwr_mgmt_run</title><link>https://devzone.nordicsemi.com/thread/299009?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 13:28:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35290ef3-f777-47df-b01b-418839edae08</guid><dc:creator>M. David.</dc:creator><description>&lt;p&gt;Hello Simon&lt;br /&gt;Thanks for your efforts. This makes sense to me, regarding the behavior I&amp;#39;ve observed. What is not clear to me, where can I do that:&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/72423/spis-not-working-with-nrf_pwr_mgmt_run/298944#298944"]take this into consideration when waking the device up so that the SPIS peripheral is able to get started properly before starting operations.[/quote]
&lt;p&gt;Is this something in can configure somewhere? Or is this something the peer-device has to follow, so it has some delay after enabling the CS?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS not working with nrf_pwr_mgmt_run</title><link>https://devzone.nordicsemi.com/thread/298944?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 09:54:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc71a859-be34-4efe-a54d-87c9322518cb</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I discussed this with a colleague, and this sems to be due to the SPIS having a longer wake-up time when waking up from sleep than most other peripherals. This is only documented in the nRF52832 PS, but is valid for the nRF52840 as well (we&amp;#39;re working on getting it in a future revision).&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1615370009063v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Please take this into consideration when waking the device up so that the SPIS peripheral is able to get started properly before starting operations.&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: SPIS not working with nrf_pwr_mgmt_run</title><link>https://devzone.nordicsemi.com/thread/298792?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 15:53:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c72f725a-a98b-4e09-9100-e59acbffa85e</guid><dc:creator>M. David.</dc:creator><description>&lt;p&gt;Hello Simon&lt;br /&gt;Thanks for your response. I got it to work, so that the event-hander of the SPI gets called, with the event NRFX_SPIS_XFER_DONE, however the received data len is allways 0, unless I run the code in debug mode, even&amp;nbsp; without breakpoints I get the expected data size. Do you have any hints how to resolve this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS not working with nrf_pwr_mgmt_run</title><link>https://devzone.nordicsemi.com/thread/298396?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 13:37:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2511ad86-1abe-4c31-8378-1f8d6bf8996c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;As you can see in most our example projects, nrf_pwr_mgmt_run() is called as part of idle_state_handle() in order to make sure there are no pending log operations, before it goes to sleep until the next event occurs. Please try that on your end as well. If not, please try debugging and go step by step when you go to sleep to see what happens, are you sure you trig a new event to wake the device up?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for handling the idle state (main loop).
 *
 * @details If there is no pending log operation, then sleep until next the next event occurs.
 */
static void idle_state_handle(void)
{
    if (NRF_LOG_PROCESS() == false)
    {
        nrf_pwr_mgmt_run();
    }
}&lt;/pre&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></channel></rss>