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" 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'...?