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

*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS

I am using the following code:

// Timer3 IRQ: Executed each 10ms
void T3TIMI_IRQHandler (void) __irq
{

GPIO_BitWrite(GPIO2, 15, ~GPIO_BitRead(GPIO2, 15));

TIM_FlagClear(TIM3, TIM_TO_IT);

EIC->IPR = 1 << T3TIMI_IRQChannel;

}

And I receive the following error:

Build target 'STR7 Eval Board RAM'
assembling Startup.s...
compiling Hello.c...
compiling UART.c...
compiling GPIO.c...
linking...
*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
SYMBOL: GPIO_Config?T
MODULE: C:\Keil\ARM\LIB\ST\STR71x.LIB (gpio)
DEFINED: .\RAM\GPIO.obj (GPIO)
*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
SYMBOL: GPIO_BitWrite?T
MODULE: C:\Keil\ARM\LIB\ST\STR71x.LIB (gpio)
DEFINED: .\RAM\GPIO.obj (GPIO)
*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
SYMBOL: GPIO_ByteWrite?T
MODULE: C:\Keil\ARM\LIB\ST\STR71x.LIB (gpio)
DEFINED: .\RAM\GPIO.obj (GPIO)
*** WARNING L23: UNRESOLVED EXTERNAL SYMBOLS
Program Size: data=2074 const=0 code=242
Target not created

If I put the:

GPIO_BitWrite(GPIO2, 15, ~GPIO_BitRead(GPIO2, 15));

in the main function everything works just fine. If I put it in the ISR I get the above error. Why doesn't it work in an interrupt service routine?

regards,

Erik

  • We need a bit more information about the problem (processor, how is the function defined, ect.). However it looks similar to this:

    http://www.keil.com/support/docs/2929.htm


    Reinhard

  • My evalboard is: MCBSTR7 > STR710F2 microcontroller from ST microelectronics

    my code:



    HELLO.C: Hello World Example

    <

    // Timer3 IRQ: Executed each 10ms

    void T3TIMI_IRQHandler (void) __irq

    {



    GPIO_BitWrite(GPIO2, 15, ~GPIO_BitRead(GPIO2, 15));



    TIM_FlagClear(TIM3, TIM_TO_IT);



    EIC->IPR = 1 << T3TIMI_IRQChannel;





    }>



    <

    // Timer 3 Configuration: Periodic Interrupts at aprox. 10ms

    TIM_Init (TIM3); // Initialization

    TIM_PrescalerConfig (TIM3, 256); // Prescaler

    TIM_ITConfig (TIM3, TIM_TO_IT, ENABLE); // Enable Overflow Interrupt

    TIM_CounterConfig (TIM3,TIM_START); // Start Timer



    // Configure and enable IRQ for Timer 3

    EIC->IVR = (u32)T3TIMI_IRQHandler;

    EIC->SIR[T3TIMI_IRQChannel] = ((u16)T3TIMI_IRQHandler << 16);

    EIC_IRQChannelConfig(T3TIMI_IRQChannel, ENABLE);

    EIC_IRQChannelPriorityConfig(T3TIMI_IRQChannel, 1);

    >





    UART.c







    void UART_ByteSend(UART_TypeDef *UARTx, u8 *Data)
    {
    while (!(UARTx->SR & UART_TxEmpty)); // while the transmit shift register not empty
    UARTx->TxBUFR = *Data;
    }


    GPIO.c






    void GPIO_BitWrite(GPIO_TypeDef *GPIOx, u8 Port_Pin, u8 Port_Val)
    {
    if (Port_Val&0x01)
    GPIOx->PD |= 1<<Port_Pin;
    else
    GPIOx->PD &= ~(1<<Port_Pin);
    }





    Include path is : C:\Keil\ARM\INC\ST



  • I recommend that you directly access the peripherals (which is anyway more efficient than using the software wrappers provided by ST).

    Reinhard