<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/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/"><channel><title>Code crashes when Optimiser is set to -O0</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/44751/code-crashes-when-optimiser-is-set-to--o0</link><description> Keil uVision 5.28a 
 Target: ST Nucleo F429ZI (Cortex M4) 
 
 My colleague created a project using Keil uVision 5.28a. The only options used in the project creation wizzard were startup.s and CMSIS-&amp;gt;Core and DEVICE-&amp;gt;Startup 
 The only code (in main.c</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Code crashes when Optimiser is set to -O0</title><link>https://community.arm.com/thread/162075?ContentTypeID=1</link><pubDate>Tue, 17 Dec 2019 07:24:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:aca60bf7-859b-4b7c-97b4-b6cbce3edbc0</guid><dc:creator>Nicholas Outram</dc:creator><description>&lt;p&gt;Already tried making the loop var volatile. Tried adding noop after setting up the GPIOB clock. No luck.&lt;/p&gt;
&lt;p&gt;Will try looking at registers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Code crashes when Optimiser is set to -O0</title><link>https://community.arm.com/thread/161831?ContentTypeID=1</link><pubDate>Fri, 06 Dec 2019 20:55:54 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c6839a97-8660-4c37-81b2-96e0e2ec323a</guid><dc:creator>Westonsupermare Pier</dc:creator><description>&lt;p&gt;Have a delay, or read-back after enabling the GPIOB clock. Several STM32 have an errator that you need at least one bus cycle between enabling a clock, and using the peripheral the clock enables.&lt;/p&gt;
&lt;p&gt;Use volatile for the loop iterator.&lt;/p&gt;
&lt;p&gt;ODR writes ALL pins in the bank.&lt;/p&gt;
&lt;p&gt;Print out register settings on serial port so you can inspect to differences in internal states with/without the debugger. See if the debugger is setting up the chip in a way you aren&amp;#39;t.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Code crashes when Optimiser is set to -O0</title><link>https://community.arm.com/thread/161825?ContentTypeID=1</link><pubDate>Fri, 06 Dec 2019 10:43:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7c30d613-0772-4b9d-a8af-73ef4163b5e6</guid><dc:creator>Nicholas Outram</dc:creator><description>&lt;p&gt;Addendum: this is using ARMCC v6&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/471/Compiler.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>