Re: arm-elf-gcc building erroneous code for ISR (long posting)

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
You can download a newer (actually two: 3.3.1 and 3.4.0) GCC from my
webpage. I'm not a GCC expert, but I know they've fixed a serious ARM bugs
in their IRQ handling around 3.3.0. You might be hitting it.

--
Regards,
Andras Tantos
We've slightly trimmed the long signature. Click to see the full one.
Re: arm-elf-gcc building erroneous code for ISR (long posting)
You can download a newer (actually two: 3.3.1 and 3.4.0) GCC from my
webpage. I know they've fixed a serious ARM bugs in their IRQ handling
around 3.3.0. You might be hitting it.

--
Regards,
Andras Tantos
We've slightly trimmed the long signature. Click to see the full one.
Re: arm-elf-gcc building erroneous code for ISR (long posting)

Quoted text here. Click to load it
Hi Andras,

I already suspected such a bug but wanted to make sure that a new gcc version
would solve my problem before downloading and installing the new tools. BTW: the
link to your page gets me a "403: Forbidden" error.
Anyway, thanks for the reply,
Jens

Re: arm-elf-gcc building erroneous code for ISR (long posting)
Quoted text here. Click to load it
blinky_irq
the
3.13.1
able to
interrupts)
Quoted text here. Click to load it
script
LPC2106)
Quoted text here. Click to load it
program
on
stopped
some time
the
time the
compiler I
know
the
[snip]

using arm-elf-gcc 3.3.1 I don't have this problem. Not that the interrupt
attribute needs to specify the type of interrupt ("IRQ", "FIQ","SWI" etc).

void __attribute__((interrupt("IRQ"))) SYS_10ms_irq_handler(void)
{
    TIMER2->status = 4; // clear timer int
    VIC->VectAddr = 0;  // clear VIC
    tick_count++;
}

arm-elf-gcc -S -O -DUVDAS -mcpu=arm7tdmi sys_irq.c

SYS_10ms_irq_handler:
 @ Interrupt Service Routine.
 @ args = 0, pretend = 0, frame = 0
 @ frame_needed = 0, uses_anonymous_args = 0
 @ link register save eliminated.
 stmfd sp!, {r2, r3}
 @ lr needed for prologue
 mvn r3, #244736
 sub r3, r3, #940
 sub r3, r3, #3
 mov r2, #4
 str r2, [r3, #8]
 mov r3, #-2147483648
 mov r3, r3, asr #19
 mov r2, #0
 str r2, [r3, #48]
 ldr r2, .L3
 ldr r3, [r2, #0]
 add r3, r3, #1
 str r3, [r2, #0]
 ldmfd sp!, {r2, r3}
 subs pc, lr, #4
.L4:
 .align 2
.L3:
 .word tick_count

this include the correct subs pc,lr,#4 that performs a return from interrupt
(swapping back to old stack).

regards
Peter



Site Timeline