<?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>LPC1788 - Degguger starts at HardFault_Handler</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/27469/lpc1788---degguger-starts-at-hardfault_handler</link><description> 
Hello, 

 
I have a problem that I&amp;#39;m hoping someone might be able to give me
pointers on how to debug. 

 
I have the simplest firmware possible (blink and LED in a while(1)
and this firmware works as expected on an EA development kit for the
LPC1788</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: LPC1788 - Degguger starts at HardFault_Handler</title><link>https://community.arm.com/thread/140025?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2011 18:57:06 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8a23350f-8576-4523-b897-bcc4039dc884</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;p&gt;
I noticed this:&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.keil.com/dd/chip/5325.htm"&gt;http://www.keil.com/dd/chip/5325.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
NXP (founded by Philips) LPC1788&lt;/p&gt;

&lt;p&gt;
NOTE&lt;br /&gt;
Simulation for this device is provided by the default peripheral
simulation driver.&lt;br /&gt;
Complete peripheral simulation is not available at this time.&lt;/p&gt;

&lt;p&gt;
The following on-chip peripherals are not simulated.&lt;br /&gt;
Flash Memory&lt;br /&gt;
I2C Interface&lt;br /&gt;
Memory Accelerator Module&lt;br /&gt;
Memory Mapping Control&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1788 - Degguger starts at HardFault_Handler</title><link>https://community.arm.com/thread/136572?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2011 18:52:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6249e8d7-1cb3-431f-adb5-b8a9047b11ea</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;b&gt;What should I be checking for on the NMI pin?&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
I am software engineer, my intention is to insure that, hardware
does not generate a NMI.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1788 - Degguger starts at HardFault_Handler</title><link>https://community.arm.com/thread/127031?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2011 18:47:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b97a07b9-e84a-4b87-b784-bc5330414154</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;How/Where would I set the FAULTMASK to 1? In an initialization
file?&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
I am not familiar with the debug-ini-file, sorry.&lt;/p&gt;

&lt;p&gt;
I assume that, the simplest firmware does not work on your custom
LPC1788 board.&lt;br /&gt;
If so, use Assembly or Inline/Embedded Assembly to set the FAULTMASK
to 1, and test it with your custom LPC1788 board.&lt;/p&gt;

&lt;p&gt;
My knowledge on the related topic &lt;b&gt;is very limited&lt;/b&gt;. My idea
may NOT be good.&lt;/p&gt;

&lt;p&gt;
Sometimes, the debugger can NOT set the processor status properly
at the correct timing, some NOP may give the debugger enough time to
talk to the processor.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1788 - Degguger starts at HardFault_Handler</title><link>https://community.arm.com/thread/119425?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2011 18:36:57 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:063022a6-9ea8-4d3c-b1e9-1e05c4b57712</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;pre&gt;
To access the PRIMASK, FAULTMASK, and BASEPRI registers, the MRS and MSR
instructions are used. For example:
  MRS r0, BASEPRI ; Read BASEPRI register into R0
  MRS r0, PRIMASK ; Read PRIMASK register into R0
  MRS r0, FAULTMASK ; Read FAULTMASK register into R0
  MSR BASEPRI, r0 ; Write R0 into BASEPRI register
  MSR PRIMASK, r0 ; Write R0 into PRIMASK register
  MSR FAULTMASK, r0 ; Write R0 into FAULTMASK register
  The PRIMASK, FAULTMASK, and BASEPRI registers cannot be set in the user access level.
&lt;/pre&gt;

&lt;p&gt;
Another method &amp;#39;CPS&amp;#39; instruction: (rock.song)&lt;/p&gt;

&lt;pre&gt;
CPSID I ;PRIMASK=1
CPSIE I ;PRIMASK=0
CPSID F ;FAULTMASK=1
CPSIE F ;FAULTMASK=0
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1788 - Degguger starts at HardFault_Handler</title><link>https://community.arm.com/thread/105162?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2011 18:30:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:01587b50-2305-49f4-8b51-022462d0dfbb</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;The Definitive Guide to the ARM Cortex-M3&lt;br /&gt;
Joseph Yiu&lt;/i&gt;&lt;/p&gt;

&lt;pre&gt;
&lt;i&gt;
Exception Type | Priority
  Reset        | -3 (Highest)
  NMI          | -2
  Hard fault   | -1
&lt;/i&gt;
&lt;/pre&gt;

&lt;p&gt;
&lt;i&gt;&lt;b&gt;FAULTMASK&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;A 1-bit register. &lt;b&gt;When this is set, it allows only the
NMI&lt;/b&gt;, and all interrupts and fault&lt;br /&gt;
handling exceptions are disabled. The default value is 0, which means
that no masking&lt;br /&gt;
is set.&lt;/i&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1788 - Degguger starts at HardFault_Handler</title><link>https://community.arm.com/thread/79475?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2011 10:56:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e4a98c5a-acd7-4290-a7e2-7c3447384ccf</guid><dc:creator>@Marc Crandall</dc:creator><description>&lt;p&gt;&lt;p&gt;
What should I be checking for on the NMI pin?&lt;br /&gt;
For the RESET and NMI pins I have them pulled high with the ISP able
to pull them LOW for use with FlashMagic or the like...&lt;/p&gt;

&lt;p&gt;
Also the NOP at the beginning did not change anything. It never
even reaches the NOPs&lt;/p&gt;

&lt;p&gt;
Still at a loss...&lt;/p&gt;

&lt;p&gt;
M&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1788 - Degguger starts at HardFault_Handler</title><link>https://community.arm.com/thread/79474?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2011 07:02:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:45ba392b-d779-405a-8efd-1cbf7efe5fb0</guid><dc:creator>@Marc Crandall</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi John,&lt;/p&gt;

&lt;p&gt;
Thanks.&lt;/p&gt;

&lt;p&gt;
How/Where would I set the FAULTMASK to 1? In an initialization
file? Because as soon as the debugger starts the PC goes to the
HardFault_Handler address.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1788 - Degguger starts at HardFault_Handler</title><link>https://community.arm.com/thread/59700?ContentTypeID=1</link><pubDate>Wed, 03 Aug 2011 18:03:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8bd99db4-7242-42e1-872b-3be0d4c6a74e</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;p&gt;
Maybe:&lt;/p&gt;

&lt;p&gt;
check NMI pin;&lt;br /&gt;
set FAULTMASK to 1;&lt;br /&gt;
put some NOP at the beginning;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>