EmbDev.net

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


Author: Raed Abusanad (raedbenz)
Posted on:

Rate this post
0 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

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 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?

Author: Raed Abusanad (raedbenz)
Posted on:

Rate this post
0 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

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 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

Author: Raed Abusanad (raedbenz)
Posted on:
Attached files:

Rate this post
0 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

Author: Klata (Guest)
Posted on:

Rate this post
0 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

Author: raedbenz (Guest)
Posted on:

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

cheers

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.