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.

[参考译文] MSP430FR4133:ETL CPP 库 (ETL::bitset) 的编译问题

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1609895/msp430fr4133-compilation-issue-with-etl-cpp-library-etl-bitset

器件型号: MSP430FR4133

您好:

我正在使用 ETL CPP 库 (https://www.etlcpp.com/home.html)、特别是`ETL::bitset` (https://www.etlcpp.com/bitset.html)。

在编译代码时、我从编译器收到以下错误:

[0]**** Build of configuration 'Debug' for project 'Thermometer' ****

[1]"C:\\ti\\ccs2031\\ccs\\utils\\bin\\gmake" -k -j 16 all -O

[2]Building file: "C:/Projects/Thermometer/src/targets/msp430/hal_button_msp430.cpp"
[3]Invoking: MSP430 Compiler
[4]"C:/ti/ccs2031/ccs/tools/compiler/ti-cgt-msp430_21.6.1.LTS/bin/cl430" -vmspx --use_hw_mpy=none --include_path="C:/Projects/Thermometer/src/" --include_path="C:/Projects/Thermometer/src/app" --include_path="C:/Projects/Thermometer/src/lib/etl/include" --include_path="C:/ti/ccs2031/ccs/ccs_base/msp430/include" --include_path="C:/Projects/Thermometer/src/targets/msp430/CCS-Workspace/Thermometer" --include_path="C:/Projects/Thermometer/src/targets/msp430/CCS-Workspace/Thermometer/driverlib/MSP430FR2xx_4xx" --include_path="C:/ti/ccs2031/ccs/tools/compiler/ti-cgt-msp430_21.6.1.LTS/include" --advice:power="none" --advice:hw_config=all --define=__MSP430FR4133__ --define=DEPRECATED -g --printf_support=minimal --preproc_with_comment --preproc_with_compile --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --obj_directory="Hal"  "C:/Projects/Thermometer/src/targets/msp430/hal_button_msp430.cpp"

[5]INTERNAL ERROR: C:\ti\ccs2031\ccs\tools\compiler\ti-cgt-msp430_21.6.1.LTS\bin\acpia430.exe experienced a segmentation fault
[6]                  while processing function (unknown or file scope) file C:\Projects\Thermometer\src\lib\etl\include\etl\private/bitset_new.h line 1874

[7]This is caused by a defect in the TI EABI C/C++ Parser.
[8]TI Customer Support may be able to suggest a workaround to avoid this.

[9]Upgrading to the newest version of the compiler may fix this problem.

[10]Contact TI in the E2E support forums at http://e2e.ti.com under
[11]"Development Tools", "TI C/C++ Compiler".  See the link titled
[12]"Submitting an issue".

[13]We need to see this ENTIRE error message and a complete, reproducible
[14]test case including ALL of the command-line options.
[15]Include the .pp file created by option --preproc_with_comment

这是.pp 文件、以.txt 的扩展名保存、因为我无法上传它: hal_button_msp430.txt 

如何解决此问题?

感谢您的帮助!
谢谢
Emile

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

    感谢您的测试用例。  我可以重现该行为。   

    我的第一个猜测是当您获得 ETL CPP 库时出现了问题。  直接相关 bitset_new.h 似乎过早结束许多行。  在执行任何其他操作之前、请先查看这一可能的问题。

    谢谢。此致、

    -乔治

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

    您好、George、感谢您的回答。

    在同一存储库中在 Windows (MSVC) 上运行的单元测试中、我没有收到编译错误 #include "etl/bitset.h"。 因此、我不认为结账 ETL 库是问题。

    你有其他想法吗?
    此致、

    Emile

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    这是.pp 文件、用扩展名.txt 保存、因为我无法上传它、否则: hal_button_msp430.txt
     

    以下是该文件的最后几行...

      namespace private_bitset
      {
        //***************************************************************************
        template <size_t Active_Bits, typename TElement>
        class bitset_common : public etl::private_bitset::bitset_impl_common<TElement>
        {
        public:
    
          // MANY LINES OMITTED
    
          static constexpr TElement Top_Mask = element_type(Top_Mask_Shift == 0 ? All_Set_Element : ~(All_Set_Element << Top_Mask_Shift));

    这两个支架没有闭合支架。  显然缺少线条。  可能缺少许多线路。  构建此文件时、我会看到相同的结果 INTERNAL ERROR 您在第一个帖子中显示。  只是我看不到对文件的引用  C:src \projects\Thermometer\Thermome\lib\ETL\include\ETL\private/bitset_new.h 。  这就是为什么我认为问题是因为这个文件(不 bitset.h ) 缺少行。

    谢谢。此致、

    -乔治

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

    我不明白的是编译器错误会调用特定文件的特定行。 转储超过 82K 行的代码、而不是参考这些代码。 希望其他人在这种黑堆中找到针头。

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

    pp 文件的最后一行 对应于bitset_new.h文件中编译器失败的行(参见错误消息:指示第 1874 行)。 但签出的文件继续,这里是bitset_new.h在 notepad++中打开的文件的屏幕截图:

    预处理器是否可能不复制整个文件? 编译器失败似乎是我提供给您的文本文件中缺少行的原因。

    顺便说一下、我自己不包含 bitset_new.h、它包含在 bitset.h 中。:

    谢谢、
    Emile

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

    推进问题的唯一方法是让我有一个可以重现问题的测试案例。  这似乎是一种罕见的情况、即预处理的文件不足以用于测试用例。   

    请尝试切割  hal_button_msp430.cpp 下降到仅取决于 ETL 的程度。  请注意、只需构建代码。  它不需要运行。  确保仍然出现分段故障。  然后将该文件发送给我。  还显示用于获取 ETL 的确切命令。  这应该足以让我重现问题、然后进行调查。

    谢谢。此致、

    乔治