<?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>NRF52840 Consumption SDK15.2</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41210/nrf52840-consumption-sdk15-2</link><description>Hi, 
 We have many projects based on nRF52832 SDK 12 and we are porting them to nRF52840 SDK15.2 to take advantage of the new BLE5 features. 
 The problem is that we are having troubles with the nRF52840 consumption. When idle, our old projects in SDK12</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 11 Dec 2018 12:57:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41210/nrf52840-consumption-sdk15-2" /><item><title>RE: NRF52840 Consumption SDK15.2</title><link>https://devzone.nordicsemi.com/thread/161196?ContentTypeID=1</link><pubDate>Tue, 11 Dec 2018 12:57:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87f0ab63-7364-40c4-8a2e-2a0b1abb4b62</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I do not have a strong recommendation. I have not timed the function calls to initialize and reinitialize the SPI driver, but I would expect it to be quite fast. If it is, then I would say that initializing and initializing the driver is probably the best solution as it is cleaner. If not, then your approach by just disabling the GPIO input pin ENABLE register should be OK as well. At least, I do not see that it should cause any&amp;nbsp;problematic side effects.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 Consumption SDK15.2</title><link>https://devzone.nordicsemi.com/thread/161174?ContentTypeID=1</link><pubDate>Tue, 11 Dec 2018 11:41:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04dd4ad3-ffed-418d-8660-a444ce3b375a</guid><dc:creator>mtorti</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I think you are right, it must be happening what you are saying. The strange thing is that with nRF52832 we didn&amp;#39;t have this problem. So what do you think would be the best workaround? Configure as default the MISO pin every time i disable the SPI and reconfigure it when i enable it?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 Consumption SDK15.2</title><link>https://devzone.nordicsemi.com/thread/161162?ContentTypeID=1</link><pubDate>Tue, 11 Dec 2018 10:28:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1500b17c-ee97-48ce-bfaa-d11e19665b35</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The call to&amp;nbsp;nrf_gpio_cfg_default() configures the GPIO to the default state, which is disconnected input. The fact that this solves the issue is not so strange, as the MISO pin is probably floating (not driven by the slave) when the chip select signal is deasserted. A floating GPIO inputs could very well cause high current consumption if the voltage is in the undefined region.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 Consumption SDK15.2</title><link>https://devzone.nordicsemi.com/thread/161073?ContentTypeID=1</link><pubDate>Mon, 10 Dec 2018 17:21:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:681a71ed-689d-4145-8d95-6ca4041f28b7</guid><dc:creator>mtorti</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I investigated the&amp;nbsp;&lt;span&gt;nrf_drv_spi_uninit() and the magic line is&amp;nbsp;nrf_gpio_cfg_default(p_cb-&amp;gt;miso_pin);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If i don&amp;#39;t use nrf_drv_spi_uninit() function and instead do&amp;nbsp;nrf_gpio_cfg_default(MISO_PIN);&amp;nbsp;NRF_SPI0-&amp;gt;ENABLE=0; the consumption decrease to a few uA as expected. if i comment the line&amp;nbsp;nrf_gpio_cfg_default(MISO_PIN) the idle consumption increase too much. Is this normal? What could be causing this?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 Consumption SDK15.2</title><link>https://devzone.nordicsemi.com/thread/160899?ContentTypeID=1</link><pubDate>Mon, 10 Dec 2018 09:24:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:242d6e0b-b83e-4745-adef-d4d06cae33b6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Were you able to find out more about this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 Consumption SDK15.2</title><link>https://devzone.nordicsemi.com/thread/160550?ContentTypeID=1</link><pubDate>Thu, 06 Dec 2018 11:07:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5573a6f1-eb58-43a5-a4b0-60a9dfec2224</guid><dc:creator>mtorti</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using the SPIM0 with EasyDMA.&lt;/p&gt;
