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.

Issues with the C2000 v 6.1.3 compiler

Other Parts Discussed in Thread: TMS320F2812

For one of our products which is based on the TMS320F2812 processors we are using the C2000 v.6.1.3 compiler. The product was tested with compiled code with the "-g" option (Debug). Everything was working fine. The product team decided to release the code without the -g option "Release". An EEPROM chip on the SPI bus stopped working i.e. writes to it no longer work. The team decided to also try a newer compiler v 6.2.0 and realized that the EEPROM chip works with or without the "-g" switch in the compiler options.

Since we can calculate the CRC of exactly what goes into the flash of the CPU by adding the "_DEBUG" switch to the release build we were able to get the same CRC for version 6.2.0 for a build with "-g" and a build without "-g". When we tried this with 6.1.3 the CRC was different between the release and debug builds.

I have a version of the project were we stripped everything out but the EEPROM driver and the behavior is the same.

  • In versions of the compiler before 6.2.0, using the -g option does affect the generated assembly code.  Starting with version 6.2.0, this is no longer the case.  You get the same generated assembly code regardless of whether -g is used.  Please see this wiki article for more details.

    Thanks and regards,

    -George

  • So for the code below .dwcfi, .dwtag and .dwattr never make it to the object code, right? In 6.1.3 Release the only differences were this extra instructions yet the loops seems to execute a touch faster. It is possible that I am not looking at the right place in the assembly too:

    _delay_us:
    .dwcfi cfa_offset, -2
    .dwcfi save_reg_to_mem, 26, 0
    .dwcfi save_reg_to_reg, 78, 26
    ADDB SP,#6 ; [CPU_U]
    .dwcfi cfa_offset, -8
    $C$DW$9 .dwtag DW_TAG_variable, DW_AT_name("microsecs")
    .dwattr $C$DW$9, DW_AT_TI_symbol_name("_microsecs")
    .dwattr $C$DW$9, DW_AT_type(*$C$DW$T$20)
    .dwattr $C$DW$9, DW_AT_location[DW_OP_breg20 -1]
    $C$DW$10 .dwtag DW_TAG_variable, DW_AT_name("ulCount")
    .dwattr $C$DW$10, DW_AT_TI_symbol_name("_ulCount")
    .dwattr $C$DW$10, DW_AT_type(*$C$DW$T$24)
    .dwattr $C$DW$10, DW_AT_location[DW_OP_breg20 -4]
    $C$DW$11 .dwtag DW_TAG_variable, DW_AT_name("ulGoal")
    .dwattr $C$DW$11, DW_AT_TI_symbol_name("_ulGoal")
    .dwattr $C$DW$11, DW_AT_type(*$C$DW$T$24)
    .dwattr $C$DW$11, DW_AT_location[DW_OP_breg20 -6]
    MOV *-SP[1],AL ; [CPU_] |56|
    .dwpsn file "../src/P180_TimeDelay.c",line 60,column 5,is_stmt
    MOVU ACC,*-SP[1] ; [CPU_] |60|
    MOVL *-SP[6],ACC ; [CPU_] |60|
    .dwpsn file "../src/P180_TimeDelay.c",line 62,column 10,is_stmt
    MOVB ACC,#0 ; [CPU_] |62|
    MOVL *-SP[4],ACC ; [CPU_] |62|
    .dwpsn file "../src/P180_TimeDelay.c",line 62,column 25,is_stmt
    MOVL ACC,*-SP[6] ; [CPU_] |62|
    CMPL ACC,*-SP[4] ; [CPU_] |62|
    B $C$L4,LOS ; [CPU_] |62|

  • Dan Amarandei said:
    So for the code below .dwcfi, .dwtag and .dwattr never make it to the object code, right?

    Incorrect.  The information in those Dwarf directives (the lines that start .dw) is encoded in the debug information.

    Dan Amarandei said:
    In 6.1.3 Release the only differences were this extra instructions yet the loops seems to execute a touch faster.

    There are several reasons the generated assembly code can be different between compiler versions.  The difference related to the affect of using -g or not is but one of them.

    Thanks and regards,

    -George