interrupt style for LPC23xx?

Moderator #1174693
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?
OP #1174694
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
Moderator #1174695
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
Guest #1181842
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

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.