&lt;p&gt;The code look like this:&lt;/p&gt;
&lt;p&gt;static const nrf_drv_spi_t m_spi = NRF_DRV_SPI_INSTANCE(0);&lt;/p&gt;
&lt;p&gt;nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;&lt;br /&gt;&lt;br /&gt;spi_config.sck_pin = 12;&lt;br /&gt;spi_config.mosi_pin = P0_PIN_NUM+ 9;&lt;br /&gt;spi_config.miso_pin = 8;&lt;br /&gt;spi_config.ss_pin = 6;&lt;br /&gt;&lt;br /&gt;spi_config.frequency = NRF_DRV_SPI_FREQ_500K;&lt;br /&gt;spi_config.mode = NRF_DRV_SPI_MODE_0;&lt;br /&gt;spi_config.bit_order = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST;&lt;br /&gt;spi_config.orc = 0xCC;&lt;br /&gt;spi_config.irq_priority = APP_IRQ_PRIORITY_LOW;&lt;/p&gt;
&lt;p&gt;err_code = nrf_drv_spi_init(&amp;amp;m_spi, &amp;amp;spi_config, NULL, NULL);&lt;br /&gt;APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then i make some communication with&amp;nbsp;&lt;/p&gt;
&lt;p&gt;err_code = nrf_drv_spi_transfer(&amp;amp;m_spi, tx_buf, 2, rx_buf, 2);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and finally:&lt;/p&gt;
&lt;p&gt;NRF_SPI0-&amp;gt;ENABLE = 0;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I will try to investigate further the&amp;nbsp;&lt;span&gt;nrf_drv_spi_uninit() function to see what is the line that is solving the high consumption.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 Consumption SDK15.2</title><link>https://devzone.nordicsemi.com/thread/160538?ContentTypeID=1</link><pubDate>Thu, 06 Dec 2018 10:29:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7b1312f-034b-45b7-824c-a1be8dc9ae4e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You do not even need to call&amp;nbsp;nrf_drv_spi_uninit(). If you comment it out&amp;nbsp;in the code from the previous post you should still see good power consumption numbers. Can you say more about how you use SPI? Is it SPI or SPIM (with DMA), how is the driver configured, how does you SPI code look like?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 Consumption SDK15.2</title><link>https://devzone.nordicsemi.com/thread/160413?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 14:32:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b85147e7-30e2-4c13-887a-318d7203f81f</guid><dc:creator>mtorti</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Using the nrf_drv_spi_uninit function the consumption decrease to 3uA, so the problem seems to be that NRF_SPI0-&amp;gt;ENABLE=0 is not enough to shutdown the SPI.&lt;/p&gt;
&lt;p&gt;The only drawback is that our application is relatively time and consumption constraint, we are periodically enabling and disabling the SPI to lower the current and save battery. Already the nrf_drv_spi_uninit adds overhead compared to NRF_SPI0-&amp;gt;ENABLE; in addition to this i have to reinitialize the entire SPI when re-enabling it? In the SDK12 NRF_SPI0-&amp;gt;ENABLE=0 and NRF_SPI0-&amp;gt;ENABLE=1 were enough to enable and disable SPI and get the lowest consumption.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 Consumption SDK15.2</title><link>https://devzone.nordicsemi.com/thread/160395?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 13:31:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d080770-877d-43ec-8096-75f1c32e6f68</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What else do you do in your code when you use SPI? You should not see a high current consumption after a SPI transaction. You can verify this by for instance taking the SPI SDK example, disabling UART logging and modifying it so it looks like this (doing a single transaction before going to sleep). There you should get a current is a few micro amps (verified on my side using a nRF52840 DK):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{
    bsp_board_init(BSP_INIT_LEDS);

    APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
    NRF_LOG_DEFAULT_BACKENDS_INIT();

    nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
    spi_config.ss_pin   = SPI_SS_PIN;
    spi_config.miso_pin = SPI_MISO_PIN;
    spi_config.mosi_pin = SPI_MOSI_PIN;
    spi_config.sck_pin  = SPI_SCK_PIN;
    APP_ERROR_CHECK(nrf_drv_spi_init(&amp;amp;spi, &amp;amp;spi_config, spi_event_handler, NULL));

    NRF_LOG_INFO(&amp;quot;SPI example started.&amp;quot;);

    // Reset rx buffer and transfer done flag
    memset(m_rx_buf, 0, m_length);
    spi_xfer_done = false;
    APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, m_tx_buf, m_length, m_rx_buf, m_length));

    while (!spi_xfer_done)
    {
        __WFE();
    }

    nrf_drv_spi_uninit(&amp;amp;spi);

    NRF_LOG_FLUSH();

    while (1)
    {
        __WFE();
    }
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 Consumption SDK15.2</title><link>https://devzone.nordicsemi.com/thread/160253?ContentTypeID=1</link><pubDate>Tue, 04 Dec 2018 17:01:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f07ab300-ec12-408a-b5c5-89b6f4b44e41</guid><dc:creator>mtorti</dc:creator><description>&lt;p&gt;I verified the code&amp;nbsp;further and it seems that the high consumption is due to the SPI. In the code, i configure the SPI, do some task and then shutdown it with&amp;nbsp;NRF_SPI0-&amp;gt;ENABLE = 0, but the consumption does not decrease. If i don&amp;#39;t initialize the SPI then the iddle current is 3uA as expected.&amp;nbsp;Is something missing?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 Consumption SDK15.2</title><link>https://devzone.nordicsemi.com/thread/160223?ContentTypeID=1</link><pubDate>Tue, 04 Dec 2018 14:14:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17a9df63-86a8-4604-91d6-49ba2b27a5a4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Most of the BLE examples in the will consume about 2-3&amp;nbsp;μA out of the box as long as you disable UART logging (enabled by default). We need to look more detailed at your application in order to see what you have such a high idle current consumption. Can you elaborate? also, have you attempted to strip out/disable parts of your application to narrow down what could cause the high current consumption?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>