<?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>STM32F030 Read/Write Flash Throwing HardFault</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/33821/stm32f030-read-write-flash-throwing-hardfault</link><description> 
Hello, 

 
I&amp;#39;m trying to read and write data in the flash on the STM32F030R8
Nucleo dev board. I took example firmware straight from ST, but i&amp;#39;m
getting hardfault error whenever I tried to write to flash or read
from flash. I am out of ideas, hopefully</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: STM32F030 Read/Write Flash Throwing HardFault</title><link>https://community.arm.com/thread/83080?ContentTypeID=1</link><pubDate>Sun, 06 Mar 2016 13:37:19 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e3915b83-3e95-4e6a-afc9-97a5b880e046</guid><dc:creator>Jblazer P.</dc:creator><description>&lt;p&gt;&lt;p&gt;
#define FLASH_PAGE 0x08007C00 //Page to flash&lt;/p&gt;

&lt;p&gt;
I removed the flash unlock for reading. Moved flash unlocking to
beginning of the write function.&lt;/p&gt;

&lt;p&gt;
My issue here was that the ROM was mapped over the page I was
trying to flash. I decreased ROM and now its working.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: STM32F030 Read/Write Flash Throwing HardFault</title><link>https://community.arm.com/thread/64563?ContentTypeID=1</link><pubDate>Sun, 06 Mar 2016 08:59:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a67108d1-87d4-48de-88c7-956b2ea430f6</guid><dc:creator>Westonsupermare Pier</dc:creator><description>&lt;p&gt;&lt;p&gt;
And FLASH_PAGE is what?&lt;/p&gt;

&lt;p&gt;
The addresses must be aligned.&lt;br /&gt;
You don&amp;#39;t need to unlock Flash to read.&lt;br /&gt;
You should unlock Flash prior to modifying the controller
registers.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>