This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] MSP430FR6989:使用 TI/MSP430-gcc 编译 FreeRTOS Msp430FR5969演示时出现段错误

Guru**** 657930 points
Other Parts Discussed in Thread: MSP430FR6989, MSP430FR5969, MSP430F449
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1070121/msp430fr6989-segmentation-fault-while-compiling-freertos-msp430fr5969-demo-with-ti-msp430-gcc

部件号:MSP430FR6989
《线程》中讨论的其他部件: MSP430FR5969MSP430F449

您好,
我正在尝试让 FreeRTOS 为我的开发板 MSP430FR6989工作。
作为起点,我从 GitHub 下载了最新的 CCS (11.1.0.00011)和最新的 FreeRTOS 代码(1ce4d784c)。

我首先将演示(FreeRTOS/Demo/CMSP430X_MSP430FR5969_LaunchPad_IAR_CCS)加载到 CCS 中。

第一个问题是,我们必须将 ParTest.h 更改为 main.c.中的 partest.h

此后,编译仍失败,并出现以下错误:

Building file: “/home/fhof/FreeRTOS/FreeRTOS/Source/portable/MemMang/heap_4.c”
Invoking: MSP430 Compiler

"/home/fhof/ti/ccs1110/ccs/tools/compiler/ti-cgt-msp430_21.6.0.LTS/bin/cl430" -vmspx --data_model=large -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="/home/fhof/ti/ccs1110/ccs/ccs_base/msp430/include" --include_path="/home/fhof/FreeRTOS/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS" --include_path="/home/fhof/FreeRTOS/FreeRTOS/Source/include" --include_path="/home/fhof/FreeRTOS/FreeRTOS/Source/portable/CCS/MSP430X" --include_path="/home/fhof/FreeRTOS/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI" --include_path="/home/fhof/FreeRTOS/FreeRTOS/Demo/Common/include" --include_path="/home/fhof/ti/ccs1110/ccs/tools/compiler/ti-cgt-msp430_21.6.0.LTS/include" --include_path="/home/fhof/FreeRTOS/FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/driverlib/MSP430FR5xx_6xx" --define=__MSP430FR5969__ -g --c11 --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="FreeRTOS_Source/portable/MemMang/heap_4.d_raw" --obj_directory="FreeRTOS_Source/portable/MemMang"  "/home/fhof/FreeRTOS/FreeRTOS/Source/portable/MemMang/heap_4.c"
FreeRTOS_Source/portable/MemMang/subdir_rules.mk:7: recipe for target 'FreeRTOS_Source/portable/MemMang/heap_4.obj' failed
abnormal termination of /home/fhof/ti/ccs1110/ccs/tools/compiler/ti-cgt-msp430_21.6.0.LTS/bin/cg430
Segmentation fault (core dumped)
gmake: *** [FreeRTOS_Source/portable/MemMang/heap_4.obj] Error 139

The segmentation fault occurs with TI v21.6.0-lts and msp430-gcc v9.3.1.11.

I am on 5.11.0-46-generic #51~20.04.1-Ubuntu if that matters.

如有任何其他建议,我们将不胜感激。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我使用 FreeRTOS 的经验有点陈旧(2015年),但我不记得有任何特殊问题。

    错误消息中没有太多可用于告诉您它在何处发出。 它似乎在处理堆_4.c,因此这是第一个值得关注的地方。 并访问 FreeRTOSConfig.h 以确保其合理性。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    大卫,你好。

    不幸的是,我无法跟踪任何能够帮助解决这一问题的人。  你的状态是什么?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    由于编译器崩溃,您可以尝试遵循 如何提交编译器测试用例

    但是,由于您报告 TI v21.6.0-LTS 和 MSP430-gcc v9.3.1.11都出现了断句错误,因此可能是编译器中没有断句错误的原因。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    正如我所说,我下载 FreeRTOS 已经有一段时间了。 因此,我在最新版本上查看并找到了此注释:“CrossWorks 演示尚未更新为使用 CrossWorks V2.0或更高版本。 GCC 演示尚未更新为使用最新的 MSPGCC 编译器版本。”

    下载内容非常大,但自从我使用了软件以来,我几乎没有使用过。 但我看了一下。 它对 MSP430F449的支持仍然很低。 (FreeRTOS/源/便携式/GCS/MSP430F449)具有低级任务保存/还原代码的文件 port.c 对 CPUx 没有任何线索。 您至少需要使用 pushm/pullm。 例如:

    #ifdef __MSP430_HAS_MSP430XV2_CPU__
    #define portSAVE_CONTEXT()                              \
      asm volatile (                                        \
                    "pushm #12,r15 \n\t"                    \
                    "mov.w  usCriticalNesting, r14  \n\t"   \
                    "push r14 \n\t"                         \
                    "mov.w  pxCurrentTCB, r12 \n\t"         \
                    "mov.w  r1, @r12 \n\t"                  \
                     );
    #else
    
    

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我还偷了一些东西,似乎从最新版本看,这意味着在 TI 接管 mspgcc 项目之前,它还没有更新。

    我还通过编译演示找到了使用它时的第一个 stab。 现在基于 GCC 的演示项目似乎越来越少。 我再次使用“make -B”编译,以确保它编译了所有内容,除了许多 NOP 需要警告之外,它完成的还可以。

    该代码不使用__eint()和__dint()函数,而是使用 ASM("DINT")。 让我知道它的一件事是很久没有更新过。

    哦,演示 makefile 将 RTOS 代码的对象放在 RTOS 目录中。 由于这些设置在某种程度上取决于特定项目设置(FreeRTOSConfig.h),因此对它们来说,这是一个不好的地方。 因此,如果您使用多个目标并使用“make -B”强制重新编译这些文件,请记住这一点。