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

Timothy M. De Baillie debaillie at ciholas.com
Fri Dec 19 17:23:53 CET 2008


Ole,

I had a similar problem.  I couldn't get the printf or a fputs to work.  
I ended up saving the data in high memory, rebooting, and then reading 
the data out of high memory in the main program.  Works like a charm.

Tim

Ole Reinhardt wrote:
> Hey all,
>
> Sorry for the resend, but my last mail seems to be delayed again...
> There's still some problem with the mail configuration around here....
>
> 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
>
>   


-- 
Tim DeBaillie
Ciholas Technologies
debaillie at ciholas.com
812.962.9402
www.ciholas.com 




More information about the En-Nut-Discussion mailing list