We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
Then remove the definition you don't want to be using? Like the one in stm32f30x_it.c ?
Many people can drive the tool chains they buy, and can port between platforms, your point is?
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
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?
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.
DearKeil,
When using the rtx, is there a way to access the systick handler function built inside the rtx? I need to increase a counter each time systick ticks.
Thanks, Jack
Most processors have quite a number of timers. So it isn't a problem to use another timer to create tick handlers etc - things that should happen outside the domain of the RTOS task switching.
Are you sure you don't mean that your usage of the ST libraries is not compatible with RTX?
Again, you can't take arbitrary, bare-metal code and just dump an RTOS onto it - the code has to be properly designed & structured to work within the chosen RTOS.
In other words, if you want to use the ST libraries with RTX then you have to do it in the way which is compatible with RTX.
The "compiler engineer" is most probably not reading this forum. It's an end-user forum.
Besides - it isn't any "compiler engineer" who should be responsible for trying to get an RTOS implmenentation to be compatible with another company's code framework. The compiler is the program that processes source code. It doesn't care what that source code is actually intended to do.
I use the RTX and ST library on the Discovery board and they work fine together. The article you posted with the fix is the EXACT answer to your issue (as well as the first answer you received from the forum). It tells you how to use the RTX with the ST library. You are not following their explicit instructions. RTX MUST own the SVC, PendSV and SysTick Vectors. You cannot use other code that tries to use them. Some how you suggested that your "vast team of experts" confirmed that you cannot use the RTX with the ST library, yet we continue to do it every day. What are field are these people experts in? Or maybe your team HAS confirmed that YOU cannot use RTX with the ST library (meaning you are not capable of writing working code) That is not a Keil or ST issue. Write your code correctly and you will have no problem using RTX and the ST library on the Discovery board.
Our vast team of experts have confirmed this.
I am underwhelmed with your leet skillz
if your looking for something similar to a tick count why not use the something like the example in the online manuals for rtx e.g.
#include <rtl.h> BOOL init_io (void) { U32 ticks; ticks = os_time_get (); do { process_io (); if (io_ready()) { /* Success, IO initialized. */ return (__TRUE); } } while ((os_time_get () - ticks) < 10); /* Timeout, 10 ticks expired. */ return (__FALSE); }
Hi Danny,
Cheers, at least someone has listening skills.
I want to use the systick handler routine (but it is built into RTX and cannot be accessed by user). Your method is along the lines but it's not an interrupt handler and I might miss ticks.
Is there a function to do that?
Many thanks, Jack