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.

CCS/TM4C123GH6PM: building with Misra checks issue

Part Number: TM4C123GH6PM

Tool/software: Code Composer Studio

Hello all, 

I am working on my graduation project. I use tm4c123, CCS, and TivaWare library. 

the problem is that i can build and run the project properly without Misra checking. 

once i configure the compiler option to check the misra rules and try to build the project or sum files of it. Then i have gmake error  and the build process doesn't complete 

how to fix that ? 

Regards, 

Sarea 

  • sarea hariri said:
    once i configure the compiler option to check the misra rules and try to build the project or sum files of it. Then i have gmake error  and the build process doesn't complete 

    Could you please save off the build log to a text file, for both the case where the build completes fine without Misra checks enabled and the case where it fails with Misra checks enabled? You can save the build log as described here. Then attach both files here for us to look at. Thanks!

  • AartiG,

    Thanks  for your response.

    Here is the files.

    buildLogMisraOn.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    **** Build of configuration Debug for project AutosarCanStack ****
    "C:\\ti\\ccsv8\\utils\\bin\\gmake" -k -j 8 all -O
    Building file: "../InitConsole.c"
    Invoking: ARM Compiler
    "C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --include_path="C:/Users/visitor/Documents/CODECOMPOSER 8/AutosarCanStack" --include_path="C:/ti/TivaWare_C_Series-2.1.4.178" --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/include" --define=ccs="ccs" --define=PART_TM4C123GH6PM -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --check_misra="required" --preproc_with_compile --preproc_dependency="InitConsole.d_raw" "../InitConsole.c"
    >> Compilation failure
    subdir_rules.mk:9: recipe for target 'InitConsole.obj' failed
    Command-line error #1046: invalid macro definition: ccs=ccs
    1 catastrophic error detected in the compilation of "../InitConsole.c".
    Compilation terminated.
    gmake: *** [InitConsole.obj] Error 1
    Building file: "../main.c"
    Invoking: ARM Compiler
    "C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --include_path="C:/Users/visitor/Documents/CODECOMPOSER 8/AutosarCanStack" --include_path="C:/ti/TivaWare_C_Series-2.1.4.178" --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/include" --define=ccs="ccs" --define=PART_TM4C123GH6PM -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --check_misra="required" --preproc_with_compile --preproc_dependency="main.d_raw" "../main.c"
    >> Compilation failure
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    buildLogMisraOff.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    **** Build of configuration Debug for project AutosarCanStack ****
    "C:\\ti\\ccsv8\\utils\\bin\\gmake" -k -j 8 all -O
    Building file: "../tm4c123gh6pm_startup_ccs.c"
    Invoking: ARM Compiler
    "C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --include_path="C:/Users/visitor/Documents/CODECOMPOSER 8/AutosarCanStack" --include_path="C:/ti/TivaWare_C_Series-2.1.4.178" --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/include" --define=ccs="ccs" --define=PART_TM4C123GH6PM -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="tm4c123gh6pm_startup_ccs.d_raw" "../tm4c123gh6pm_startup_ccs.c"
    Finished building: "../tm4c123gh6pm_startup_ccs.c"
    Building file: "../InitConsole.c"
    Invoking: ARM Compiler
    "C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --include_path="C:/Users/visitor/Documents/CODECOMPOSER 8/AutosarCanStack" --include_path="C:/ti/TivaWare_C_Series-2.1.4.178" --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/include" --define=ccs="ccs" --define=PART_TM4C123GH6PM -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="InitConsole.d_raw" "../InitConsole.c"
    Finished building: "../InitConsole.c"
    Building file: "../arch/arm-cortexM4/drivers/Dio.c"
    Invoking: ARM Compiler
    "C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --include_path="C:/Users/visitor/Documents/CODECOMPOSER 8/AutosarCanStack" --include_path="C:/ti/TivaWare_C_Series-2.1.4.178" --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/include" --define=ccs="ccs" --define=PART_TM4C123GH6PM -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="arch/arm-cortexM4/drivers/Dio.d_raw" --obj_directory="arch/arm-cortexM4/drivers" "../arch/arm-cortexM4/drivers/Dio.c"
    Finished building: "../arch/arm-cortexM4/drivers/Dio.c"
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Thank you for providing the build logs. This is unfortunately a bug in the version of compiler tools you are using. Please take a look at this related thread

    In your case if you change the define in the compiler options to:

    --define=ccs=\"ccs\" 

    it should then report the MISRA warnings as expected.

  • Thanks AartiG, 

    could you tell me how to change -in steps- the define in the compiler options , please ? 

    Regards, 

    Sarea

  • Sarea,

    It is under Project Properties->Build->Compiler->Predefined Symbols.

    Change the symbol as shown in the screenshot.