<?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>OVERWRITE EXCEPTION HANDLER</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/26775/overwrite-exception-handler</link><description> 
Hello, 

 
I use the NXP LPC 2368 and want to write a function to save the
exceptions Data Abort Error, Undefined Instruction Error and
Pre-fetch Abort Error in a seriel EEPROM and after reset the
CPU. 
How can I overwrite the dummy exception handler</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: OVERWRITE EXCEPTION HANDLER</title><link>https://community.arm.com/thread/139689?ContentTypeID=1</link><pubDate>Wed, 08 Sep 2010 00:34:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:eb2e68e0-7202-4d83-b873-9f77b6ac0951</guid><dc:creator>Dieter Joachim</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hello,&lt;/p&gt;

&lt;p&gt;
thank you very much for the fast help. After I insert a space
before the asm PRESERVE8 everything works fine! I am sorry for my
lack of knowledge.&lt;br /&gt;
So I wrote now Exception Handlers for the PAbt, DAbt and Undef
Instructions.&lt;br /&gt;
I use the RTX OS so I additinal check for the stack overflow and
wrote my own os_stk_overflow function.&lt;br /&gt;
Somebody know further exceptions so I can handle? If no so I thank
again very much for the good help.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OVERWRITE EXCEPTION HANDLER</title><link>https://community.arm.com/thread/136248?ContentTypeID=1</link><pubDate>Mon, 06 Sep 2010 08:33:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f8fe63b8-6273-45f2-87df-92ae0a4e3064</guid><dc:creator>Scott Douglass</dc:creator><description>&lt;p&gt;&lt;p&gt;
Like all directives in asm, the PRESERVE8 needs to have some
whitespace before it. If it starts in column 1 then it&amp;#39;s a label and
not a directive.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OVERWRITE EXCEPTION HANDLER</title><link>https://community.arm.com/thread/126383?ContentTypeID=1</link><pubDate>Mon, 06 Sep 2010 07:25:17 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:06712874-aa64-41d4-908e-0e5dd49ae56c</guid><dc:creator>Dieter Joachim</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thank you very much for the help. The startup assembler is very
hard to understand for me. The solution above works! But now I get a
warning (after the linking process):&lt;br /&gt;
&lt;i&gt;Warning: L6306W: &amp;#39;~PRES8&amp;#39; section lpc2300.o(RESET) should not use
the address of &amp;#39;REQ8&amp;#39; function ProgramAbortHandler.&lt;/i&gt; In the
technical Support I read this: &lt;a href="http://www.keil.com/support/docs/3268.htm"&gt;http://www.keil.com/support/docs/3268.htm&lt;/a&gt;&lt;br /&gt;

So what I did was PRESERVE8 put in the first line of my start up
code. But after i get a compiler error:&lt;br /&gt;
&lt;i&gt;error: A1355U: A Label was found which was in no AREA&lt;/i&gt;&lt;br /&gt;
Now the Joke of the Day: The label is the PRESERVE8 comand! First I
think I wrote wrong. But I copy and paste it of the technical support
document!&lt;/p&gt;

&lt;p&gt;
So the solution of the technical support is not the best way.
Anybody know why there is a linker-warning and how I can solve
it?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OVERWRITE EXCEPTION HANDLER</title><link>https://community.arm.com/thread/115993?ContentTypeID=1</link><pubDate>Thu, 02 Sep 2010 22:59:55 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c3f3f2c8-e0d2-4b62-b9ca-ba098f758a58</guid><dc:creator>Dragi Pandeliev</dc:creator><description>&lt;p&gt;&lt;p&gt;
I write too slowly :)&lt;br /&gt;
And the answer above is better than mine, because I used the name of
my own handler :D&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OVERWRITE EXCEPTION HANDLER</title><link>https://community.arm.com/thread/102271?ContentTypeID=1</link><pubDate>Thu, 02 Sep 2010 22:51:01 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b505dee6-f1a2-4f10-aabe-389a7f46efb2</guid><dc:creator>Dragi Pandeliev</dc:creator><description>&lt;p&gt;&lt;p&gt;
Just add&lt;/p&gt;

