<?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>Writing to flash without debugger crashes</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/40797/writing-to-flash-without-debugger-crashes</link><description> 
Hi, 

 
I wrote a program, where some data is written to the internal
flash of a stm32f4. 
If I am debugging everything works fine, but if the controller runs
without the debugger, the data is not written. 

 
Can somebody tell me why this happens?</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Writing to flash without debugger crashes</title><link>https://community.arm.com/thread/63319?ContentTypeID=1</link><pubDate>Tue, 02 Dec 2014 04:35:40 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7a5f19e3-2b2b-44b7-aab8-110439ba29b8</guid><dc:creator>Westonsupermare Pier</dc:creator><description>&lt;p&gt;&lt;p&gt;
Your code is broken? Or makes invalid assumptions?&lt;/p&gt;

&lt;p&gt;
Perhaps you are not setting things up properly, or expecting
clocks/status to be in some specific state, and the debugger leaves
them in a non-default state?&lt;/p&gt;

&lt;p&gt;
Without a debugger you can still output data via a USART, or
status via GPIO/LED. Where exactly does your code, and flash
programming/erasing sequence fall over?&lt;/p&gt;

&lt;p&gt;
I&amp;#39;d assume you&amp;#39;d at least need to unlock and clear the flash
controllers flags/errors/status before starting.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>