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: Compilation issue with etl cpp library (etl::bitset)

Part Number: MSP430FR4133

Hello,

I am using the etl cpp library (https://www.etlcpp.com/home.html), specifically `etl::bitset`  (https://www.etlcpp.com/bitset.html).

When I am compiling my code, I get the following error from the compiler:

[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

Here is the .pp file, saved with extension .txt because I could not upload it otherwise: hal_button_msp430.txt 

How can I work around this issue?

Thanks for the help!
Cheers
Emile

  • Thank you for the test case.  I can reproduce the behavior.  

    My first guess is that something went wrong when you obtained the etl cpp library.  The file bitset_new.h appears to end many lines too early.  Before doing anything else, please look into this possible problem.

    Thanks and regards,

    -George

  • Hi George, thanks for the answer.

    In my unit tests running on Windows (MSVC) in the same repo, I get no compilation error when #include "etl/bitset.h". So I do not think that the checkout of the etl library is the problem.

    Do you have any other idea?
    Regards,

    Emile

  • Here is the .pp file, saved with extension .txt because I could not upload it otherwise: hal_button_msp430.txt 

    Here are the final lines from that file ...

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

    Those two braces have no closing brace.  It is clear there are missing lines.  Probably many missing lines.  When I build this file, I see the same INTERNAL ERROR you show in the first post.  Except I don't see a reference to the file C:\Projects\Thermometer\src\lib\etl\include\etl\private/bitset_new.h .  That is why I think the problem is because this file (not bitset.h) is missing lines.

    Thanks and regards,

    -George

  • The thing that I don't understand is that the compiler error calls out a specific line of a specific file. Instead of referring to that, more than 82K lines of code are dumped. Expecting someone else to find the needle in that haystack.

  • The last line of the pp file corresponds to the line in the bitset_new.h file where the compiler fails (see error message: indicates line 1874). But the checked out file continues, here a screenshot of the bitset_new.h file open in notepad++:

    Is it possible that the pre-processor does not copy the entire file? It seems like the compiler's failure is the cause of the missing lines in the text file I provided you.

    BTW, I do not include bitset_new.h myself, it is included by bitset.h.:

    Cheers,
    Emile

  • The only way to advance the issue is for me to have a test case which allows me to reproduce it.  This appears to be a rare case where a preprocessed file is not good enough for a test case.  

    Please try to cut hal_button_msp430.cpp down to a point where it only depends on the ETL.  Note the code only has to build.  It does not need to run.  Be sure the segmentation fault still occurs.  Then send me that file.  Also show the exact command you use to obtain the ETL.  That should be enough for me reproduce the problem, and then investigate it.

    Thanks and regards,

    George

**Attention** This is a public forum