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.

Compiler/TMS570LC4357: __delay_cycles(); results in unresolved reference compilation error

Part Number: TMS570LC4357

Tool/software: TI C/C++ Compiler

When updating the compiler in my project to v18.1.1.LTS, the call to the intrinsic __delay_cycles() results in an unresolved reference compilation error.

Changing the compiler back to v16.9.7.LTS and the project compiles fine. 

  • I am unable to reproduce this problem.  For the source file which contains the call to __delay_cycles, please send in a test case as described in the article How to Submit a Compiler Test Case.

    Thanks and regards,

    -George

  • Simply creating a "hello world" project and adding a call to __delay_cycles() showed the problem on my system.
    Also verified that a peer's development system showed the same problem.

    Preprocessed source file attached.

    CCS version: 7.3.0.00019
    TI Compiler: 18.1.1.LTS
    Processor:    TMS570LC43xx

    hello.pp.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    /*****************************************************************************/
    /* STDIO.H */
    /* */
    /* Copyright (c) 1993 Texas Instruments Incorporated */
    /* http://www.ti.com/ */
    /* */
    /* Redistribution and use in source and binary forms, with or without */
    /* modification, are permitted provided that the following conditions */
    /* are met: */
    /* */
    /* Redistributions of source code must retain the above copyright */
    /* notice, this list of conditions and the following disclaimer. */
    /* */
    /* Redistributions in binary form must reproduce the above copyright */
    /* notice, this list of conditions and the following disclaimer in */
    /* the documentation and/or other materials provided with the */
    /* distribution. */
    /* */
    /* Neither the name of Texas Instruments Incorporated nor the names */
    /* of its contributors may be used to endorse or promote products */
    /* derived from this software without specific prior written */
    /* permission. */
    /* */
    /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
    /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
    /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
    /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
    /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
    /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
    /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
    /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
    /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
    /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
    /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
    /* */
    /*****************************************************************************/
    /*****************************************************************************/
    /* _ti_config.h */
    /* */
    /* Copyright (c) 2017 Texas Instruments Incorporated */
    /* http://www.ti.com/ */
    /* */
    /* Redistribution and use in source and binary forms, with or without */
    /* modification, are permitted provided that the following conditions */
    /* are met: */
    /* */
    /* Redistributions of source code must retain the above copyright */
    /* notice, this list of conditions and the following disclaimer. */
    /* */
    /* Redistributions in binary form must reproduce the above copyright */
    /* notice, this list of conditions and the following disclaimer in */
    /* the documentation and/or other materials provided with the */
    /* distribution. */
    /* */
    /* Neither the name of Texas Instruments Incorporated nor the names */
    /* of its contributors may be used to endorse or promote products */
    /* derived from this software without specific prior written */
    /* permission. */
    /* */
    /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
    /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
    /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
    /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
    /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
    /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • The compiler options matter here. That intrinsic is only defined for Cortex-M0, M3, M4, and R4. Are you specifying one of these with the --silicon_version option?
  • Thank you. I was aware of this limitation, but since the project using compiler v16.x was working fine and "all I did" was change the compiler. I did not however, go back to look at the limitations of the older compiler documentation w/rt to these intrinsic functions. I do know that ours is an R4 and when I looked at the existing project settings they are set to R5. When I changed it to "7R4", the program compiled and linked without error.
  • We're using the TMS570LC4357 MCU, which is an ARM Cortex-R5 processor.  I haven't found anything in the TI documentation which specifies it, but ARM's Technical Reference Manual specifies Cortex-R5s as implementing the ARMv7-R architecture.

    With the project we set up using the CCS wizard it has us compiling using the "-mv7R5" option to the compiler, but is not specifying any --silicon_version option. My understanding is that -mv is an alias to --silicon_version, and that there's no need to use both options.

    I assume that it would be unwise for us to specify 7R4 to either -mv or to --silicon_version.

    Table 5-3 ARM Intrinsic Support by Target specifies that __delay_cycles() is supported for ARM V7R (Cortex-R4).  It doesn't explicitly say anything about Cortex-R5 one way or another.  However, as above, I believe Cortex-R5 _is_ an ARM V7R.

     v16.9.6 and v16.9.7 both compile __delay_cycles() when -mv7R5 is specified.

    Is there a reason that v18.1.1 does not support __delay_cycles() for -mv7R5?

    --thx

  • 1138 said:
    Is there a reason that v18.1.1 does not support __delay_cycles() for -mv7R5?

    I don't know.  So, I filed CODEGEN-4692 in the SDOWP system.  It says not supporting __delay_cycles for Cortex-R5 is a bug.  If that is wrong, then this is one way to find out.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • CODEGEN-4692 is currently listing a status of "Open" in SDOWP. Does this mean that this issue has not been either formally accepted or declined?

    --thx
  • Unfortunately, it is still in the just filed state.  I am looking into it.  I am confident I can get it moving.  I apologize for the delay.

    Thanks and regards,

    -George