[En-Nut-Discussion] arm expection handler (data abort)

Ole Reinhardt ole.reinhardt at embedded-it.de
Fri Dec 19 13:14:39 CET 2008


Hey all,

This mail ist concerning Ethernut3 / NutOS 4.6.3.

I just implemented a simple exception handler for the data abort
exception like described on:

http://www.ethernut.de/en/documents/arm-exceptions.html

So my code looks like this:

void __data_abort(void) __attribute__ ((naked));
void __data_abort(void)
{
    register u_long *lnk_ptr;

    __asm__ __volatile__ (
        "sub lr, lr, #8\n"
        "mov %0, lr" : "=r" (lnk_ptr)
    );
    /* On data abort exception the LR points to PC+8 */
    printf("Data Abort at %p\n", lnk_ptr);
//    printf("Data Abort at %p 0x%08lX\n", lnk_ptr, *(lnk_ptr));
    for(;;);
}

The exception handler is called correctly on a data abort exception. But
I always get the same / invalid address in the lr register. It's always
0xeafffffa regardless at which point / function my programm generates
such exception. Indeed it's not a correct memory address at all. So when
activating the commented line the exception handler results in an
exception itself.

Has anybody else noticed this behaviour? Any idea what the reason could
be?

Regards,

Ole Reinhardt

-- 
 _____________________________________________________________
|                                                             |
| Embedded-IT          Hard- und Softwarelösungen             |
|                                                             |
| Ole Reinhardt        Tel. / Fax:        +49 (0)271  7420433 |
| Luisenstraße 29      Mobil:             +49 (0)177  7420433 |
| 57076 Siegen         eMail:    ole.reinhardt at embedded-it.de |
| Germany              Web:         http://www.embedded-it.de |
|                      UstID / VAT:       DE198944716         |
|_____________________________________________________________|




More information about the En-Nut-Discussion mailing list