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

SVC_Handler multiply defined

Dear Keil,

We are using the STM32F3 discovery board, and used the RTX with the demo code.
When we compile, it says SVC_Handler multiply defined; Systick multiply defined etc.

I was wondering if you have met this problem before and know how to solve. Many of us have this problem.

Thanks.
Jack

Parents
  • Thanks for your prompt reply - I really appreciate it.
    I think it's a simple problem but I don't know how to solve it:-

    Story line:-

    1. I bought the stm32f3 discovery board
    2. Opened the Keil demo code, added RTX Kernel in options & added the RTX_Conf_CM.c
    3. I just simply called a task in main() like so:- os_sys_init (task1);
    4. I get the 3 errors on compile time:-

    .\Demo\Demo.axf: Error: L6200E: Symbol SVC_Handler multiply defined (by hal_cm4.o and stm32f30x_it.o).
    .\Demo\Demo.axf: Error: L6200E: Symbol PendSV_Handler multiply defined (by hal_cm4.o and stm32f30x_it.o).
    .\Demo\Demo.axf: Error: L6200E: Symbol SysTick_Handler multiply defined (by hal_cm4.o and stm32f30x_it.o).

    5. If I comment out the above 3 handler functions in stm32f30x_it.c and run the code, the ARM runs to void HardFault_Handler(void) and gets stuck there.

    6. I suspect the reason is because I commented out this crucial function (as mentioned above):-
    /*void SysTick_Handler(void)
    { TimingDelay_Decrement(); USBConnectTimeOut--; DataReady ++;
    }*/

    As you can see there is a timing delay and other stuff inside the Systick_handler which is used in the demo code.
    What can I do comment out the Systick_Handler and yet retain the 3 lines of code?
    (I suspect there is another Systick_handler built into the RTOS which is conflicting with this one).

    Many thanks for your help.
    Jack

Reply
  • Thanks for your prompt reply - I really appreciate it.
    I think it's a simple problem but I don't know how to solve it:-

    Story line:-

    1. I bought the stm32f3 discovery board
    2. Opened the Keil demo code, added RTX Kernel in options & added the RTX_Conf_CM.c
    3. I just simply called a task in main() like so:- os_sys_init (task1);
    4. I get the 3 errors on compile time:-

    .\Demo\Demo.axf: Error: L6200E: Symbol SVC_Handler multiply defined (by hal_cm4.o and stm32f30x_it.o).
    .\Demo\Demo.axf: Error: L6200E: Symbol PendSV_Handler multiply defined (by hal_cm4.o and stm32f30x_it.o).
    .\Demo\Demo.axf: Error: L6200E: Symbol SysTick_Handler multiply defined (by hal_cm4.o and stm32f30x_it.o).

    5. If I comment out the above 3 handler functions in stm32f30x_it.c and run the code, the ARM runs to void HardFault_Handler(void) and gets stuck there.

    6. I suspect the reason is because I commented out this crucial function (as mentioned above):-
    /*void SysTick_Handler(void)
    { TimingDelay_Decrement(); USBConnectTimeOut--; DataReady ++;
    }*/

    As you can see there is a timing delay and other stuff inside the Systick_handler which is used in the demo code.
    What can I do comment out the Systick_Handler and yet retain the 3 lines of code?
    (I suspect there is another Systick_handler built into the RTOS which is conflicting with this one).

    Many thanks for your help.
    Jack

Children
  • So you added stuff, and then you started getting duplicate symbol errors - what does that tell you...?

  • Hi Andrew,

    But my additions were the most basics of the Keil RTX.
    That just tells me that Keil RTX has internal functions that conflicts with user code.

    I was hoping for a solution but seems like a dead end.
    I even tried switching to timer-based-RTX instead of using systick but exactly the same problem occurs.

    The only way out is to go back to interrupts-coding without Keil RTX ?

    Please note that the demo code functions are crucial for my development so I need to give the STM32 libraries priority of use so I cannot start coding using a blank template from scratch.

    Best regards,
    Jack

  • You can't just dump an RTOS onto any arbitrary piece of code and expect it to "just work".

    You need to understand the requirements of the RTOS, and ensure that your code is structured suitably.

    "the demo code functions are crucial for my development"

    What "demo code"?

    "only way out is to go back to interrupts-coding without Keil RTX ?"

    Is that a problem?

    Why did you want to use RTX anyhow?

  • Hi Andrew,

    Apologies for the confusions. Would like to clarify:-

    The demo code I am using is the one provided for stm32F3 discovery board.
    It's supposed to work hand in hand with Keil - it does compile but not when you include a RTX in it. Quite surprizing for 2 big partnership companies.

    The main requirement for the Keil RTOS for stm32f3 is the systick timer.
    The funny thing is, systick is taken up (or stolen) by the demo code itself which initializes it and uses it for all sorts of stuff including USB interface.

    So, there is a conflict - i.e. you can't use stm32 demo code (i.e. standard peripheral drivers) with Keil RTX. That's bum.

    Thanks anyway - I wonder if Keil knows about this, I bet they're too busy.

    Best regards,
    Jack
    (from your message I know you don't know the answer anyway - but thanks for your passion to help others, it's nice)

  • It's 'C' source code for an ARM Target; Keil provides 'C' tools for ARM targets.

    "it does compile but not when you include a RTX in it. Quite surprizing for 2 big partnership companies"

    Not at all!

    It's provided as "bare-metal" code; it is not designed for use with an RTOS; it makes no claim to do so.

    "The main requirement for the Keil RTOS for stm32f3 is the systick timer"

    Eh??!!

    There is no need to go to the lengths of an RTOS just to use a timer!!

    As the demo itself illustrates, the SysTick timer is perfectly usable without any RTOS!

    "The funny thing is, systick is taken up (or stolen) by the demo code itself"

    Why is that funny?!

    The demo is demonstrating the use of the chip's features - including the SysTick timer.