EmbDev.net

Forum: ARM programming with GCC/GNU tools interrupt style for LPC23xx?


von Raed A. (raedbenz)


Rate this post
useful
not useful
hi which is the correct form for interrupt?

void irqhandler (void)__irq  or
void IRQ_Routine (void)   _attribute_ ((interrupt("IRQ")));


could u clarify the meaning of 2nd style argumemnts??
thakns

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Raed Abu-sanad wrote:
>hi which is the correct form for interrupt?
depends

> void irqhandler (void)__irq  or
This can either be a vendor-specific extension (i.e. RV, EWAVR,...) or a
macro.

> void IRQ_Routine (void)   _attribute_ ((interrupt("IRQ")));
This is the GNU attribute for IRQ "interrupts". So if you use a GNU
toolchain (arm-*-gcc) this one can be used but I suggest to use an
assembler wrapper instead to avoid compiler-dependencies in the C code.

Which compiler/toolchain is in use?

von Raed A. (raedbenz)


Rate this post
useful
not useful
Martin Thomas wrote:
> Raed Abu-sanad wrote:
>>hi which is the correct form for interrupt?
> depends
>
>> void irqhandler (void)__irq  or
> This can either be a vendor-specific extension (i.e. RV, EWAVR,...) or a
> macro.
>
>> void IRQ_Routine (void)   _attribute_ ((interrupt("IRQ")));
> This is the GNU attribute for IRQ "interrupts". So if you use a GNU
> toolchain (arm-*-gcc) this one can be used but I suggest to use an
> assembler wrapper instead to avoid compiler-dependencies in the C code.
>
> Which compiler/toolchain is in use?

hi,
thanks for the reply,,,
i am using Eclipse with Yagarto toolchain, and the IRQs are defined with
2nd style, but i havent managed yet to run them. on the other hand in
WinARM there are examples that they use the 1st style although uses GNU
toolchain.
do u know where can i get examples for eclipse/yagart for LPC23xx ??
thanks

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Raed Abu-sanad wrote:
> Martin Thomas wrote:
>> Raed Abu-sanad wrote:
>>>hi which is the correct form for interrupt?
>> depends
>>
>>> void irqhandler (void)__irq  or
>> This can either be a vendor-specific extension (i.e. RV, EWAVR,...) or a
>> macro.
>>
>>> void IRQ_Routine (void)   _attribute_ ((interrupt("IRQ")));
>> This is the GNU attribute for IRQ "interrupts". So if you use a GNU
>> toolchain (arm-*-gcc) this one can be used but I suggest to use an
>> assembler wrapper instead to avoid compiler-dependencies in the C code.
>>
>> Which compiler/toolchain is in use?
>
> hi,
> thanks for the reply,,,
> i am using Eclipse with Yagarto toolchain, and the IRQs are defined with
> 2nd style, but i havent managed yet to run them.
This should work in most cases. Verify that you do not mix code that
uses a wrapper with code that uses IRQ attributes.

> on the other hand in
> WinARM there are examples that they use the 1st style although uses GNU
> toolchain.
In some of my examples I heavily re-used code which has been made for
another toolset. Please search the mentioned examples for #define __irq,
you should find it and defined as empty. So in this examples void
irqhandler (void)__irq is the same as void irqhandler (void). Since
"irqhandler" is a "normal" c-function without any attributes the example
should include a assembler-wrapper, search the .S-files of the project
for it.

> do u know where can i get examples for eclipse/yagart for LPC23xx ??
> thanks

von Raed A. (raedbenz)


Attached files:

Rate this post
useful
not useful
Hi ,,
still cant run the interupt of timer 0.
could plz have a look to my code (attached) and give me your opinion??

thanks

von Klata (Guest)


Rate this post
useful
not useful
You must unlock interrupt in file crt.s

is:
    sub   r0, r0, #SVC_STACK_SIZE
        msr   CPSR_c, #MODE_SYS|I_BIT|F_BIT   /* User Mode */
        mov   sp, r0

should be:
    sub   r0, r0, #SVC_STACK_SIZE
        msr   CPSR_c, #MODE_SYS|F_BIT   /* User Mode */
        mov   sp, r0

von raedbenz (Guest)


Rate this post
useful
not useful
hi,,
thanx for the reply..but still doesnt work..

cheers

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.