This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to read an assembler pointer in C (ARM)?

Hi all,

how can I get address (dOffset) of an assembler variable (T0TIMIIRQHandler) in C program?

asm startup.s -----------------
// Peripherals IRQ Handlers Address Table
PUBLIC T0TIMI_Addr
PUBLIC IRQ_Vectors

IRQ_Vectors:
T0TIMI_Addr: DD T0TIMIIRQHandler
FLASH_Addr:  DD FLASHIRQHandler

void EIC_Init(void)
{
extern u32 T0TIMI_Addr;

u32 dOffset=((u32)&T0TIMI_Addr); <<<<< link error here
...
...
}

The linker say:
ERROR L102 EXTERNAL ATTRIBUTE MISMATCH
SYMBOL T0TIMI_Addr

How can I do that?
I am using STR711 ARM with Keil IDE.

Thanks in advance!
Regards
Paul

  • "The linker say:
    ERROR L102 EXTERNAL ATTRIBUTE MISMATCH"


    So you need to make the attributes match!

    Basically, you need to ensure that the assembler definition and the 'C' declaration have precisely the same type.

    Ask yourself: what is the type of the symbols T0TIMI_Addr and FLASH_Addr defined in your assembler?
    And is this type the same as a u32 in 'C'...?