<?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>Build with optimization does not work with DFU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3658/build-with-optimization-does-not-work-with-dfu</link><description>Hi,
I&amp;#39;m using IAR ARM Embedded Workbench (v7.20) to build my Nordic applications. Recently I enabled optimizations (in Project Options: C/C++ Compiler:Optimizations: Level-High-Size). However, when I try to DFU this build it always fails. DFU-ing it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Mar 2015 21:58:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3658/build-with-optimization-does-not-work-with-dfu" /><item><title>RE: Build with optimization does not work with DFU</title><link>https://devzone.nordicsemi.com/thread/13285?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2015 21:58:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b765952-9e62-4bff-b6ce-e90239cc9647</guid><dc:creator>Matt Barr</dc:creator><description>&lt;p&gt;Genius, thanks colton!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build with optimization does not work with DFU</title><link>https://devzone.nordicsemi.com/thread/13284?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2015 04:40:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95b4429d-75c7-4d90-835f-c09b2488ffec</guid><dc:creator>colton</dc:creator><description>&lt;p&gt;You can have high optimization on and nrf_delay_ms still works.  It uses volatile to ensure that it doesn&amp;#39;t get optimized away.  It does not affect the timing.&lt;/p&gt;
&lt;p&gt;I have no idea why, but if you turn off static clustering in the IAR optimizations then the DFU works with high optimization.  Not using the DFU static clustering can be enabled but OTA updates static clustering can&amp;#39;t be enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build with optimization does not work with DFU</title><link>https://devzone.nordicsemi.com/thread/13281?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2014 15:31:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b7623bd-4baf-4c31-854c-08684f09bed9</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Try to check for asserts in bootloader. Place some test led on inside app_error_handler() and while(1);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build with optimization does not work with DFU</title><link>https://devzone.nordicsemi.com/thread/13283?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2014 15:19:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66a086ee-ab2c-4da2-87f6-4b7ec20102c3</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;With gcc and keil -Os (-O3) optimization is working fine for DFU.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build with optimization does not work with DFU</title><link>https://devzone.nordicsemi.com/thread/13282?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2014 15:08:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd99ae61-3d3b-48fc-8f33-9e4f87cb0d58</guid><dc:creator>scytulip</dc:creator><description>&lt;p&gt;I think optimization cannot be applied to any code which relies on hardware performance.&lt;/p&gt;
&lt;p&gt;For example, in the API call of &lt;code&gt;nrf_delay_ms&lt;/code&gt;, it runs multiple &lt;code&gt;NOP&lt;/code&gt; instructions to achieve 1ms unit delay.&lt;/p&gt;
&lt;p&gt;In my opinion, if you optimize your code, the compiler may reduce this &amp;quot;redundant&amp;quot; function but totally mess up the timing of your program.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build with optimization does not work with DFU</title><link>https://devzone.nordicsemi.com/thread/13280?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2014 14:38:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9e62a1d-1a9c-42f4-ab36-5117989fd5c8</guid><dc:creator>Akbar Dhanaliwala</dc:creator><description>&lt;p&gt;Softdevice s110 v7.0
DFU from SDK6.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build with optimization does not work with DFU</title><link>https://devzone.nordicsemi.com/thread/13279?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2014 14:37:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb858bcd-48af-44d1-b00f-fa016fc61dfd</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;What version of softdevice and SDK do you use? And what DFU project do you use?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build with optimization does not work with DFU</title><link>https://devzone.nordicsemi.com/thread/13278?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2014 14:33:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b3b0ed8-5ceb-4ac6-9de6-e7b9fc264aab</guid><dc:creator>Akbar Dhanaliwala</dc:creator><description>&lt;p&gt;This is what I&amp;#39;m doing step by step:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open nrf Toolbox v1.9.1 on an Android Device running 4.4.4&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In DFU-&amp;gt; Select File-&amp;gt;DropBox-&amp;gt;select application.hex file&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select Device-&amp;gt; Choose DfuTarg&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Upload -&amp;gt; Says: Connecting...-&amp;gt;Starting DFU...-&amp;gt;Update Failed: Remote DFU Not Supported (3)&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;-akbar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build with optimization does not work with DFU</title><link>https://devzone.nordicsemi.com/thread/13277?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2014 14:29:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22a4f35c-1d33-49a1-a3ee-be0f138b3446</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;I don&amp;#39;t quite understand what do you mean. If you compile your bootloader without optimization then DFU works fine, but if you compile it with optimization then DFU fails? How exactly DFU fails? You not able to discover DFU or some troubles when you try to load your application with DFU?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>