gpt4 book ai didi

c++ - 带有 C++ 主文件的 FreeRTOS

转载 作者:太空宇宙 更新时间:2023-11-04 11:42:17 25 4
gpt4 key购买 nike

我正在尝试将 C++ 应用程序与 FreeRTOS 结合使用。我开始了解这篇文章:- https://sourceforge.net/p/freertos/discussion/382005/thread/5d5201c0但我不确定如何以及在何处添加此 TaskCPP.h 文件。

现在我有一个非常简单的 main.cpp 文件,就像这样。

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

这给了我一个错误:-

/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)

我不确定设置有什么问题。

最佳答案

该错误与您的工具链有关。您的目标三元组表明,一个更通用的工具链,但 FreeRTOS 似乎使用更具体的 ARM 功能。您可能想阅读这个问题:ARM compilation error, VFP registered used by executable, not object file

解决方法:使用 -print-multi-lib 调用您的编译器并检查 FreeRTOS 所需的库是否可用。如果是,则必须启用它们。如果不是,您将不得不使用另一个工具链。

关于c++ - 带有 C++ 主文件的 FreeRTOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20921721/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com