<?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>LPC1768 getting a bus fault error</title><link>https://community.arm.com/developer/tools-software/tools/f/armds-forum/1096/lpc1768-getting-a-bus-fault-error</link><description> Note: This was originally posted on 12th November 2012 at http://forums.arm.com Dear Friends, I am trying to use fread. the problem is that a I am getting an&amp;#160; IMPRECISERR hard fault. This is the exact dissembly instruction that&amp;#160; causes hardfault. 0x00006B00</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: LPC1768 getting a bus fault error</title><link>https://community.arm.com/thread/3375?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2013 11:08:19 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:dc73ca18-a0ee-4541-b696-9e47e3046777</guid><dc:creator>Scott Douglass</dc:creator><description>&lt;div&gt;&lt;i&gt;Note: This was originally posted on 13th November 2012 at &lt;a href="http://forums.arm.com"&gt;http://forums.arm.com&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Dear Friends,&lt;br /&gt;I am trying to use fread. the problem is that a I am getting an&amp;#160; IMPRECISERR hard fault. This is the exact dissembly instruction that&amp;#160; causes hardfault.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;0x00006B00 E92D4FFF&amp;#160; PUSH&amp;#160; {r0-r11,lr}&lt;br /&gt;0x00006B04 4606&amp;#160;&amp;#160; MOV&amp;#160;&amp;#160; r6,r0&lt;br /&gt;0x00006B06 468B&amp;#160;&amp;#160; MOV&amp;#160;&amp;#160; r11,r1&lt;br /&gt;0x00006B08 461C&amp;#160;&amp;#160; MOV&amp;#160;&amp;#160; r4,r3&lt;br /&gt;...&lt;br /&gt;0x00006C1E 6060&amp;#160;&amp;#160; STR&amp;#160;&amp;#160; r0,[r4,#0x04]&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The STR instruction is causing the Hardfault.&lt;br /&gt;&lt;br /&gt;The contents of R4 is 0x0000. Adding the offset 0x04, the address 0x0004 corresponds to the on chip flash.&lt;br /&gt;(In case if the address would have pointed out any periphera, i would&amp;#160; have debugged the code related to that peripheral). But i dont&amp;#160; understand how to i debugg the on chip flash.&lt;br /&gt;Kindly advise.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;If that is the disassembly of fread, then r4 is being used to hold the fourth parameter (which is initially in r3) which is the FILE*.&amp;#160; Is there any chance that you&amp;#39;re passing a NULL FILE* to fread?&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1768 getting a bus fault error</title><link>https://community.arm.com/thread/3374?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2013 11:08:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9c06ae00-9330-4875-8fbb-665ceeee1dfe</guid><dc:creator>Kenneth Hass</dc:creator><description>&lt;div&gt;&lt;i&gt;Note: This was originally posted on 12th November 2012 at &lt;a href="http://forums.arm.com"&gt;http://forums.arm.com&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;If I understand what you are saying, the STR instruction is trying to store r0 at address 0x4 in flash. I don&amp;#39;t think you can modify flash memory this way, so it makes sense that you would get a fault.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Dear Friends,&lt;br /&gt;I am trying to use fread. the problem is that a I am getting an&amp;#160; IMPRECISERR hard fault. This is the exact dissembly instruction that&amp;#160; causes hardfault.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;0x00006C1E 6060&amp;#160;&amp;#160; STR&amp;#160;&amp;#160; r0,[r4,#0x04]&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The STR instruction is causing the Hardfault.&lt;br /&gt;&lt;br /&gt;The contents of R4 is 0x0000. Adding the offset 0x04, the address 0x0004 corresponds to the on chip flash.&lt;br /&gt;(In case if the address would have pointed out any periphera, i would&amp;#160; have debugged the code related to that peripheral). But i dont&amp;#160; understand how to i debugg the on chip flash.&lt;br /&gt;Kindly advise.&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>