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.

Problem with TI compiler

Other Parts Discussed in Thread: TMS320F28377D

Hi

I have discovered 2 problems with the TI compiler used in our project.

General info.

CCSv6
MCU: TMS320F28377D
Compiler: TI v6.4.4
SYS/BIOS 6.40.3.39

1. We have a for loop that does not loop correctly, it never stops, but should have when i is 0.

Uint16 i;

...

if(pIovTx)
{
    pIov = pIovTx;
    // for (i = iovTxCount; i; i--) /* THIS FAILS WITH TI COMPILER v6.4.4 and optimization level 2! */
    for (i = 0; i < iovTxCount; i++) /* This works */
    {
        if(pIov->addr)
        {
            if (pIov->swap)
                memcpySwap(pBuff, pIov->addr, pIov->len);
            else
                memcpyNoSwap(pBuff, pIov->addr, pIov->len);
        }
        else
        {
            memset(pBuff, 0, pIov->len);
        }
        pBuff += pIov->len;
        pIov++;
    }
}

2. We get an INTERNAL ERROR in another file

'Building file: ../hw/hw_mram_spi.c'
'Invoking: C2000 Compiler'
"C:/ti/ccsv6/tools/compiler/ti-cgt-c2000_6.4.4/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -O2 --opt_for_speed=2 --fp_mode=relaxed --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-c2000_6.4.4/include" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/app" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/util" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/util_MRM" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/esc" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/hw" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/lib_headers" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/F2837xD_headers/include" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/hw_ext" --define=_FLASH --define=DMM_APP --define=PARMNV_DISABLE_no --define=DSP28377D_DEVICE --define=CPU1 --define=F28_BIOS --define=DEBUG --diag_warning=225 --display_error_number --diag_wrap=off --printf_support=minimal --preproc_with_compile --preproc_dependency="hw/hw_mram_spi.pp" --obj_directory="hw" --cmd_file="./configPkg/compiler.opt" "../hw/hw_mram_spi.c"
>> ../hw/hw_mram_spi.c, line 164: INTERNAL ERROR: >>>Register allocation failed:

>> Compilation failure
mram_init

Snippet:

int mram_init(void)
{
    Uint32 i, x;
    Uint16 err;
    Uint16 statusRegister=0;
    err = 0;

    // Read status register
    err |= spi_txrx(MRAM_CC_RDSR, 0, &statusRegister, 1);
    printf("MRAM: SR = %x\r\n", ((int)statusRegister) );

    err |= spi_txrx(MRAM_CC_RDSR, 0, &statusRegister, 1);
    printf("MRAM: SR = %x\r\n", ((int)statusRegister) );

    // Write enable
    err |= spi_txrx(MRAM_CC_WREN, 0, 0, 0);

    // Read status register
    err |= spi_txrx(MRAM_CC_RDSR, 0, &statusRegister, 1);
    printf("MRAM: SR = %x\r\n", ((int)statusRegister) );

    // Configure status register (write enable all blocks)
    statusRegister = 0x02;
    err |= spi_txrx(MRAM_CC_WRSR, 0, &statusRegister, 1);   // THIS IS LINE 164

    // Read status register
    err |= spi_txrx(MRAM_CC_RDSR, 0, &statusRegister, 1);
    printf("MRAM: SR = %x\r\n", ((int)statusRegister) );

If I remove any code line above this the error is gone.

How do I provide the best info for You to solve this? I'd prefer not to give you our whole project, since this is for a client.

Many thanks,

Mads

  • Error no. 1 does not fail with Compiler v6.2.8.
    Error no. 2 also fails with Compiler v.6.2.8
  • For each problem I need a test case.  Preprocess the file that contains the problem source.  Also show exactly how the file is built.  The entire project is not needed.  If you are not comfortable with attaching this to your next post, then we can discuss how to send it only to me.

    Thanks and regards,

    -George

  • Hi George

    Many thanks for the link.

    Here is the  pp file for the INTERNAL ERROR and build output.

    I have mailed you the pp file instead.

    Build output:


    "C:\\ti\\ccsv6\\utils\\bin\\gmake" -k -j 4 all
    'Building file: ../hw/hw_mram_spi.c'
    'Invoking: C2000 Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-c2000_6.4.4/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -O2 --opt_for_speed=2 --fp_mode=relaxed --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-c2000_6.4.4/include" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/app" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/util" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/util_MRM" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/esc" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/hw" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/lib_headers" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/F2837xD_headers/include" --include_path="C:/Data/svn/iRotor/DMM/trunk/dmm_src/hw_ext" --preproc_with_compile --preproc_with_comment --define=_FLASH --define=DMM_APP --define=PARMNV_DISABLE_no --define=DSP28377D_DEVICE --define=CPU1 --define=F28_BIOS --define=DEBUG --diag_warning=225 --display_error_number --diag_wrap=off --printf_support=minimal --obj_directory="hw" --cmd_file="./configPkg/compiler.opt" "../hw/hw_mram_spi.c"
    >> ../hw/hw_mram_spi.c, line 161: INTERNAL ERROR: >>>Register allocation failed:
    mram_init


    This may be a serious problem. Please contact customer support with a
    description of this problem and a sample of the source files that caused this
    INTERNAL ERROR message to appear.

    Cannot continue compilation - ABORTING!


    >> Compilation failure
    gmake: *** [hw/hw_mram_spi.obj] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

  • Mads Lind Christiansen said:
    We have a for loop that does not loop correctly, it never stops, but should have when i is 0.

    I received the test case you sent for this problem.  Thank you.  I can reproduce this error.  I filed SDSCM00051974 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    Mads Lind Christiansen said:
    We get an INTERNAL ERROR in another file

    I received this test case as well.  Thank you again.  I'll look into it next.

    Thanks and regards,

    -George

  • Mads Lind Christiansen said:
    We get an INTERNAL ERROR in another file

    I can reproduce this behavior.  I filed SDSCM00051975 in the SDOWP system to have this investigated.  Feel free to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • This sounds great.

    Just wondering, I cannot find them (SDSCM00051974 & SDSCM00051975) in SDOWP.
    Are they hidden in any way?

    Many thanks!
    Mads
  • Mads Lind Christiansen said:
    I cannot find them (SDSCM00051974 & SDSCM00051975) in SDOWP

    I can see them through the TI internal view.  But I do not see them through the external view available to customers like you.  I will notify the associated team.

    Thanks and regards,

    -George