&lt;pre&gt;
    IMPORT   IntSPI_isr
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
at the beginning of your startup file and i think that would be it
:)&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OVERWRITE EXCEPTION HANDLER</title><link>https://community.arm.com/thread/104215?ContentTypeID=1</link><pubDate>Thu, 02 Sep 2010 22:48:06 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e2e72031-0ce5-4ff5-a780-0e0e99ddb889</guid><dc:creator>Robert &amp;#160;</dc:creator><description>&lt;p&gt;&lt;p&gt;
Add the following line to the startup before referencing your
function:&lt;/p&gt;

&lt;pre&gt;
        IMPORT ProgramAbortHandler
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OVERWRITE EXCEPTION HANDLER</title><link>https://community.arm.com/thread/78613?ContentTypeID=1</link><pubDate>Thu, 02 Sep 2010 07:11:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f659e94b-7cf2-4fb5-96ba-2d5d58911515</guid><dc:creator>Dieter Joachim</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks for the tip. But now the Compiler Error:&lt;br /&gt;
&amp;quot;system\LPC2300.s(615): error: A1516E: Bad symbol
&amp;#39;ProgramAbortHandler&amp;#39;, not defined or external&amp;quot;&lt;br /&gt;
comes.&lt;/p&gt;

&lt;p&gt;
Here my Code:&lt;br /&gt;
Startup-File&lt;/p&gt;

&lt;pre&gt;
; Exception Vectors
;  Mapped to Address 0.
;  Absolute addressing mode must be used.
;  Dummy Handlers are implemented as infinite loops which can be modified.

Vectors         LDR     PC, Reset_Addr
                LDR     PC, Undef_Addr
                LDR     PC, SWI_Addr
                LDR     PC, PAbt_Addr
                LDR     PC, DAbt_Addr
                NOP                            ; Reserved Vector
;               LDR     PC, IRQ_Addr
                LDR     PC, [PC, #-0x0120]     ; Vector from VicVectAddr
                LDR     PC, FIQ_Addr

Reset_Addr      DCD     Reset_Handler
Undef_Addr      DCD     Undef_Handler
SWI_Addr        DCD     SWI_Handler
PAbt_Addr       DCD     ProgramAbortHandler
DAbt_Addr       DCD     DAbt_Handler
                DCD     0                      ; Reserved Address
IRQ_Addr        DCD     IRQ_Handler
FIQ_Addr        DCD     FIQ_Handler

                                IMPORT  SWI_Handler

Undef_Handler   B       Undef_Handler
;SWI_Handler     B       SWI_Handler
;Don&amp;#39;t need the dummy PAbt handler
;PAbt_Handler    B       PAbt_Handler
DAbt_Handler    B       DAbt_Handler
IRQ_Handler     B       IRQ_Handler
FIQ_Handler     B       FIQ_Handler
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
File irq.c&lt;/p&gt;

&lt;pre&gt;
void ProgramAbortHandler(void) __irq
{
   // For Test
   while(1);
}
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
I think I have to declare the function because it is defined in
another file. How can I do this in Assembler? Thanks&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OVERWRITE EXCEPTION HANDLER</title><link>https://community.arm.com/thread/58622?ContentTypeID=1</link><pubDate>Thu, 02 Sep 2010 05:02:20 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6859bf8c-7c54-4695-b89c-5664da747520</guid><dc:creator>Dragi Pandeliev</dc:creator><description>&lt;p&gt;&lt;p&gt;
If your handler is called ProgramAbortHandler(), then&lt;br /&gt;
in your startup file find&lt;br /&gt;
PAbt_Addr DCD PAbt_Handler&lt;br /&gt;
and replace it with&lt;br /&gt;
PAbt_Addr DCD ProgramAbortHandler&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>