<?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>Current consumption difference between GNU and IAR builds</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29911/current-consumption-difference-between-gnu-and-iar-builds</link><description>I am experiencing a difference in current between the example program during advertising between a IAR compilation and a GNU compilation. 
 The differences appear to be significant in a range of 10x more power for the GNU during advertising.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Feb 2018 11:45:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29911/current-consumption-difference-between-gnu-and-iar-builds" /><item><title>RE: Current consumption difference between GNU and IAR builds</title><link>https://devzone.nordicsemi.com/thread/121235?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2018 11:45:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5752e5b4-32a9-4b68-9530-5671848c833a</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;No problem Robert. If you need more help with this just let me know.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption difference between GNU and IAR builds</title><link>https://devzone.nordicsemi.com/thread/120710?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2018 13:25:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51d04cb9-3d33-40f8-9a48-2a9edb65e381</guid><dc:creator>Robert</dc:creator><description>&lt;p&gt;Sorry at this time, my focus has been changed to other features. &amp;nbsp;I will have to look into this again soon though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption difference between GNU and IAR builds</title><link>https://devzone.nordicsemi.com/thread/120662?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2018 07:36:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:112b17ca-181c-4a5b-bb1b-3d9eabfecdc6</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Robert&lt;/p&gt;
&lt;p&gt;Did you ever get around to running it again, or did you figure out the problem some other way?&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: Current consumption difference between GNU and IAR builds</title><link>https://devzone.nordicsemi.com/thread/118958?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 16:05:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7b49be2-b609-4da3-bf4e-5825fa911856</guid><dc:creator>Robert</dc:creator><description>&lt;p&gt;BLE event type AdvertisingPeripheral connection&lt;br /&gt;
Voltage  V&lt;/p&gt;
&lt;p&gt;BLE interval  ms&lt;/p&gt;
&lt;p&gt;TX payload  bytes&lt;/p&gt;
&lt;p&gt;TX power 40-4-8-12-16-20-40 dBm&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Test setup
•Chip: nRF52832QFAAB0 
•Softdevice: s132 2.0.0 
•32MHz crystal (HFXO) 
•32kHz crystal (LFXO) 
•Sleep clock accuracy master and slave: 20 ppm 
•DCDC enabled 

Estimated values

BLE event total charge: 12.3 uC 
BLE event total length: 4.6 ms 
Average BLE event interval: 2005.0 ms 
Total average current:  8.0 uA 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;These setting were run on the pc10056 dev kit for both comipilations.  I am going to run this again, to make sure that it wasn&amp;#39;t something in my setup.  Before measuring current, all the cables were disconnected and the board was reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption difference between GNU and IAR builds</title><link>https://devzone.nordicsemi.com/thread/118957?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 15:24:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6087c950-4618-4087-a4a4-a18183fb98a8</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Are you sure that the IAR test was done on the same hardware and firmware?&lt;/p&gt;
&lt;p&gt;Can you plug your advertising settings into the &lt;a href="https://devzone.nordicsemi.com/power/"&gt;online power profiler&lt;/a&gt;, and see how the numbers compare?
200uA could be normal for advertising, if the advertising interval is short.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption difference between GNU and IAR builds</title><link>https://devzone.nordicsemi.com/thread/118956?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 13:54:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e8db66d-493e-45f8-93c5-0d4af68c09c3</guid><dc:creator>Robert</dc:creator><description>&lt;p&gt;The full code is ble_app_pwr_profiling/main.c. I didn&amp;#39;t want to have to push any buttons so I made a minor change.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;int main(void)
{
    //    ret_code_t err_code;
    //    bool is_notification_mode    = false;
    //    bool is_non_connectable_mode = false;

    timers_init();
    buttons_init();
    
#if 0
#if BUTTONS_NUMBER &amp;gt; 2
    // Check button states.
    // Notification Start button.
    is_notification_mode = bsp_board_button_state_get(NOTIF_BUTTON_ID);

    // Non-connectable advertisement start button.
    if (!is_notification_mode)
    {
        is_non_connectable_mode = bsp_board_button_state_get(NON_CONN_ADV_BUTTON_ID);
    }
    else
    {
        // Un-configured button.
    }
#else
    is_notification_mode = true;
#endif
#endif
    
    // Initialize SoftDevice.
    ble_stack_init();

#if 0
    if (!is_notification_mode &amp;amp;&amp;amp; !is_non_connectable_mode)
    {
        // The startup was not because of button presses. This is the first start.
        // Go into System-Off mode. Button presses will wake the chip up.
        err_code = sd_power_system_off();
        APP_ERROR_CHECK(err_code);
    }
#endif
    
    // If we reach this point, the application was woken up
    // by pressing one of the two configured buttons.
    gap_params_init();
    gatt_init();

#if 1
    // Notification button is pressed. Start connectable advertisement.
    connectable_adv_init();
    service_add();
#else
    if (is_notification_mode)
    {
        // Notification button is pressed. Start connectable advertisement.
        connectable_adv_init();
        service_add();
    }
    else
    {
        non_connectable_adv_init();
    }
#endif
    
    advertising_data_init();
    advertising_start();

    // Enter main loop.
    for (;;)
    {
        power_manage();
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The numbers taken for the IAR were done by someone else, and I don&amp;#39;t recall the exact amount of current.  The current for the version compiled with gcc was around 200uA.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption difference between GNU and IAR builds</title><link>https://devzone.nordicsemi.com/thread/118955?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 08:12:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84471212-acb7-4ca8-8833-c0f65e291f5c</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Seeing the numbers would also be helpful, they can some times indicate what is running or not.&lt;br /&gt;
As Turbo is saying, the choice of compiler shouldn&amp;#39;t have such a big impact on current consumption. If you see a huge difference I am inclined to think that the power management is not working properly with one of the compilers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption difference between GNU and IAR builds</title><link>https://devzone.nordicsemi.com/thread/118954?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2018 15:27:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ee58711-f4b0-4da9-a1e3-f3afd19afcc4</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;In other words: Show us code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption difference between GNU and IAR builds</title><link>https://devzone.nordicsemi.com/thread/118953?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2018 15:26:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6db35f24-71b4-40ad-bff4-e1ecc5b13e8e</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;That seems unlikely. With correct power management advertising current is dominated by the radio and not the CPU core.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>