1

I am trying to use C++ application with FreeRTOS. I come to know about this post :- https://sourceforge.net/p/freertos/discussion/382005/thread/5d5201c0 but I am not sure how and where to add this TaskCPP.h file.

Right now I have very simple main.cpp file something like this.

int main(void)
{
//Set priority bits to preempt priority
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
for( ;; );
return 0;
}

And this gives me an error :-

/usr/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/bin/ld: error: STM32F4_FreeRTOS.axf uses VFP register arguments, /usr/bin/../lib/gcc/arm-none-eabi/4.7.4/libgcc.a(unwind-arm.o) does not

/usr/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file /usr/bin/../lib/gcc/arm-none-eabi/4.7.4/libgcc.a(unwind-arm.o)

I am not sure what is wrong with settings.

HallMark
  • 11
  • 2
  • Usually you should start the scheduler in the main function (an operation that never returns). – πάντα ῥεῖ Jan 04 '14 at 13:43
  • Yes, I want to start Scheduler in main function but I am getting error after using NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4); function in main. If I am able to solve this error then I can go further and add Scheduler and TaskCreate functions. – HallMark Jan 04 '14 at 13:46
  • Are you trying to link against a library (or object file), that wasn't compiled for this target? – πάντα ῥεῖ Jan 04 '14 at 13:49
  • If I comment out NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4); function. Code compiles fine. So I think I am missing something which required if I want to use C functions in C++ file? Yes I am using -mfloat-abi=hard so I have added Library :- LIBS = /usr/arm-none-eabi/lib/armv7e-m/fpu/libc_s.a /usr/arm-none-eabi/lib/armv7e-m/fpu/libm.a – HallMark Jan 04 '14 at 13:54

1 Answers1

1

That error is related to your tool chain. Your target triple indicates, a more generic tool chain, but FreeRTOS seems to use more specific ARM features. You may want to read this question: ARM compilation error, VFP registered used by executable, not object file

As workaround: call your compiler with -print-multi-lib and check whether the libraries required by FreeRTOS are available. If they are, you'll have to enable them. If they are not, you'll have to use another tool chain.

Community
  • 1
  • 1
Sebastian
  • 8,046
  • 2
  • 34
  • 58