install dara abort ISR

Hello again,

I'm working with the AT91RM9200 controller. How is it possible to get a printf() message over the usart1 if a dara abort or undefined instruction has occured?

I've one .c file with all ISR; for example:

void AT91F_DataAbort()
{
        printf("Data Abort detected\n");
        while (1);
}

and the void AT91F_LowLevelInit() function.

But which changes I have to made in the startup code file to run this function is a data abort occured?

IS it something like that (I've found in the www)

IMPORT AT91F_LowLevelInit

                                ldr r1, = AT91_SVC_Stack_Begin
                                bic r1, r1, #3 ; Insure word alignement
                                mov sp, r1 ; Init stack SYS

                                ldr r0, = AT91F_LowLevelInit
                                mov lr, pc
                                bx r0


; Setup Stack for each mode

                LDR     R0, =Stack_Top

Maybe someone of you could give me a example, where I could see the changes in the startup code.

best regards
Johannes

Parents
  • How is it possible to get a printf() message over the usart1 if a dara abort or undefined instruction has occured?

    printf() is just about the last function you should even think of calling from an ISR. Roughly said, anything beyond a simple putc() or two would be madness.

    Catastrophic exceptions like those have to be avoided, not decorated.

Reply
  • How is it possible to get a printf() message over the usart1 if a dara abort or undefined instruction has occured?

    printf() is just about the last function you should even think of calling from an ISR. Roughly said, anything beyond a simple putc() or two would be madness.

    Catastrophic exceptions like those have to be avoided, not decorated.

Children
More questions in this forum