<?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>compiler optimization</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92468/compiler-optimization</link><description>hi Team, 
 i am using Microsoft Windows 10 Enterprise OS and segger 5.40. 
 i am using nrf52840 device in my project along with nrf5_SDK. 
 i compiled pwm code with different optimization levels. and i observed flash memory size and executing speed is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 30 Sep 2022 10:44:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92468/compiler-optimization" /><item><title>RE: compiler optimization</title><link>https://devzone.nordicsemi.com/thread/388736?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 10:44:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfecec6a-c929-4ead-8ec9-9b1c3d21a269</guid><dc:creator>kunchalaRajesh</dc:creator><description>&lt;p&gt;Thanks for clarifying my doubts&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: compiler optimization</title><link>https://devzone.nordicsemi.com/thread/388712?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 09:12:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2913a73d-fe26-4edd-acea-6297072cc029</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Why would you expect the application optimization level to change the accuracy of the PWM? If PWM is implemented in SW, then I agree that its accuracy could be affected by optimization, but typically the PWM on nRF52xxx chips are handled by the HW PWM peripheral, or by the PWM library (implemented using HW TIMERs, PPI, and GPIOTE). If you are using the HW resources, optimization should only affect the speed of the application execution, so you might see faster interrupt handling when changing PWM parameters, etc. if you set a high optimization level.&lt;/p&gt;
&lt;p&gt;For simple applications, the CPU utilization might be low, reducing the need to do heavily optimize the application to make it run smoothly. Available memory might also be a good argument to perform optimizations. The cost of higher optimization levels are usually higher compile times. See &lt;a href="https://gcc.gnu.org/onlinedocs/gnat_ugn/Optimization-Levels.html"&gt;this page&lt;/a&gt; for more details about Optimization levels.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>