CodeSourcery CS3 interrupt handler override

693 Views Asked by At

I'm trying to replace some CS3 interrupt handlers with mine. Below the part of "ISRs for stellaris_blizzard" file

#if defined (L_stellaris_blizzard_isr_interrupt)
    .globl  __cs3_isr_interrupt
    .type   __cs3_isr_interrupt, %function
__cs3_isr_interrupt:
    b .
    .size   __cs3_isr_interrupt, . - __cs3_isr_interrupt

    .weak   __cs3_isr_reserved_7
    .globl  __cs3_isr_reserved_7
    .set    __cs3_isr_reserved_7, __cs3_isr_interrupt
    ...
    .weak   __cs3_isr_GPIOM
    .globl  __cs3_isr_GPIOM
    .set    __cs3_isr_GPIOM, __cs3_isr_interrupt
    ...
#endif /* interrupt */
...

#if defined (L_stellaris_blizzard_isr_systick)
    .globl  __cs3_isr_systick
    .type   __cs3_isr_systick, %function
__cs3_isr_systick:
    b .
    .size   __cs3_isr_systick, . - __cs3_isr_systick

#endif /* systick */

And my handlers

extern "C" void __cs3_isr_systick() { ... }
extern "C" void __cs3_isr_GPIOM() { ... }

SysTick interrupt works well. But when occurs GPIO interrupt on port M default "__cs3_isr_interrupt" is called. How I can to replace GPIO interrupt handler?

1

There are 1 best solutions below

0
On

It looks likes __cs3_isr_GPIOM is a weak alias for __cs3_isr_interrupt. If you have defined your own version as non-weak there should be no problem.

You should check that the object files have the correct weak/non-weak types that you expect (use nm).

If that doesn't resolve it then you've got a linker problem, and those are harder to figure out. It might be an ordering problem, or just a typo somewhere.